Skip to content

Commit

Permalink
Merge branch 'master' into fix-tape-property-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andrijapau authored Dec 6, 2024
2 parents 943c928 + 7695209 commit 284bc51
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/ops/functions/test_iterative_qpe.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ class TestIQPE:
def test_compare_qpe(self, mcm_method, phi):
"""Test to check that the results obtained are equivalent to those of QuantumPhaseEstimation"""

# TODO: When we have general statistics on measurements we can calculate it exactly with qml.probs
dev = qml.device("default.qubit", shots=10000000)
dev = qml.device("default.qubit")

@qml.qnode(dev, mcm_method=mcm_method)
def circuit_iterative():
Expand All @@ -39,11 +38,9 @@ def circuit_iterative():
# Iterative QPE
measurements = qml.iterative_qpe(qml.RZ(phi, wires=[0]), aux_wire=[1], iters=3)

return [qml.sample(op=meas) for meas in measurements]
return qml.probs(op=measurements)

sample_list = np.array(circuit_iterative())
sample_list = sample_list.T
output = qml.probs().process_samples(np.array(sample_list), wire_order=[0, 1, 2])
output = circuit_iterative()

@qml.qnode(dev)
def circuit_qpe():
Expand Down

0 comments on commit 284bc51

Please sign in to comment.