We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d7b1177 commit 93a2374Copy full SHA for 93a2374
src/algorithms/StatePreparation.cpp
@@ -39,7 +39,7 @@ template <typename T>
39
}
40
41
template <typename T>
42
-[[nodiscard]] auto isNormalized(const std::vector<T>& vec) -> bool {
+[[nodiscard]] auto isNormalized(const std::vector<T>& vec, double EPS) -> bool {
43
return std::abs(1 - twoNorm(vec)) < EPS;
44
45
@@ -265,7 +265,7 @@ auto createStatePreparationCircuit(
265
std::vector<std::complex<double>>& amplitudes, double EPS)
266
-> QuantumComputation {
267
268
- if (!isNormalized(amplitudes)) {
+ if (!isNormalized(amplitudes, EPS)) {
269
throw std::invalid_argument{
270
"Using State Preparation with Amplitudes that are not normalized"};
271
0 commit comments