Skip to content

Commit

Permalink
Migrate away from deprecated QuantumCircuit methods
Browse files Browse the repository at this point in the history
Namely, the `toffoli` and `cnot` methods have been deprecated
starting with Qiskit 0.45.
  • Loading branch information
garrison committed Dec 7, 2023
1 parent 90a0311 commit d66ee66
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions test/cutting/test_cutting_decomposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def test_partition_circuit_qubits(self):
)
with self.subTest("Unsupported gate"):
compare_circuit = QuantumCircuit(3)
compare_circuit.toffoli(0, 1, 2)
compare_circuit.ccx(0, 1, 2)
partitions = [0, 1, 1]
with pytest.raises(ValueError) as e_info:
partition_circuit_qubits(compare_circuit, partitions)
Expand All @@ -147,7 +147,7 @@ def test_partition_circuit_qubits(self):
)
with self.subTest("Toffoli gate in a single partition"):
circuit = QuantumCircuit(4)
circuit.toffoli(0, 1, 2)
circuit.ccx(0, 1, 2)
circuit.rzz(np.pi / 7, 2, 3)
partition_circuit_qubits(circuit, "AAAB")

Expand Down
2 changes: 1 addition & 1 deletion test/cutting/test_cutting_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def test_execute_experiments(self):
with self.subTest("Dict of non-unique samplers"):
qc = QuantumCircuit(2)
qc.x(0)
qc.cnot(0, 1)
qc.cx(0, 1)
subcircuits, _, subobservables = partition_problem(
circuit=qc, partition_labels="AB", observables=PauliList(["XX"])
)
Expand Down
4 changes: 2 additions & 2 deletions test/utils/test_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ def test_separate_circuit(self):
with self.subTest("frozenset for each partition label"):
circuit = QuantumCircuit(4)
circuit.x(0)
circuit.cnot(1, 2)
circuit.cx(1, 2)
circuit.h(3)
partition_labels = [
frozenset([0]),
Expand All @@ -401,7 +401,7 @@ def test_separate_circuit(self):
compare[frozenset([0])] = QuantumCircuit(1)
compare[frozenset([0])].x(0)
compare[frozenset([1])] = QuantumCircuit(2)
compare[frozenset([1])].cnot(0, 1)
compare[frozenset([1])].cx(0, 1)
compare[frozenset([2])] = QuantumCircuit(1)
compare[frozenset([2])].h(0)
assert separated_circuits.subcircuits.keys() == compare.keys()
Expand Down

0 comments on commit d66ee66

Please sign in to comment.