Skip to content

Commit 93a2374

Browse files
fixed last EPS missing
1 parent d7b1177 commit 93a2374

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/algorithms/StatePreparation.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ template <typename T>
3939
}
4040

4141
template <typename T>
42-
[[nodiscard]] auto isNormalized(const std::vector<T>& vec) -> bool {
42+
[[nodiscard]] auto isNormalized(const std::vector<T>& vec, double EPS) -> bool {
4343
return std::abs(1 - twoNorm(vec)) < EPS;
4444
}
4545

@@ -265,7 +265,7 @@ auto createStatePreparationCircuit(
265265
std::vector<std::complex<double>>& amplitudes, double EPS)
266266
-> QuantumComputation {
267267

268-
if (!isNormalized(amplitudes)) {
268+
if (!isNormalized(amplitudes, EPS)) {
269269
throw std::invalid_argument{
270270
"Using State Preparation with Amplitudes that are not normalized"};
271271
}

0 commit comments

Comments
 (0)