diff --git a/dev_requirements.txt b/dev_requirements.txt index 15633c6e33..facdfa4e75 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -2,6 +2,7 @@ qiskit~=1.0.1 qiskit-aer~=0.13.2 qiskit-ibm-provider~=0.8.0 +qiskit-ibm-runtime pyquil~=3.5.4 pennylane-qiskit~=0.34.0 pennylane~=0.34.0 diff --git a/docs/source/examples/calibration-tutorial.md b/docs/source/examples/calibration-tutorial.md index f6edf05751..38cd7b50d1 100644 --- a/docs/source/examples/calibration-tutorial.md +++ b/docs/source/examples/calibration-tutorial.md @@ -43,7 +43,7 @@ from mitiq import ( MeasurementResult, ) -from qiskit.providers.fake_provider import FakeJakarta # Fake (simulated) QPU +from qiskit_ibm_runtime.fake_provider import FakeJakarta # Fake (simulated) QPU ``` ### Define the circuit to study diff --git a/docs/source/examples/ddd_on_ibmq_ghz.md b/docs/source/examples/ddd_on_ibmq_ghz.md index 546f846067..2b2cc361e4 100644 --- a/docs/source/examples/ddd_on_ibmq_ghz.md +++ b/docs/source/examples/ddd_on_ibmq_ghz.md @@ -16,7 +16,7 @@ kernelspec: In this notebook DDD is applied to improve the success rate of the computation on a real hardware backend. A similar approach can be taken on a simulated backend, by setting the ``USE_REAL_HARDWARE`` option to ``False`` -and specifying a simulated backend from `qiskit.providers.fake_provider`, which includes a noise model that approximates the noise of the +and specifying a simulated backend from `qiskit_ibm_runtime.fake_provider`, which includes a noise model that approximates the noise of the real device. In DDD, sequences of gates are applied to slack windows, i.e. single-qubit idle windows, in a quantum circuit. @@ -148,7 +148,7 @@ if USE_REAL_HARDWARE: provider = IBMProvider() backend = provider.get_backend("ibmq_lima") else: - from qiskit.providers.fake_provider import FakeLima as FakeLima + from qiskit_ibm_runtime.fake_provider import FakeLima as FakeLima backend = FakeLima() diff --git a/docs/source/examples/ggi_summer_school_solved.md b/docs/source/examples/ggi_summer_school_solved.md index 508cb6275d..705c75eeae 100644 --- a/docs/source/examples/ggi_summer_school_solved.md +++ b/docs/source/examples/ggi_summer_school_solved.md @@ -116,7 +116,7 @@ from qiskit import QuantumCircuit from qiskit.providers.aer import AerSimulator from qiskit.tools.visualization import plot_histogram from qiskit import transpile -from qiskit.providers.fake_provider import FakeJakarta # Fake (simulated) QPUs +from qiskit_ibm_runtime.fake_provider import FakeJakarta # Fake (simulated) QPUs # Number of measurements shots = 10 ** 5 diff --git a/docs/source/examples/ggi_summer_school_unsolved.md b/docs/source/examples/ggi_summer_school_unsolved.md index eb4e02bf9f..c0007df76d 100644 --- a/docs/source/examples/ggi_summer_school_unsolved.md +++ b/docs/source/examples/ggi_summer_school_unsolved.md @@ -114,7 +114,7 @@ from qiskit import QuantumCircuit from qiskit_aer import AerSimulator from qiskit.tools.visualization import plot_histogram from qiskit import transpile -from qiskit.providers.fake_provider import FakeJakarta # Fake (simulated) QPUs +from qiskit_ibm_runtime.fake_provider import FakeJakarta # Fake (simulated) QPUs # Number of measurements shots = 10 ** 5 diff --git a/mitiq/interface/mitiq_qiskit/conversions.py b/mitiq/interface/mitiq_qiskit/conversions.py index 98c80a7ba9..d2f4bf5f16 100644 --- a/mitiq/interface/mitiq_qiskit/conversions.py +++ b/mitiq/interface/mitiq_qiskit/conversions.py @@ -14,6 +14,7 @@ import numpy as np import qiskit from cirq.contrib.qasm_import import circuit_from_qasm +from qiskit.qasm2 import dumps from mitiq.utils import _simplify_circuit_exponents @@ -283,7 +284,7 @@ def from_qiskit(circuit: qiskit.QuantumCircuit) -> cirq.Circuit: Returns: Mitiq circuit representation equivalent to the input Qiskit circuit. """ - return from_qasm(circuit.qasm()) + return from_qasm(dumps(circuit)) def from_qasm(qasm: QASMType) -> cirq.Circuit: diff --git a/mitiq/interface/mitiq_qiskit/tests/test_conversions_qiskit.py b/mitiq/interface/mitiq_qiskit/tests/test_conversions_qiskit.py index 93bc7276d7..3ffae5ea54 100644 --- a/mitiq/interface/mitiq_qiskit/tests/test_conversions_qiskit.py +++ b/mitiq/interface/mitiq_qiskit/tests/test_conversions_qiskit.py @@ -25,6 +25,7 @@ to_qiskit, ) from mitiq.utils import _equal +from qiskit.qasm2 import dumps def _multi_reg_circuits(): @@ -209,7 +210,7 @@ def test_convert_with_barrier(as_qasm): qiskit_circuit.barrier() if as_qasm: - cirq_circuit = from_qasm(qiskit_circuit.qasm()) + cirq_circuit = from_qasm(dumps(qiskit_circuit)) else: cirq_circuit = from_qiskit(qiskit_circuit) @@ -229,7 +230,7 @@ def test_convert_with_multiple_barriers(as_qasm): qiskit_circuit.barrier() if as_qasm: - cirq_circuit = from_qasm(qiskit_circuit.qasm()) + cirq_circuit = from_qasm(dumps(qiskit_circuit)) else: cirq_circuit = from_qiskit(qiskit_circuit) diff --git a/mitiq/interface/mitiq_qiskit/tests/test_qiskit_utils.py b/mitiq/interface/mitiq_qiskit/tests/test_qiskit_utils.py index c2ce90ce76..9bf4a1401d 100644 --- a/mitiq/interface/mitiq_qiskit/tests/test_qiskit_utils.py +++ b/mitiq/interface/mitiq_qiskit/tests/test_qiskit_utils.py @@ -7,7 +7,7 @@ import numpy as np import pytest from qiskit import QuantumCircuit -from qiskit.providers.fake_provider import FakeLima +from qiskit_ibm_runtime.fake_provider import FakeLima from mitiq import MeasurementResult, Observable, PauliString from mitiq.interface.mitiq_qiskit.qiskit_utils import ( diff --git a/mitiq/tests/test_conversions.py b/mitiq/tests/test_conversions.py index 953b48a775..601773bcd9 100644 --- a/mitiq/tests/test_conversions.py +++ b/mitiq/tests/test_conversions.py @@ -17,6 +17,8 @@ from braket.circuits import Instruction from braket.circuits import gates as braket_gates from pyquil import Program, gates +from qiskit.qasm2 import dumps + from mitiq import SUPPORTED_PROGRAM_TYPES from mitiq.interface import ( @@ -44,7 +46,7 @@ qiskit_circuit = qiskit.QuantumCircuit(qiskit_qreg) qiskit_circuit.h(qiskit_qreg[0]) qiskit_circuit.cx(*qiskit_qreg) -qasm_str = qiskit_circuit.qasm() +qasm_str = dumps(qiskit_circuit) # pyQuil Bell circuit. diff --git a/mitiq/zne/tests/test_zne.py b/mitiq/zne/tests/test_zne.py index faae74c44c..13dc8a0844 100644 --- a/mitiq/zne/tests/test_zne.py +++ b/mitiq/zne/tests/test_zne.py @@ -525,7 +525,7 @@ def test_execute_with_zne_transpiled_qiskit_circuit(): """Tests ZNE when transpiling to a Qiskit device. Note transpiling can introduce idle (unused) qubits to the circuit. """ - from qiskit.providers.fake_provider import FakeSantiago + from qiskit_ibm_runtime.fake_provider import FakeSantiago santiago = FakeSantiago() backend = qiskit.providers.aer.AerSimulator.from_backend(santiago)