Skip to content

Commit

Permalink
test_transpilation: adjust qft transpilation after Qiskit update
Browse files Browse the repository at this point in the history
  • Loading branch information
airwoodix committed May 21, 2024
1 parent 95a7d6c commit 4be352f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/test_transpilation.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,24 @@ def test_qft_circuit_transpilation(

assert set(trans_qc.count_ops()) <= set(offline_simulator_no_noise.configuration().basis_gates)

rxx_count = 0
r_count = 0
for operation in trans_qc.data:
instruction = operation[0]
if instruction.name == "rxx":
(theta,) = instruction.params
assert 0 <= float(theta) <= pi / 2
rxx_count += 1

if instruction.name == "r":
(theta, _) = instruction.params
assert abs(theta) <= pi
r_count += 1

if optimization_level < 3 and qubits < 6:
assert r_count > 0

if qubits > 1:
assert rxx_count > 0

if optimization_level < 2 and qubits < 6:
assert_circuits_equivalent(qc, trans_qc)

0 comments on commit 4be352f

Please sign in to comment.