Skip to content

Commit

Permalink
fixed memory access
Browse files Browse the repository at this point in the history
  • Loading branch information
gandalfr-KY committed Feb 8, 2024
1 parent 9a7da5f commit 436e287
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/circuit/circuit_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ TEST(CircuitTest, CircuitBasic) {
*/

circuit.update_quantum_state(state);

auto state_cp = state.amplitudes();
for (UINT i = 0; i < dim; ++i)
ASSERT_NEAR(std::abs(state_eigen[i] - (CComplex)state[i]), 0, eps);
ASSERT_NEAR(std::abs(state_eigen[i] - (CComplex)state_cp[i]), 0, eps);
}

TEST(CircuitTest, CircuitRev) {
Expand Down

0 comments on commit 436e287

Please sign in to comment.