From 40c6eba676273caf41d3266d826cbdd1e441c1b9 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Mon, 26 Feb 2024 12:50:53 -0600 Subject: [PATCH] qiskit.extensions, cx, i --- mitiq/ddd/tests/test_insertion.py | 22 +++++++++++----------- mitiq/pec/types/tests/test_types.py | 8 ++++---- mitiq/tests/test_conversions.py | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/mitiq/ddd/tests/test_insertion.py b/mitiq/ddd/tests/test_insertion.py index 98b38128f7..9ddb9962ee 100644 --- a/mitiq/ddd/tests/test_insertion.py +++ b/mitiq/ddd/tests/test_insertion.py @@ -66,16 +66,16 @@ circuit_qiskit_validated.x(i) circuit_qiskit_validated.x(3) if i != 3 and i != 0: - circuit_qiskit_validated.i(i) + circuit_qiskit_validated.id(i) circuit_qiskit_validated.x(i) - circuit_qiskit_validated.i(i) + circuit_qiskit_validated.id(i) circuit_qiskit_validated.x(i) - circuit_qiskit_validated.i(i) + circuit_qiskit_validated.id(i) elif i == 0: - circuit_qiskit_validated.i(i) + circuit_qiskit_validated.id(i) circuit_qiskit_validated.x(i) circuit_qiskit_validated.x(i) - circuit_qiskit_validated.i(i) + circuit_qiskit_validated.id(i) circuit_qiskit_validated.cx(0, 3) # Qiskit validate with measurement @@ -86,17 +86,17 @@ circuit_qiskit_two_validated.x(3) if i != 3 and i != 0: if i == 1: - circuit_qiskit_two_validated.i(i) - circuit_qiskit_two_validated.i(i) + circuit_qiskit_two_validated.id(i) + circuit_qiskit_two_validated.id(i) circuit_qiskit_two_validated.x(i) - circuit_qiskit_two_validated.i(i) + circuit_qiskit_two_validated.id(i) circuit_qiskit_two_validated.x(i) - circuit_qiskit_two_validated.i(i) + circuit_qiskit_two_validated.id(i) elif i == 0: - circuit_qiskit_two_validated.i(i) + circuit_qiskit_two_validated.id(i) circuit_qiskit_two_validated.x(i) circuit_qiskit_two_validated.x(i) - circuit_qiskit_two_validated.i(i) + circuit_qiskit_two_validated.id(i) circuit_qiskit_two_validated.cx(0, 3) circuit_qiskit_two_validated.measure(2, 3) diff --git a/mitiq/pec/types/tests/test_types.py b/mitiq/pec/types/tests/test_types.py index b79235dfa7..976066daab 100644 --- a/mitiq/pec/types/tests/test_types.py +++ b/mitiq/pec/types/tests/test_types.py @@ -76,7 +76,7 @@ def test_init_with_qiskit_circuit(): qreg = qiskit.QuantumRegister(2) circ = qiskit.QuantumCircuit(qreg) _ = circ.h(qreg[0]) - _ = circ.cnot(*qreg) + _ = circ.cx(*qreg) cirq_qreg = cirq.LineQubit.range(2) cirq_circ = cirq.Circuit(cirq.H.on(cirq_qreg[0]), cirq.CNOT.on(*cirq_qreg)) @@ -100,8 +100,8 @@ def test_init_with_qiskit_circuit(): ( cirq.H, cirq.H(cirq.LineQubit(0)), - qiskit.extensions.HGate, - qiskit.extensions.CHGate, + qiskit.circuit.library.HGate, + qiskit.circuit.library.CHGate, pyquil.gates.H, ), ) @@ -142,7 +142,7 @@ def test_unknown_channel_matrix(): qreg = qiskit.QuantumRegister(2) circ = qiskit.QuantumCircuit(qreg) _ = circ.h(qreg[0]) - _ = circ.cnot(*qreg) + _ = circ.cx(*qreg) cirq_qreg = cirq.LineQubit.range(2) cirq_circ = cirq.Circuit(cirq.H.on(cirq_qreg[0]), cirq.CNOT.on(*cirq_qreg)) diff --git a/mitiq/tests/test_conversions.py b/mitiq/tests/test_conversions.py index 35b980eb07..953b48a775 100644 --- a/mitiq/tests/test_conversions.py +++ b/mitiq/tests/test_conversions.py @@ -43,7 +43,7 @@ qiskit_qreg = qiskit.QuantumRegister(2) qiskit_circuit = qiskit.QuantumCircuit(qiskit_qreg) qiskit_circuit.h(qiskit_qreg[0]) -qiskit_circuit.cnot(*qiskit_qreg) +qiskit_circuit.cx(*qiskit_qreg) qasm_str = qiskit_circuit.qasm()