Skip to content

Commit

Permalink
test c3sx gate
Browse files Browse the repository at this point in the history
  • Loading branch information
CalMacCQ committed Jun 29, 2023
1 parent 3ff9cff commit 000e018
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/qiskit_convert_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -977,14 +977,19 @@ def test_csx_conversion() -> None:
qc_csx.append(qiskit_gates.CSXGate(), [0, 1])
qc_csx.append(qiskit_gates.CSXGate(), [1, 0])
converted_tkc = qiskit_to_tk(qc_csx)
assert converted_tkc.n_gates_of_type(OpType.CSX) == converted_tkc.n_gates == 2
assert converted_tkc.n_gates == 2
assert converted_tkc.n_gates_of_type(OpType.CSX) == 2
u1 = converted_tkc.get_unitary()
new_tkc_csx = Circuit(2)
new_tkc_csx.add_gate(OpType.CSX, [0, 1]).add_gate(OpType.CSX, [1, 0])
u2 = new_tkc_csx.get_unitary()
assert compare_unitaries(u1, u2)
converted_qc = tk_to_qiskit(new_tkc_csx)
assert converted_qc.count_ops()["csx"] == 2
qc_c3sx = QuantumCircuit(4)
qc_c3sx.append(qiskit_gates.C3SXGate(), [0, 1, 2, 3])
tkc_c3sx = qiskit_to_tk(qc_c3sx)
assert tkc_c3sx.n_gates == tkc_c3sx.n_gates_of_type(OpType.QControlBox) == 1


def test_CS_and_CSdg() -> None:
Expand Down

0 comments on commit 000e018

Please sign in to comment.