Skip to content

Commit

Permalink
attempt to debug C.I. test case issue
Browse files Browse the repository at this point in the history
  • Loading branch information
CalMacCQ committed Jan 2, 2025
1 parent eec8fe5 commit 9d66595
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/qiskit_convert_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1214,8 +1214,8 @@ def test_ifelseop_two_branches() -> None:


def test_ifelseop_one_branch() -> None:
qubits = QuantumRegister(1)
clbits = ClassicalRegister(1)
qubits = QuantumRegister(1, "q1")
clbits = ClassicalRegister(1, "c1")
circuit = QuantumCircuit(qubits, clbits)
(q0,) = qubits
(c0,) = clbits
Expand All @@ -1225,16 +1225,17 @@ def test_ifelseop_one_branch() -> None:
with circuit.if_test((c0, 1)):
circuit.x(q0)
circuit.measure(q0, c0)

print(circuit)
tket_circ_if_else = qiskit_to_tk(circuit)
tket_circ_if_else.name = "test_circ"
print(tket_circ_if_else.get_commands())

# Manually build the expected pytket Circuit.
# Validate against tket_circ.
expected_circ = Circuit()
expected_circ.name = "test_circ"
q1 = expected_circ.add_q_register("q1", 1)
c0_tk = expected_circ.add_c_register("c0", 1)
c0_tk = expected_circ.add_c_register("c1", 1)
expected_circ.H(q1[0])
expected_circ.Measure(q1[0], c0_tk[0])
x_circ = Circuit()
Expand Down

0 comments on commit 9d66595

Please sign in to comment.