Skip to content

Commit

Permalink
trying again to fix the test
Browse files Browse the repository at this point in the history
  • Loading branch information
albi3ro committed Oct 22, 2024
1 parent 13c8c4d commit df8a35b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions tests/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1639,20 +1639,24 @@ def test_diff_meas_circuit(self):
qc.cx(0, 1)
qc.measure(1, 1)

m1, m2 = load(qc)()
for m, w in zip((m1, m2), (0, 1)):
assert isinstance(m, qml.measurements.MeasurementValue)
assert len(m.measurements) == 1
assert m.measurements[0].wires == qml.wires.Wires(w)

qc1 = QuantumCircuit(3, 3)
qc1.h(0)
qc1.measure(2, 2)
qc1.rx(angle, [0])
qc1.cx(0, 1)
qc1.measure(1, 1)

qtemp, qtemp1 = load(qc), load(qc1)
assert qml.equal(qtemp()[0], qml.measure(0))
assert qml.equal(qtemp1()[0], qml.measure(2))

qtemp2 = load(qc, measurements=[qml.expval(qml.PauliZ(0))])
assert not qml.equal(qtemp()[0], qtemp2()[0])
qml.assert_equal(qtemp2()[0], qml.expval(qml.PauliZ(0)) )
m1, m2 = load(qc1)()
for m, w in zip((m1, m2), (2, 1)):
assert isinstance(m, qml.measurements.MeasurementValue)
assert len(m.measurements) == 1
assert m.measurements[0].wires == qml.wires.Wires(w)


class TestConverterPennyLaneCircuitToQiskit:
Expand Down

0 comments on commit df8a35b

Please sign in to comment.