Skip to content

Commit a7c2021

Browse files
committed
reduced QPE precision in the other hamsim test
1 parent f094f6f commit a7c2021

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/operator_tests/test_qubit_hamiltonian_simulation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ def test_qubit_hamiltonian_simulation():
3939
E1 = H.get_measurement(qv)
4040
assert abs(E1-E0)<5e-2
4141

42-
qpe_res = QPE(qv,U,precision=10,kwargs={"steps":3},iter_spec=True)
42+
qpe_res = QPE(qv,U,precision=6,kwargs={"steps":3},iter_spec=True)
4343

4444
results = qpe_res.get_measurement()
4545
sorted_results= dict(sorted(results.items(), key=lambda item: item[1], reverse=True))
4646

4747
phi = list(sorted_results.items())[0][0]
4848
E_qpe = 2*np.pi*(phi-1) # Results are modulo 2*pi, therefore subtract 2*pi
49-
assert abs(E_qpe-E0)<5e-3
49+
assert abs(E_qpe-E0)<2e-2
5050

5151

5252
from scipy.linalg import expm, norm

0 commit comments

Comments
 (0)