diff --git a/MANIFEST.in b/MANIFEST.in index af0a15740ff4..719d4fe5d9db 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -7,7 +7,7 @@ include qiskit/VERSION.txt recursive-include qiskit *.pyx recursive-include qiskit *.pxd include qiskit/visualization/styles/*.json -recursive-include qiskit/test/mock/backends *.json +recursive-include qiskit/providers/fake_provider/backends *.json # Include the tests files. recursive-include test *.py diff --git a/docs/apidocs/providers_fake_provider.rst b/docs/apidocs/providers_fake_provider.rst new file mode 100644 index 000000000000..25940ce0e722 --- /dev/null +++ b/docs/apidocs/providers_fake_provider.rst @@ -0,0 +1,6 @@ +.. _qiskit-providers-fakeprovider: + +.. automodule:: qiskit.providers.fake_provider + :no-members: + :no-inherited-members: + :no-special-members: diff --git a/docs/apidocs/terra.rst b/docs/apidocs/terra.rst index d3742300aced..5b765c7c95e7 100644 --- a/docs/apidocs/terra.rst +++ b/docs/apidocs/terra.rst @@ -18,6 +18,7 @@ Qiskit Terra API Reference extensions providers_basicaer providers + providers_fake_provider providers_models pulse scheduler diff --git a/qiskit/providers/fake_provider/__init__.py b/qiskit/providers/fake_provider/__init__.py index c30be21a08fe..680583677a60 100644 --- a/qiskit/providers/fake_provider/__init__.py +++ b/qiskit/providers/fake_provider/__init__.py @@ -11,32 +11,241 @@ # that they have been altered from the originals. """ -Utilities for mocking the IBMQ provider, including job responses and backends. +====================================================== +Fake Provider (:mod:`qiskit.providers.fake_provider`) +====================================================== -The module includes dummy provider, backends, and jobs. -The purpose of these classes is to fake backends for testing purposes: -testing local timeouts, arbitrary responses or behavior, etc. +.. currentmodule:: qiskit.providers.fake_provider + +Overview +======== + +The fake provider module contains fake providers and fake backends classes. The fake backends are +built to mimic the behaviors of IBM Quantum systems using system snapshots. The system snapshots +contain important information about the quantum system such as coupling map, basis gates, qubit +properties (T1, T2, error rate, etc.) which are useful for testing the transpiler and performing +noisy simulation of the system. + +Example Usage +============= + +Here is an example of using a fake backend for transpilation and simulation. + +.. jupyter-execute:: + + from qiskit import QuantumCircuit + from qiskit.providers.fake_provider import FakeManilaV2 + + # Get a fake backend from the fake provider + backend = FakeManilaV2() + + # Create a simple circuit + circuit = QuantumCircuit(3) + circuit.h(0) + circuit.cx(0,1) + circuit.cx(0,2) + circuit.measure_all() + circuit.draw() + +.. jupyter-execute:: + + from qiskit import transpile + + # Transpile the ideal circuit to a circuit that can be directly executed by the backend + transpiled_circuit = transpile(circuit, backend) + transpiled_circuit.draw() + +.. jupyter-execute:: + + from qiskit.tools.visualization import plot_histogram + + # Run the transpiled circuit using the simulated fake backend + job = backend.run(transpiled_circuit) + counts = job.result().get_counts() + plot_histogram(counts) + +.. important:: + + Please note that the simulation is done using a noise model generated from system snapshots + obtained in the past (sometimes a few years ago) and the results are not representative of the + latest behaviours of the real quantum system which the fake backend is mimicking. If you want to + run noisy simulations to compare with the real quantum system, please follow steps below to + generate a simulator mimics a real quantum system with the latest calibration results. + + .. code-block:: python + + from qiskit import IBMQ + from qiskit.providers.aer import AerSimulator + + # get a real backend from a real provider + provider = IBMQ.load_account() + backend = provider.get_backend('ibmq_manila') + + # generate a simulator that mimics the real quantum system with the latest calibration results + backend_sim = AerSimulator.from_backend(backend) + + +Fake Providers +============== + +Fake providers provide access to a list of fake backends. + +.. autosummary:: + :toctree: ../stubs/ + + FakeProviderForBackendV2 + FakeProvider + +Fake Backends +============= + +Fake V2 Backends +---------------- + +Fake V2 backends are fake backends with IBM Quantum systems snapshots implemented with +:mod:`~qiskit.providers.backend.BackendV2` interface. + +.. autosummary:: + :toctree: ../stubs/ + + FakeAlmadenV2 + FakeArmonkV2 + FakeAthensV2 + FakeBelemV2 + FakeBoeblingenV2 + FakeBogotaV2 + FakeBrooklynV2 + FakeBurlingtonV2 + FakeCairoV2 + FakeCambridgeV2 + FakeCasablancaV2 + FakeEssexV2 + FakeGuadalupeV2 + FakeHanoiV2 + FakeJakartaV2 + FakeJohannesburgV2 + FakeKolkataV2 + FakeLagosV2 + FakeLimaV2 + FakeLondonV2 + FakeManhattanV2 + FakeManilaV2 + FakeMelbourneV2 + FakeMontrealV2 + FakeMumbaiV2 + FakeNairobiV2 + FakeOurenseV2 + FakeParisV2 + FakePoughkeepsieV2 + FakeQuitoV2 + FakeRochesterV2 + FakeRomeV2 + .. FakeRueschlikonV2 # no v2 version + FakeSantiagoV2 + FakeSingaporeV2 + FakeSydneyV2 + .. FakeTenerifeV2 # no v2 version + .. FakeTokyoV2 # no v2 version + FakeTorontoV2 + FakeValenciaV2 + FakeVigoV2 + FakeWashingtonV2 + FakeYorktownV2 + +Fake V1 Backends +---------------- + +Fake V1 backends are fake backends with IBM Quantum systems snapshots implemented with +:mod:`~qiskit.providers.backend.BackendV1` interface. + +.. autosummary:: + :toctree: ../stubs/ + + FakeAlmaden + FakeArmonk + FakeAthens + FakeBelem + FakeBoeblingen + FakeBogota + FakeBrooklyn + FakeBurlington + FakeCairo + FakeCambridge + FakeCasablanca + FakeEssex + FakeGuadalupe + FakeHanoi + FakeJakarta + FakeJohannesburg + FakeKolkata + FakeLagos + FakeLima + FakeLondon + FakeManhattan + FakeManila + FakeMelbourne + FakeMontreal + FakeMumbai + FakeNairobi + FakeOurense + FakeParis + FakePoughkeepsie + FakeQuito + FakeRochester + FakeRome + FakeRueschlikon + FakeSantiago + FakeSingapore + FakeSydney + FakeTenerife + FakeTokyo + FakeToronto + FakeValencia + FakeVigo + FakeWashington + FakeYorktown + +Special Fake Backends +===================== + +Special fake backends are fake backends that were created for special testing purposes. + +.. autosummary:: + :toctree: ../stubs/ + + FakeQasmSimulator + FakeOpenPulse2Q + FakeOpenPulse3Q + Fake1Q + FakeBackendV2 + FakeBackend5QV2 + FakeMumbaiFractionalCX + ConfigurableFakeBackend -The mock devices are mainly for testing the compiler. """ -from qiskit.test.mock.fake_provider import ( - FakeProviderForBackendV2, - FakeProvider, -) -from qiskit.test.mock.fake_provider import FakeProviderFactory -from qiskit.test.mock.fake_backend import FakeBackend -from qiskit.test.mock.fake_pulse_backend import FakePulseBackend -from qiskit.test.mock.fake_qasm_backend import FakeQasmBackend -from qiskit.test.mock.utils.configurable_backend import ConfigurableFakeBackend -from qiskit.test.mock.fake_backend_v2 import FakeBackendV2, FakeBackend5QV2 -from qiskit.test.mock.fake_mumbai_v2 import FakeMumbaiFractionalCX -from qiskit.test.mock.fake_job import FakeJob -from qiskit.test.mock.fake_qobj import FakeQobj - -from qiskit.test.mock.backends import * - -from qiskit.test.mock.fake_qasm_simulator import FakeQasmSimulator -from qiskit.test.mock.fake_openpulse_2q import FakeOpenPulse2Q -from qiskit.test.mock.fake_openpulse_3q import FakeOpenPulse3Q -from qiskit.test.mock.fake_1q import Fake1Q +# Fake job and qobj classes +from .fake_job import FakeJob +from .fake_qobj import FakeQobj + +# Base classes for fake backends +from .fake_backend import FakeBackend +from .fake_qasm_backend import FakeQasmBackend +from .fake_pulse_backend import FakePulseBackend + +# Fake providers +from .fake_provider import FakeProviderFactory, FakeProviderForBackendV2, FakeProvider + +# Standard fake backends with IBM Quantum systems snapshots +from .backends import * + +# Special fake backends for special testing perpurposes +from .fake_qasm_simulator import FakeQasmSimulator +from .fake_openpulse_2q import FakeOpenPulse2Q +from .fake_openpulse_3q import FakeOpenPulse3Q +from .fake_1q import Fake1Q +from .fake_backend_v2 import FakeBackendV2, FakeBackend5QV2 +from .fake_mumbai_v2 import FakeMumbaiFractionalCX + +# Configurable fake backend +from .utils.configurable_backend import ConfigurableFakeBackend diff --git a/qiskit/providers/fake_provider/backends/__init__.py b/qiskit/providers/fake_provider/backends/__init__.py new file mode 100644 index 000000000000..2b85aac04439 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/__init__.py @@ -0,0 +1,104 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2019. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + + +""" +Mocked versions of real quantum backends. +""" + +# BackendV2 Backends +from .almaden import FakeAlmadenV2 +from .armonk import FakeArmonkV2 +from .athens import FakeAthensV2 +from .belem import FakeBelemV2 +from .boeblingen import FakeBoeblingenV2 +from .bogota import FakeBogotaV2 +from .brooklyn import FakeBrooklynV2 +from .burlington import FakeBurlingtonV2 +from .cairo import FakeCairoV2 +from .cambridge import FakeCambridgeV2 +from .casablanca import FakeCasablancaV2 +from .essex import FakeEssexV2 +from .guadalupe import FakeGuadalupeV2 +from .hanoi import FakeHanoiV2 +from .jakarta import FakeJakartaV2 +from .johannesburg import FakeJohannesburgV2 +from .kolkata import FakeKolkataV2 +from .lagos import FakeLagosV2 +from .lima import FakeLimaV2 +from .london import FakeLondonV2 +from .manhattan import FakeManhattanV2 +from .manila import FakeManilaV2 +from .melbourne import FakeMelbourneV2 +from .montreal import FakeMontrealV2 +from .mumbai import FakeMumbaiV2 +from .nairobi import FakeNairobiV2 +from .ourense import FakeOurenseV2 +from .paris import FakeParisV2 +from .poughkeepsie import FakePoughkeepsieV2 +from .quito import FakeQuitoV2 +from .rochester import FakeRochesterV2 +from .rome import FakeRomeV2 +from .santiago import FakeSantiagoV2 +from .singapore import FakeSingaporeV2 +from .sydney import FakeSydneyV2 +from .toronto import FakeTorontoV2 +from .valencia import FakeValenciaV2 +from .vigo import FakeVigoV2 +from .washington import FakeWashingtonV2 +from .yorktown import FakeYorktownV2 + +# BackendV1 Backends +from .almaden import FakeAlmaden +from .armonk import FakeArmonk +from .athens import FakeAthens +from .belem import FakeBelem +from .boeblingen import FakeBoeblingen +from .bogota import FakeBogota +from .brooklyn import FakeBrooklyn +from .burlington import FakeBurlington +from .cairo import FakeCairo +from .cambridge import FakeCambridge +from .cambridge import FakeCambridgeAlternativeBasis +from .casablanca import FakeCasablanca +from .essex import FakeEssex +from .guadalupe import FakeGuadalupe +from .hanoi import FakeHanoi +from .jakarta import FakeJakarta +from .johannesburg import FakeJohannesburg +from .kolkata import FakeKolkata +from .lagos import FakeLagos +from .lima import FakeLima +from .london import FakeLondon +from .manhattan import FakeManhattan +from .manila import FakeManila +from .melbourne import FakeMelbourne +from .montreal import FakeMontreal +from .mumbai import FakeMumbai +from .nairobi import FakeNairobi +from .ourense import FakeOurense +from .paris import FakeParis +from .poughkeepsie import FakePoughkeepsie +from .quito import FakeQuito +from .rochester import FakeRochester +from .rome import FakeRome +from .rueschlikon import FakeRueschlikon +from .santiago import FakeSantiago +from .singapore import FakeSingapore +from .sydney import FakeSydney +from .tenerife import FakeTenerife +from .tokyo import FakeTokyo +from .toronto import FakeToronto +from .valencia import FakeValencia +from .vigo import FakeVigo +from .washington import FakeWashington +from .yorktown import FakeYorktown diff --git a/qiskit/providers/fake_provider/backends/almaden/__init__.py b/qiskit/providers/fake_provider/backends/almaden/__init__.py new file mode 100644 index 000000000000..9f0e03a7b79e --- /dev/null +++ b/qiskit/providers/fake_provider/backends/almaden/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2019. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock almaden backend""" + +from .fake_almaden import FakeAlmadenV2 +from .fake_almaden import FakeAlmaden diff --git a/qiskit/test/mock/backends/almaden/conf_almaden.json b/qiskit/providers/fake_provider/backends/almaden/conf_almaden.json similarity index 100% rename from qiskit/test/mock/backends/almaden/conf_almaden.json rename to qiskit/providers/fake_provider/backends/almaden/conf_almaden.json diff --git a/qiskit/test/mock/backends/almaden/defs_almaden.json b/qiskit/providers/fake_provider/backends/almaden/defs_almaden.json similarity index 100% rename from qiskit/test/mock/backends/almaden/defs_almaden.json rename to qiskit/providers/fake_provider/backends/almaden/defs_almaden.json diff --git a/qiskit/test/mock/backends/almaden/fake_almaden.py b/qiskit/providers/fake_provider/backends/almaden/fake_almaden.py similarity index 63% rename from qiskit/test/mock/backends/almaden/fake_almaden.py rename to qiskit/providers/fake_provider/backends/almaden/fake_almaden.py index 28d6fafd8934..a0616dad42d8 100644 --- a/qiskit/test/mock/backends/almaden/fake_almaden.py +++ b/qiskit/providers/fake_provider/backends/almaden/fake_almaden.py @@ -15,19 +15,21 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeAlmadenV2(fake_backend.FakeBackendV2): """A fake Almaden V2 backend. - 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 - ↕ ↕ - 05 ↔ 06 ↔ 07 ↔ 08 ↔ 09 - ↕ ↕ ↕ - 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 - ↕ ↕ - 15 ↔ 16 ↔ 17 ↔ 18 ↔ 19 + .. code-block:: text + + 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 + ↕ ↕ + 05 ↔ 06 ↔ 07 ↔ 08 ↔ 09 + ↕ ↕ ↕ + 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 + ↕ ↕ + 15 ↔ 16 ↔ 17 ↔ 18 ↔ 19 """ dirname = os.path.dirname(__file__) @@ -40,13 +42,15 @@ class FakeAlmadenV2(fake_backend.FakeBackendV2): class FakeAlmaden(fake_pulse_backend.FakePulseBackend): """A fake Almaden backend. - 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 - ↕ ↕ - 05 ↔ 06 ↔ 07 ↔ 08 ↔ 09 - ↕ ↕ ↕ - 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 - ↕ ↕ - 15 ↔ 16 ↔ 17 ↔ 18 ↔ 19 + .. code-block:: text + + 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 + ↕ ↕ + 05 ↔ 06 ↔ 07 ↔ 08 ↔ 09 + ↕ ↕ ↕ + 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 + ↕ ↕ + 15 ↔ 16 ↔ 17 ↔ 18 ↔ 19 """ dirname = os.path.dirname(__file__) diff --git a/qiskit/test/mock/backends/almaden/props_almaden.json b/qiskit/providers/fake_provider/backends/almaden/props_almaden.json similarity index 100% rename from qiskit/test/mock/backends/almaden/props_almaden.json rename to qiskit/providers/fake_provider/backends/almaden/props_almaden.json diff --git a/qiskit/providers/fake_provider/backends/armonk/__init__.py b/qiskit/providers/fake_provider/backends/armonk/__init__.py new file mode 100644 index 000000000000..1a9453bcb450 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/armonk/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2020. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock armonk backend""" + +from .fake_armonk import FakeArmonkV2 +from .fake_armonk import FakeArmonk diff --git a/qiskit/test/mock/backends/armonk/conf_armonk.json b/qiskit/providers/fake_provider/backends/armonk/conf_armonk.json similarity index 100% rename from qiskit/test/mock/backends/armonk/conf_armonk.json rename to qiskit/providers/fake_provider/backends/armonk/conf_armonk.json diff --git a/qiskit/test/mock/backends/armonk/defs_armonk.json b/qiskit/providers/fake_provider/backends/armonk/defs_armonk.json similarity index 100% rename from qiskit/test/mock/backends/armonk/defs_armonk.json rename to qiskit/providers/fake_provider/backends/armonk/defs_armonk.json diff --git a/qiskit/test/mock/backends/armonk/fake_armonk.py b/qiskit/providers/fake_provider/backends/armonk/fake_armonk.py similarity index 88% rename from qiskit/test/mock/backends/armonk/fake_armonk.py rename to qiskit/providers/fake_provider/backends/armonk/fake_armonk.py index 43e605cfdf3b..68f9e9d445be 100644 --- a/qiskit/test/mock/backends/armonk/fake_armonk.py +++ b/qiskit/providers/fake_provider/backends/armonk/fake_armonk.py @@ -15,13 +15,15 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeArmonkV2(fake_backend.FakeBackendV2): """A fake 1 qubit backend. - 0 + .. code-block:: text + + 0 """ dirname = os.path.dirname(__file__) @@ -34,7 +36,9 @@ class FakeArmonkV2(fake_backend.FakeBackendV2): class FakeArmonk(fake_pulse_backend.FakePulseBackend): """A fake 1 qubit backend. - 0 + .. code-block:: text + + 0 """ dirname = os.path.dirname(__file__) diff --git a/qiskit/test/mock/backends/armonk/props_armonk.json b/qiskit/providers/fake_provider/backends/armonk/props_armonk.json similarity index 100% rename from qiskit/test/mock/backends/armonk/props_armonk.json rename to qiskit/providers/fake_provider/backends/armonk/props_armonk.json diff --git a/qiskit/providers/fake_provider/backends/athens/__init__.py b/qiskit/providers/fake_provider/backends/athens/__init__.py new file mode 100644 index 000000000000..3a7c0c18f718 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/athens/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2020. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock athens backend""" + +from .fake_athens import FakeAthensV2 +from .fake_athens import FakeAthens diff --git a/qiskit/test/mock/backends/athens/conf_athens.json b/qiskit/providers/fake_provider/backends/athens/conf_athens.json similarity index 100% rename from qiskit/test/mock/backends/athens/conf_athens.json rename to qiskit/providers/fake_provider/backends/athens/conf_athens.json diff --git a/qiskit/test/mock/backends/athens/defs_athens.json b/qiskit/providers/fake_provider/backends/athens/defs_athens.json similarity index 100% rename from qiskit/test/mock/backends/athens/defs_athens.json rename to qiskit/providers/fake_provider/backends/athens/defs_athens.json diff --git a/qiskit/test/mock/backends/athens/fake_athens.py b/qiskit/providers/fake_provider/backends/athens/fake_athens.py similarity index 93% rename from qiskit/test/mock/backends/athens/fake_athens.py rename to qiskit/providers/fake_provider/backends/athens/fake_athens.py index e10625c460d3..09c7edb2d1e3 100644 --- a/qiskit/test/mock/backends/athens/fake_athens.py +++ b/qiskit/providers/fake_provider/backends/athens/fake_athens.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeAthensV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/athens/props_athens.json b/qiskit/providers/fake_provider/backends/athens/props_athens.json similarity index 100% rename from qiskit/test/mock/backends/athens/props_athens.json rename to qiskit/providers/fake_provider/backends/athens/props_athens.json diff --git a/qiskit/providers/fake_provider/backends/belem/__init__.py b/qiskit/providers/fake_provider/backends/belem/__init__.py new file mode 100644 index 000000000000..d60733f78686 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/belem/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2021. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock belem backend""" + +from .fake_belem import FakeBelemV2 +from .fake_belem import FakeBelem diff --git a/qiskit/test/mock/backends/belem/conf_belem.json b/qiskit/providers/fake_provider/backends/belem/conf_belem.json similarity index 100% rename from qiskit/test/mock/backends/belem/conf_belem.json rename to qiskit/providers/fake_provider/backends/belem/conf_belem.json diff --git a/qiskit/test/mock/backends/belem/defs_belem.json b/qiskit/providers/fake_provider/backends/belem/defs_belem.json similarity index 100% rename from qiskit/test/mock/backends/belem/defs_belem.json rename to qiskit/providers/fake_provider/backends/belem/defs_belem.json diff --git a/qiskit/test/mock/backends/belem/fake_belem.py b/qiskit/providers/fake_provider/backends/belem/fake_belem.py similarity index 93% rename from qiskit/test/mock/backends/belem/fake_belem.py rename to qiskit/providers/fake_provider/backends/belem/fake_belem.py index 15f0ef878b2c..19ea06481d58 100644 --- a/qiskit/test/mock/backends/belem/fake_belem.py +++ b/qiskit/providers/fake_provider/backends/belem/fake_belem.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeBelemV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/belem/props_belem.json b/qiskit/providers/fake_provider/backends/belem/props_belem.json similarity index 100% rename from qiskit/test/mock/backends/belem/props_belem.json rename to qiskit/providers/fake_provider/backends/belem/props_belem.json diff --git a/qiskit/providers/fake_provider/backends/boeblingen/__init__.py b/qiskit/providers/fake_provider/backends/boeblingen/__init__.py new file mode 100644 index 000000000000..79d0e6d1feb7 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/boeblingen/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2019. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock boeblingen backend""" + +from .fake_boeblingen import FakeBoeblingenV2 +from .fake_boeblingen import FakeBoeblingen diff --git a/qiskit/test/mock/backends/boeblingen/conf_boeblingen.json b/qiskit/providers/fake_provider/backends/boeblingen/conf_boeblingen.json similarity index 100% rename from qiskit/test/mock/backends/boeblingen/conf_boeblingen.json rename to qiskit/providers/fake_provider/backends/boeblingen/conf_boeblingen.json diff --git a/qiskit/test/mock/backends/boeblingen/defs_boeblingen.json b/qiskit/providers/fake_provider/backends/boeblingen/defs_boeblingen.json similarity index 100% rename from qiskit/test/mock/backends/boeblingen/defs_boeblingen.json rename to qiskit/providers/fake_provider/backends/boeblingen/defs_boeblingen.json diff --git a/qiskit/test/mock/backends/boeblingen/fake_boeblingen.py b/qiskit/providers/fake_provider/backends/boeblingen/fake_boeblingen.py similarity index 64% rename from qiskit/test/mock/backends/boeblingen/fake_boeblingen.py rename to qiskit/providers/fake_provider/backends/boeblingen/fake_boeblingen.py index 939b70b626c9..b01c690b3071 100644 --- a/qiskit/test/mock/backends/boeblingen/fake_boeblingen.py +++ b/qiskit/providers/fake_provider/backends/boeblingen/fake_boeblingen.py @@ -15,19 +15,21 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeBoeblingenV2(fake_backend.FakeBackendV2): """A fake Boeblingen V2 backend. - 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 - ↕ ↕ - 05 ↔ 06 ↔ 07 ↔ 08 ↔ 09 - ↕ ↕ ↕ - 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 - ↕ ↕ - 15 ↔ 16 ↔ 17 ↔ 18 ↔ 19 + .. code-block:: text + + 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 + ↕ ↕ + 05 ↔ 06 ↔ 07 ↔ 08 ↔ 09 + ↕ ↕ ↕ + 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 + ↕ ↕ + 15 ↔ 16 ↔ 17 ↔ 18 ↔ 19 """ dirname = os.path.dirname(__file__) @@ -40,13 +42,15 @@ class FakeBoeblingenV2(fake_backend.FakeBackendV2): class FakeBoeblingen(fake_pulse_backend.FakePulseBackend): """A fake Boeblingen backend. - 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 - ↕ ↕ - 05 ↔ 06 ↔ 07 ↔ 08 ↔ 09 - ↕ ↕ ↕ - 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 - ↕ ↕ - 15 ↔ 16 ↔ 17 ↔ 18 ↔ 19 + .. code-block:: text + + 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 + ↕ ↕ + 05 ↔ 06 ↔ 07 ↔ 08 ↔ 09 + ↕ ↕ ↕ + 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 + ↕ ↕ + 15 ↔ 16 ↔ 17 ↔ 18 ↔ 19 """ dirname = os.path.dirname(__file__) diff --git a/qiskit/test/mock/backends/boeblingen/props_boeblingen.json b/qiskit/providers/fake_provider/backends/boeblingen/props_boeblingen.json similarity index 100% rename from qiskit/test/mock/backends/boeblingen/props_boeblingen.json rename to qiskit/providers/fake_provider/backends/boeblingen/props_boeblingen.json diff --git a/qiskit/providers/fake_provider/backends/bogota/__init__.py b/qiskit/providers/fake_provider/backends/bogota/__init__.py new file mode 100644 index 000000000000..eff8cf957c39 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/bogota/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2020. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock bogota backend""" + +from .fake_bogota import FakeBogotaV2 +from .fake_bogota import FakeBogota diff --git a/qiskit/test/mock/backends/bogota/conf_bogota.json b/qiskit/providers/fake_provider/backends/bogota/conf_bogota.json similarity index 100% rename from qiskit/test/mock/backends/bogota/conf_bogota.json rename to qiskit/providers/fake_provider/backends/bogota/conf_bogota.json diff --git a/qiskit/test/mock/backends/bogota/defs_bogota.json b/qiskit/providers/fake_provider/backends/bogota/defs_bogota.json similarity index 100% rename from qiskit/test/mock/backends/bogota/defs_bogota.json rename to qiskit/providers/fake_provider/backends/bogota/defs_bogota.json diff --git a/qiskit/test/mock/backends/bogota/fake_bogota.py b/qiskit/providers/fake_provider/backends/bogota/fake_bogota.py similarity index 93% rename from qiskit/test/mock/backends/bogota/fake_bogota.py rename to qiskit/providers/fake_provider/backends/bogota/fake_bogota.py index c91920b50775..d178c2dcbe7c 100644 --- a/qiskit/test/mock/backends/bogota/fake_bogota.py +++ b/qiskit/providers/fake_provider/backends/bogota/fake_bogota.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeBogotaV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/bogota/props_bogota.json b/qiskit/providers/fake_provider/backends/bogota/props_bogota.json similarity index 100% rename from qiskit/test/mock/backends/bogota/props_bogota.json rename to qiskit/providers/fake_provider/backends/bogota/props_bogota.json diff --git a/qiskit/providers/fake_provider/backends/brooklyn/__init__.py b/qiskit/providers/fake_provider/backends/brooklyn/__init__.py new file mode 100644 index 000000000000..cb0eadb49f42 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/brooklyn/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2020. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock brooklyn backend""" + +from .fake_brooklyn import FakeBrooklynV2 +from .fake_brooklyn import FakeBrooklyn diff --git a/qiskit/test/mock/backends/brooklyn/conf_brooklyn.json b/qiskit/providers/fake_provider/backends/brooklyn/conf_brooklyn.json similarity index 100% rename from qiskit/test/mock/backends/brooklyn/conf_brooklyn.json rename to qiskit/providers/fake_provider/backends/brooklyn/conf_brooklyn.json diff --git a/qiskit/test/mock/backends/brooklyn/defs_brooklyn.json b/qiskit/providers/fake_provider/backends/brooklyn/defs_brooklyn.json similarity index 100% rename from qiskit/test/mock/backends/brooklyn/defs_brooklyn.json rename to qiskit/providers/fake_provider/backends/brooklyn/defs_brooklyn.json diff --git a/qiskit/test/mock/backends/brooklyn/fake_brooklyn.py b/qiskit/providers/fake_provider/backends/brooklyn/fake_brooklyn.py similarity index 93% rename from qiskit/test/mock/backends/brooklyn/fake_brooklyn.py rename to qiskit/providers/fake_provider/backends/brooklyn/fake_brooklyn.py index 30f1587c3fbb..446b9bb922d9 100644 --- a/qiskit/test/mock/backends/brooklyn/fake_brooklyn.py +++ b/qiskit/providers/fake_provider/backends/brooklyn/fake_brooklyn.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeBrooklynV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/brooklyn/props_brooklyn.json b/qiskit/providers/fake_provider/backends/brooklyn/props_brooklyn.json similarity index 100% rename from qiskit/test/mock/backends/brooklyn/props_brooklyn.json rename to qiskit/providers/fake_provider/backends/brooklyn/props_brooklyn.json diff --git a/qiskit/providers/fake_provider/backends/burlington/__init__.py b/qiskit/providers/fake_provider/backends/burlington/__init__.py new file mode 100644 index 000000000000..b6d11e698499 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/burlington/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2019. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock burlington backend""" + +from .fake_burlington import FakeBurlingtonV2 +from .fake_burlington import FakeBurlington diff --git a/qiskit/test/mock/backends/burlington/conf_burlington.json b/qiskit/providers/fake_provider/backends/burlington/conf_burlington.json similarity index 100% rename from qiskit/test/mock/backends/burlington/conf_burlington.json rename to qiskit/providers/fake_provider/backends/burlington/conf_burlington.json diff --git a/qiskit/test/mock/backends/burlington/fake_burlington.py b/qiskit/providers/fake_provider/backends/burlington/fake_burlington.py similarity index 81% rename from qiskit/test/mock/backends/burlington/fake_burlington.py rename to qiskit/providers/fake_provider/backends/burlington/fake_burlington.py index b81d360a761d..f2b091eec16c 100644 --- a/qiskit/test/mock/backends/burlington/fake_burlington.py +++ b/qiskit/providers/fake_provider/backends/burlington/fake_burlington.py @@ -15,15 +15,17 @@ """ import os -from qiskit.test.mock import fake_qasm_backend, fake_backend +from qiskit.providers.fake_provider import fake_qasm_backend, fake_backend class FakeBurlingtonV2(fake_backend.FakeBackendV2): """A fake 5 qubit backend. - 0 ↔ 1 ↔ 3 ↔ 4 - ↕ - 2 + .. code-block:: text + + 0 ↔ 1 ↔ 3 ↔ 4 + ↕ + 2 """ dirname = os.path.dirname(__file__) @@ -35,9 +37,11 @@ class FakeBurlingtonV2(fake_backend.FakeBackendV2): class FakeBurlington(fake_qasm_backend.FakeQasmBackend): """A fake 5 qubit backend. - 0 ↔ 1 ↔ 3 ↔ 4 - ↕ - 2 + .. code-block:: text + + 0 ↔ 1 ↔ 3 ↔ 4 + ↕ + 2 """ dirname = os.path.dirname(__file__) diff --git a/qiskit/test/mock/backends/burlington/props_burlington.json b/qiskit/providers/fake_provider/backends/burlington/props_burlington.json similarity index 100% rename from qiskit/test/mock/backends/burlington/props_burlington.json rename to qiskit/providers/fake_provider/backends/burlington/props_burlington.json diff --git a/qiskit/providers/fake_provider/backends/cairo/__init__.py b/qiskit/providers/fake_provider/backends/cairo/__init__.py new file mode 100644 index 000000000000..a765383df106 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/cairo/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2021. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock cairo backend""" + +from .fake_cairo import FakeCairoV2 +from .fake_cairo import FakeCairo diff --git a/qiskit/test/mock/backends/cairo/conf_cairo.json b/qiskit/providers/fake_provider/backends/cairo/conf_cairo.json similarity index 100% rename from qiskit/test/mock/backends/cairo/conf_cairo.json rename to qiskit/providers/fake_provider/backends/cairo/conf_cairo.json diff --git a/qiskit/test/mock/backends/cairo/defs_cairo.json b/qiskit/providers/fake_provider/backends/cairo/defs_cairo.json similarity index 100% rename from qiskit/test/mock/backends/cairo/defs_cairo.json rename to qiskit/providers/fake_provider/backends/cairo/defs_cairo.json diff --git a/qiskit/test/mock/backends/cairo/fake_cairo.py b/qiskit/providers/fake_provider/backends/cairo/fake_cairo.py similarity index 93% rename from qiskit/test/mock/backends/cairo/fake_cairo.py rename to qiskit/providers/fake_provider/backends/cairo/fake_cairo.py index 5a72ec5591ea..0511fa17ed4f 100644 --- a/qiskit/test/mock/backends/cairo/fake_cairo.py +++ b/qiskit/providers/fake_provider/backends/cairo/fake_cairo.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeCairoV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/cairo/props_cairo.json b/qiskit/providers/fake_provider/backends/cairo/props_cairo.json similarity index 100% rename from qiskit/test/mock/backends/cairo/props_cairo.json rename to qiskit/providers/fake_provider/backends/cairo/props_cairo.json diff --git a/qiskit/providers/fake_provider/backends/cambridge/__init__.py b/qiskit/providers/fake_provider/backends/cambridge/__init__.py new file mode 100644 index 000000000000..b65dd250f1c9 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/cambridge/__init__.py @@ -0,0 +1,17 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2019. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock cambridge backend""" + +from .fake_cambridge import FakeCambridgeV2 +from .fake_cambridge import FakeCambridge +from .fake_cambridge import FakeCambridgeAlternativeBasis diff --git a/qiskit/test/mock/backends/cambridge/conf_cambridge.json b/qiskit/providers/fake_provider/backends/cambridge/conf_cambridge.json similarity index 100% rename from qiskit/test/mock/backends/cambridge/conf_cambridge.json rename to qiskit/providers/fake_provider/backends/cambridge/conf_cambridge.json diff --git a/qiskit/test/mock/backends/cambridge/fake_cambridge.py b/qiskit/providers/fake_provider/backends/cambridge/fake_cambridge.py similarity index 55% rename from qiskit/test/mock/backends/cambridge/fake_cambridge.py rename to qiskit/providers/fake_provider/backends/cambridge/fake_cambridge.py index 01a9cd288f69..46758406b468 100644 --- a/qiskit/test/mock/backends/cambridge/fake_cambridge.py +++ b/qiskit/providers/fake_provider/backends/cambridge/fake_cambridge.py @@ -15,21 +15,23 @@ """ import os -from qiskit.test.mock import fake_qasm_backend, fake_backend +from qiskit.providers.fake_provider import fake_qasm_backend, fake_backend class FakeCambridgeV2(fake_backend.FakeBackendV2): """A fake Cambridge backend. - 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 - ↕ ↕ - 05 06 - ↕ ↕ - 07 ↔ 08 ↔ 09 ↔ 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 ↔ 15 - ↕ ↕ ↕ - 16 17 18 - ↕ ↕ ↕ - 19 ↔ 20 ↔ 21 ↔ 22 ↔ 23 ↔ 24 ↔ 25 ↔ 26 ↔ 27 + .. code-block:: text + + 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 + ↕ ↕ + 05 06 + ↕ ↕ + 07 ↔ 08 ↔ 09 ↔ 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 ↔ 15 + ↕ ↕ ↕ + 16 17 18 + ↕ ↕ ↕ + 19 ↔ 20 ↔ 21 ↔ 22 ↔ 23 ↔ 24 ↔ 25 ↔ 26 ↔ 27 """ dirname = os.path.dirname(__file__) @@ -41,15 +43,17 @@ class FakeCambridgeV2(fake_backend.FakeBackendV2): class FakeCambridge(fake_qasm_backend.FakeQasmBackend): """A fake Cambridge backend. - 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 - ↕ ↕ - 05 06 - ↕ ↕ - 07 ↔ 08 ↔ 09 ↔ 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 ↔ 15 - ↕ ↕ ↕ - 16 17 18 - ↕ ↕ ↕ - 19 ↔ 20 ↔ 21 ↔ 22 ↔ 23 ↔ 24 ↔ 25 ↔ 26 ↔ 27 + .. code-block:: text + + 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 + ↕ ↕ + 05 06 + ↕ ↕ + 07 ↔ 08 ↔ 09 ↔ 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 ↔ 15 + ↕ ↕ ↕ + 16 17 18 + ↕ ↕ ↕ + 19 ↔ 20 ↔ 21 ↔ 22 ↔ 23 ↔ 24 ↔ 25 ↔ 26 ↔ 27 """ dirname = os.path.dirname(__file__) diff --git a/qiskit/test/mock/backends/cambridge/props_cambridge.json b/qiskit/providers/fake_provider/backends/cambridge/props_cambridge.json similarity index 100% rename from qiskit/test/mock/backends/cambridge/props_cambridge.json rename to qiskit/providers/fake_provider/backends/cambridge/props_cambridge.json diff --git a/qiskit/test/mock/backends/cambridge/props_cambridge_alt.json b/qiskit/providers/fake_provider/backends/cambridge/props_cambridge_alt.json similarity index 100% rename from qiskit/test/mock/backends/cambridge/props_cambridge_alt.json rename to qiskit/providers/fake_provider/backends/cambridge/props_cambridge_alt.json diff --git a/qiskit/providers/fake_provider/backends/casablanca/__init__.py b/qiskit/providers/fake_provider/backends/casablanca/__init__.py new file mode 100644 index 000000000000..acf7033490f4 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/casablanca/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2021. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock casablanca backend""" + +from .fake_casablanca import FakeCasablancaV2 +from .fake_casablanca import FakeCasablanca diff --git a/qiskit/test/mock/backends/casablanca/conf_casablanca.json b/qiskit/providers/fake_provider/backends/casablanca/conf_casablanca.json similarity index 100% rename from qiskit/test/mock/backends/casablanca/conf_casablanca.json rename to qiskit/providers/fake_provider/backends/casablanca/conf_casablanca.json diff --git a/qiskit/test/mock/backends/casablanca/defs_casablanca.json b/qiskit/providers/fake_provider/backends/casablanca/defs_casablanca.json similarity index 100% rename from qiskit/test/mock/backends/casablanca/defs_casablanca.json rename to qiskit/providers/fake_provider/backends/casablanca/defs_casablanca.json diff --git a/qiskit/test/mock/backends/casablanca/fake_casablanca.py b/qiskit/providers/fake_provider/backends/casablanca/fake_casablanca.py similarity index 93% rename from qiskit/test/mock/backends/casablanca/fake_casablanca.py rename to qiskit/providers/fake_provider/backends/casablanca/fake_casablanca.py index 423108f206cc..08b606663a32 100644 --- a/qiskit/test/mock/backends/casablanca/fake_casablanca.py +++ b/qiskit/providers/fake_provider/backends/casablanca/fake_casablanca.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeCasablancaV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/casablanca/props_casablanca.json b/qiskit/providers/fake_provider/backends/casablanca/props_casablanca.json similarity index 100% rename from qiskit/test/mock/backends/casablanca/props_casablanca.json rename to qiskit/providers/fake_provider/backends/casablanca/props_casablanca.json diff --git a/qiskit/providers/fake_provider/backends/essex/__init__.py b/qiskit/providers/fake_provider/backends/essex/__init__.py new file mode 100644 index 000000000000..ed23aa4b0359 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/essex/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2019. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock essex backend""" + +from .fake_essex import FakeEssexV2 +from .fake_essex import FakeEssex diff --git a/qiskit/test/mock/backends/essex/conf_essex.json b/qiskit/providers/fake_provider/backends/essex/conf_essex.json similarity index 100% rename from qiskit/test/mock/backends/essex/conf_essex.json rename to qiskit/providers/fake_provider/backends/essex/conf_essex.json diff --git a/qiskit/test/mock/backends/essex/fake_essex.py b/qiskit/providers/fake_provider/backends/essex/fake_essex.py similarity index 77% rename from qiskit/test/mock/backends/essex/fake_essex.py rename to qiskit/providers/fake_provider/backends/essex/fake_essex.py index ca62c1f7d9b7..6029a63393c2 100644 --- a/qiskit/test/mock/backends/essex/fake_essex.py +++ b/qiskit/providers/fake_provider/backends/essex/fake_essex.py @@ -15,17 +15,19 @@ """ import os -from qiskit.test.mock import fake_qasm_backend, fake_backend +from qiskit.providers.fake_provider import fake_qasm_backend, fake_backend class FakeEssexV2(fake_backend.FakeBackendV2): """A fake 5 qubit backend. - 0 ↔ 1 ↔ 2 - ↕ - 3 - ↕ - 4 + .. code-block:: text + + 0 ↔ 1 ↔ 2 + ↕ + 3 + ↕ + 4 """ dirname = os.path.dirname(__file__) @@ -37,11 +39,13 @@ class FakeEssexV2(fake_backend.FakeBackendV2): class FakeEssex(fake_qasm_backend.FakeQasmBackend): """A fake 5 qubit backend. - 0 ↔ 1 ↔ 2 - ↕ - 3 - ↕ - 4 + .. code-block:: text + + 0 ↔ 1 ↔ 2 + ↕ + 3 + ↕ + 4 """ dirname = os.path.dirname(__file__) diff --git a/qiskit/test/mock/backends/essex/props_essex.json b/qiskit/providers/fake_provider/backends/essex/props_essex.json similarity index 100% rename from qiskit/test/mock/backends/essex/props_essex.json rename to qiskit/providers/fake_provider/backends/essex/props_essex.json diff --git a/qiskit/providers/fake_provider/backends/guadalupe/__init__.py b/qiskit/providers/fake_provider/backends/guadalupe/__init__.py new file mode 100644 index 000000000000..e15013b69fab --- /dev/null +++ b/qiskit/providers/fake_provider/backends/guadalupe/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2021. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock guadalupe backend""" + +from .fake_guadalupe import FakeGuadalupeV2 +from .fake_guadalupe import FakeGuadalupe diff --git a/qiskit/test/mock/backends/guadalupe/conf_guadalupe.json b/qiskit/providers/fake_provider/backends/guadalupe/conf_guadalupe.json similarity index 100% rename from qiskit/test/mock/backends/guadalupe/conf_guadalupe.json rename to qiskit/providers/fake_provider/backends/guadalupe/conf_guadalupe.json diff --git a/qiskit/test/mock/backends/guadalupe/defs_guadalupe.json b/qiskit/providers/fake_provider/backends/guadalupe/defs_guadalupe.json similarity index 100% rename from qiskit/test/mock/backends/guadalupe/defs_guadalupe.json rename to qiskit/providers/fake_provider/backends/guadalupe/defs_guadalupe.json diff --git a/qiskit/test/mock/backends/guadalupe/fake_guadalupe.py b/qiskit/providers/fake_provider/backends/guadalupe/fake_guadalupe.py similarity index 93% rename from qiskit/test/mock/backends/guadalupe/fake_guadalupe.py rename to qiskit/providers/fake_provider/backends/guadalupe/fake_guadalupe.py index b44b8bbd9c71..80750f55c9f6 100644 --- a/qiskit/test/mock/backends/guadalupe/fake_guadalupe.py +++ b/qiskit/providers/fake_provider/backends/guadalupe/fake_guadalupe.py @@ -16,7 +16,7 @@ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeGuadalupeV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/guadalupe/props_guadalupe.json b/qiskit/providers/fake_provider/backends/guadalupe/props_guadalupe.json similarity index 100% rename from qiskit/test/mock/backends/guadalupe/props_guadalupe.json rename to qiskit/providers/fake_provider/backends/guadalupe/props_guadalupe.json diff --git a/qiskit/providers/fake_provider/backends/hanoi/__init__.py b/qiskit/providers/fake_provider/backends/hanoi/__init__.py new file mode 100644 index 000000000000..f51accab3679 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/hanoi/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2021. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock hanoi backend""" + +from .fake_hanoi import FakeHanoiV2 +from .fake_hanoi import FakeHanoi diff --git a/qiskit/test/mock/backends/hanoi/conf_hanoi.json b/qiskit/providers/fake_provider/backends/hanoi/conf_hanoi.json similarity index 100% rename from qiskit/test/mock/backends/hanoi/conf_hanoi.json rename to qiskit/providers/fake_provider/backends/hanoi/conf_hanoi.json diff --git a/qiskit/test/mock/backends/hanoi/defs_hanoi.json b/qiskit/providers/fake_provider/backends/hanoi/defs_hanoi.json similarity index 100% rename from qiskit/test/mock/backends/hanoi/defs_hanoi.json rename to qiskit/providers/fake_provider/backends/hanoi/defs_hanoi.json diff --git a/qiskit/test/mock/backends/hanoi/fake_hanoi.py b/qiskit/providers/fake_provider/backends/hanoi/fake_hanoi.py similarity index 93% rename from qiskit/test/mock/backends/hanoi/fake_hanoi.py rename to qiskit/providers/fake_provider/backends/hanoi/fake_hanoi.py index 67727cc5ce85..9e75b6f4c4b3 100644 --- a/qiskit/test/mock/backends/hanoi/fake_hanoi.py +++ b/qiskit/providers/fake_provider/backends/hanoi/fake_hanoi.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeHanoiV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/hanoi/props_hanoi.json b/qiskit/providers/fake_provider/backends/hanoi/props_hanoi.json similarity index 100% rename from qiskit/test/mock/backends/hanoi/props_hanoi.json rename to qiskit/providers/fake_provider/backends/hanoi/props_hanoi.json diff --git a/qiskit/providers/fake_provider/backends/jakarta/__init__.py b/qiskit/providers/fake_provider/backends/jakarta/__init__.py new file mode 100644 index 000000000000..df7db5e263ae --- /dev/null +++ b/qiskit/providers/fake_provider/backends/jakarta/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2021. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock jakarta backend""" + +from .fake_jakarta import FakeJakartaV2 +from .fake_jakarta import FakeJakarta diff --git a/qiskit/test/mock/backends/jakarta/conf_jakarta.json b/qiskit/providers/fake_provider/backends/jakarta/conf_jakarta.json similarity index 100% rename from qiskit/test/mock/backends/jakarta/conf_jakarta.json rename to qiskit/providers/fake_provider/backends/jakarta/conf_jakarta.json diff --git a/qiskit/test/mock/backends/jakarta/defs_jakarta.json b/qiskit/providers/fake_provider/backends/jakarta/defs_jakarta.json similarity index 100% rename from qiskit/test/mock/backends/jakarta/defs_jakarta.json rename to qiskit/providers/fake_provider/backends/jakarta/defs_jakarta.json diff --git a/qiskit/test/mock/backends/jakarta/fake_jakarta.py b/qiskit/providers/fake_provider/backends/jakarta/fake_jakarta.py similarity index 93% rename from qiskit/test/mock/backends/jakarta/fake_jakarta.py rename to qiskit/providers/fake_provider/backends/jakarta/fake_jakarta.py index 0cc699f709b4..92a4335a20e2 100644 --- a/qiskit/test/mock/backends/jakarta/fake_jakarta.py +++ b/qiskit/providers/fake_provider/backends/jakarta/fake_jakarta.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeJakartaV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/jakarta/props_jakarta.json b/qiskit/providers/fake_provider/backends/jakarta/props_jakarta.json similarity index 100% rename from qiskit/test/mock/backends/jakarta/props_jakarta.json rename to qiskit/providers/fake_provider/backends/jakarta/props_jakarta.json diff --git a/qiskit/providers/fake_provider/backends/johannesburg/__init__.py b/qiskit/providers/fake_provider/backends/johannesburg/__init__.py new file mode 100644 index 000000000000..5a7e95e60bd6 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/johannesburg/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2019. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock johannesburg backend""" + +from .fake_johannesburg import FakeJohannesburgV2 +from .fake_johannesburg import FakeJohannesburg diff --git a/qiskit/test/mock/backends/johannesburg/conf_johannesburg.json b/qiskit/providers/fake_provider/backends/johannesburg/conf_johannesburg.json similarity index 100% rename from qiskit/test/mock/backends/johannesburg/conf_johannesburg.json rename to qiskit/providers/fake_provider/backends/johannesburg/conf_johannesburg.json diff --git a/qiskit/test/mock/backends/johannesburg/defs_johannesburg.json b/qiskit/providers/fake_provider/backends/johannesburg/defs_johannesburg.json similarity index 100% rename from qiskit/test/mock/backends/johannesburg/defs_johannesburg.json rename to qiskit/providers/fake_provider/backends/johannesburg/defs_johannesburg.json diff --git a/qiskit/test/mock/backends/johannesburg/fake_johannesburg.py b/qiskit/providers/fake_provider/backends/johannesburg/fake_johannesburg.py similarity index 64% rename from qiskit/test/mock/backends/johannesburg/fake_johannesburg.py rename to qiskit/providers/fake_provider/backends/johannesburg/fake_johannesburg.py index 31e81cd96dfe..2e3411bf7dd9 100644 --- a/qiskit/test/mock/backends/johannesburg/fake_johannesburg.py +++ b/qiskit/providers/fake_provider/backends/johannesburg/fake_johannesburg.py @@ -15,19 +15,21 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeJohannesburgV2(fake_backend.FakeBackendV2): """A fake Johannesburg V2 backend. - 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 - ↕ ↕ - 05 ↔ 06 ↔ 07 ↔ 08 ↔ 09 - ↕ ↕ ↕ - 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 - ↕ ↕ - 15 ↔ 16 ↔ 17 ↔ 18 ↔ 19 + .. code-block:: text + + 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 + ↕ ↕ + 05 ↔ 06 ↔ 07 ↔ 08 ↔ 09 + ↕ ↕ ↕ + 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 + ↕ ↕ + 15 ↔ 16 ↔ 17 ↔ 18 ↔ 19 """ dirname = os.path.dirname(__file__) @@ -40,13 +42,15 @@ class FakeJohannesburgV2(fake_backend.FakeBackendV2): class FakeJohannesburg(fake_pulse_backend.FakePulseBackend): """A fake Johannesburg backend. - 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 - ↕ ↕ - 05 ↔ 06 ↔ 07 ↔ 08 ↔ 09 - ↕ ↕ ↕ - 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 - ↕ ↕ - 15 ↔ 16 ↔ 17 ↔ 18 ↔ 19 + .. code-block:: text + + 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 + ↕ ↕ + 05 ↔ 06 ↔ 07 ↔ 08 ↔ 09 + ↕ ↕ ↕ + 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 + ↕ ↕ + 15 ↔ 16 ↔ 17 ↔ 18 ↔ 19 """ dirname = os.path.dirname(__file__) diff --git a/qiskit/test/mock/backends/johannesburg/props_johannesburg.json b/qiskit/providers/fake_provider/backends/johannesburg/props_johannesburg.json similarity index 100% rename from qiskit/test/mock/backends/johannesburg/props_johannesburg.json rename to qiskit/providers/fake_provider/backends/johannesburg/props_johannesburg.json diff --git a/qiskit/providers/fake_provider/backends/kolkata/__init__.py b/qiskit/providers/fake_provider/backends/kolkata/__init__.py new file mode 100644 index 000000000000..03c5143c9502 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/kolkata/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2021. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock kolkata backend""" + +from .fake_kolkata import FakeKolkataV2 +from .fake_kolkata import FakeKolkata diff --git a/qiskit/test/mock/backends/kolkata/conf_kolkata.json b/qiskit/providers/fake_provider/backends/kolkata/conf_kolkata.json similarity index 100% rename from qiskit/test/mock/backends/kolkata/conf_kolkata.json rename to qiskit/providers/fake_provider/backends/kolkata/conf_kolkata.json diff --git a/qiskit/test/mock/backends/kolkata/defs_kolkata.json b/qiskit/providers/fake_provider/backends/kolkata/defs_kolkata.json similarity index 100% rename from qiskit/test/mock/backends/kolkata/defs_kolkata.json rename to qiskit/providers/fake_provider/backends/kolkata/defs_kolkata.json diff --git a/qiskit/test/mock/backends/kolkata/fake_kolkata.py b/qiskit/providers/fake_provider/backends/kolkata/fake_kolkata.py similarity index 93% rename from qiskit/test/mock/backends/kolkata/fake_kolkata.py rename to qiskit/providers/fake_provider/backends/kolkata/fake_kolkata.py index b37bf9351f77..95c9d04d4503 100644 --- a/qiskit/test/mock/backends/kolkata/fake_kolkata.py +++ b/qiskit/providers/fake_provider/backends/kolkata/fake_kolkata.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeKolkataV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/kolkata/props_kolkata.json b/qiskit/providers/fake_provider/backends/kolkata/props_kolkata.json similarity index 100% rename from qiskit/test/mock/backends/kolkata/props_kolkata.json rename to qiskit/providers/fake_provider/backends/kolkata/props_kolkata.json diff --git a/qiskit/providers/fake_provider/backends/lagos/__init__.py b/qiskit/providers/fake_provider/backends/lagos/__init__.py new file mode 100644 index 000000000000..387afc6a5fe7 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/lagos/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2021. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock lagos backend""" + +from .fake_lagos import FakeLagosV2 +from .fake_lagos import FakeLagos diff --git a/qiskit/test/mock/backends/lagos/conf_lagos.json b/qiskit/providers/fake_provider/backends/lagos/conf_lagos.json similarity index 100% rename from qiskit/test/mock/backends/lagos/conf_lagos.json rename to qiskit/providers/fake_provider/backends/lagos/conf_lagos.json diff --git a/qiskit/test/mock/backends/lagos/defs_lagos.json b/qiskit/providers/fake_provider/backends/lagos/defs_lagos.json similarity index 100% rename from qiskit/test/mock/backends/lagos/defs_lagos.json rename to qiskit/providers/fake_provider/backends/lagos/defs_lagos.json diff --git a/qiskit/test/mock/backends/lagos/fake_lagos.py b/qiskit/providers/fake_provider/backends/lagos/fake_lagos.py similarity index 93% rename from qiskit/test/mock/backends/lagos/fake_lagos.py rename to qiskit/providers/fake_provider/backends/lagos/fake_lagos.py index 4cdd2a3aab41..fd72b6a22168 100644 --- a/qiskit/test/mock/backends/lagos/fake_lagos.py +++ b/qiskit/providers/fake_provider/backends/lagos/fake_lagos.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeLagosV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/lagos/props_lagos.json b/qiskit/providers/fake_provider/backends/lagos/props_lagos.json similarity index 100% rename from qiskit/test/mock/backends/lagos/props_lagos.json rename to qiskit/providers/fake_provider/backends/lagos/props_lagos.json diff --git a/qiskit/providers/fake_provider/backends/lima/__init__.py b/qiskit/providers/fake_provider/backends/lima/__init__.py new file mode 100644 index 000000000000..ce24c99c763a --- /dev/null +++ b/qiskit/providers/fake_provider/backends/lima/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2021. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock lima backend""" + +from .fake_lima import FakeLimaV2 +from .fake_lima import FakeLima diff --git a/qiskit/test/mock/backends/lima/conf_lima.json b/qiskit/providers/fake_provider/backends/lima/conf_lima.json similarity index 100% rename from qiskit/test/mock/backends/lima/conf_lima.json rename to qiskit/providers/fake_provider/backends/lima/conf_lima.json diff --git a/qiskit/test/mock/backends/lima/defs_lima.json b/qiskit/providers/fake_provider/backends/lima/defs_lima.json similarity index 100% rename from qiskit/test/mock/backends/lima/defs_lima.json rename to qiskit/providers/fake_provider/backends/lima/defs_lima.json diff --git a/qiskit/test/mock/backends/lima/fake_lima.py b/qiskit/providers/fake_provider/backends/lima/fake_lima.py similarity index 93% rename from qiskit/test/mock/backends/lima/fake_lima.py rename to qiskit/providers/fake_provider/backends/lima/fake_lima.py index 8b7022ec97db..9860125734df 100644 --- a/qiskit/test/mock/backends/lima/fake_lima.py +++ b/qiskit/providers/fake_provider/backends/lima/fake_lima.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeLimaV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/lima/props_lima.json b/qiskit/providers/fake_provider/backends/lima/props_lima.json similarity index 100% rename from qiskit/test/mock/backends/lima/props_lima.json rename to qiskit/providers/fake_provider/backends/lima/props_lima.json diff --git a/qiskit/providers/fake_provider/backends/london/__init__.py b/qiskit/providers/fake_provider/backends/london/__init__.py new file mode 100644 index 000000000000..058905944966 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/london/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2019. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock london backend""" + +from .fake_london import FakeLondonV2 +from .fake_london import FakeLondon diff --git a/qiskit/test/mock/backends/london/conf_london.json b/qiskit/providers/fake_provider/backends/london/conf_london.json similarity index 100% rename from qiskit/test/mock/backends/london/conf_london.json rename to qiskit/providers/fake_provider/backends/london/conf_london.json diff --git a/qiskit/test/mock/backends/london/fake_london.py b/qiskit/providers/fake_provider/backends/london/fake_london.py similarity index 77% rename from qiskit/test/mock/backends/london/fake_london.py rename to qiskit/providers/fake_provider/backends/london/fake_london.py index 6eaf1b9b2e48..ad07196ff56f 100644 --- a/qiskit/test/mock/backends/london/fake_london.py +++ b/qiskit/providers/fake_provider/backends/london/fake_london.py @@ -15,17 +15,19 @@ """ import os -from qiskit.test.mock import fake_qasm_backend, fake_backend +from qiskit.providers.fake_provider import fake_qasm_backend, fake_backend class FakeLondonV2(fake_backend.FakeBackendV2): """A fake 5 qubit backend. - 0 ↔ 1 ↔ 2 - ↕ - 3 - ↕ - 4 + .. code-block:: text + + 0 ↔ 1 ↔ 2 + ↕ + 3 + ↕ + 4 """ dirname = os.path.dirname(__file__) @@ -37,11 +39,13 @@ class FakeLondonV2(fake_backend.FakeBackendV2): class FakeLondon(fake_qasm_backend.FakeQasmBackend): """A fake 5 qubit backend. - 0 ↔ 1 ↔ 2 - ↕ - 3 - ↕ - 4 + .. code-block:: text + + 0 ↔ 1 ↔ 2 + ↕ + 3 + ↕ + 4 """ dirname = os.path.dirname(__file__) diff --git a/qiskit/test/mock/backends/london/props_london.json b/qiskit/providers/fake_provider/backends/london/props_london.json similarity index 100% rename from qiskit/test/mock/backends/london/props_london.json rename to qiskit/providers/fake_provider/backends/london/props_london.json diff --git a/qiskit/providers/fake_provider/backends/manhattan/__init__.py b/qiskit/providers/fake_provider/backends/manhattan/__init__.py new file mode 100644 index 000000000000..3adf4fcbe625 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/manhattan/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2020. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock manhattan backend""" + +from .fake_manhattan import FakeManhattanV2 +from .fake_manhattan import FakeManhattan diff --git a/qiskit/test/mock/backends/manhattan/conf_manhattan.json b/qiskit/providers/fake_provider/backends/manhattan/conf_manhattan.json similarity index 100% rename from qiskit/test/mock/backends/manhattan/conf_manhattan.json rename to qiskit/providers/fake_provider/backends/manhattan/conf_manhattan.json diff --git a/qiskit/test/mock/backends/manhattan/defs_manhattan.json b/qiskit/providers/fake_provider/backends/manhattan/defs_manhattan.json similarity index 100% rename from qiskit/test/mock/backends/manhattan/defs_manhattan.json rename to qiskit/providers/fake_provider/backends/manhattan/defs_manhattan.json diff --git a/qiskit/test/mock/backends/manhattan/fake_manhattan.py b/qiskit/providers/fake_provider/backends/manhattan/fake_manhattan.py similarity index 93% rename from qiskit/test/mock/backends/manhattan/fake_manhattan.py rename to qiskit/providers/fake_provider/backends/manhattan/fake_manhattan.py index 4fcc4f2a79c7..13e39360ad17 100644 --- a/qiskit/test/mock/backends/manhattan/fake_manhattan.py +++ b/qiskit/providers/fake_provider/backends/manhattan/fake_manhattan.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeManhattanV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/manhattan/props_manhattan.json b/qiskit/providers/fake_provider/backends/manhattan/props_manhattan.json similarity index 100% rename from qiskit/test/mock/backends/manhattan/props_manhattan.json rename to qiskit/providers/fake_provider/backends/manhattan/props_manhattan.json diff --git a/qiskit/providers/fake_provider/backends/manila/__init__.py b/qiskit/providers/fake_provider/backends/manila/__init__.py new file mode 100644 index 000000000000..4ee7576ea3c4 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/manila/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2019. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock manila backend""" + +from .fake_manila import FakeManilaV2 +from .fake_manila import FakeManila diff --git a/qiskit/test/mock/backends/manila/conf_manila.json b/qiskit/providers/fake_provider/backends/manila/conf_manila.json similarity index 100% rename from qiskit/test/mock/backends/manila/conf_manila.json rename to qiskit/providers/fake_provider/backends/manila/conf_manila.json diff --git a/qiskit/test/mock/backends/manila/defs_manila.json b/qiskit/providers/fake_provider/backends/manila/defs_manila.json similarity index 100% rename from qiskit/test/mock/backends/manila/defs_manila.json rename to qiskit/providers/fake_provider/backends/manila/defs_manila.json diff --git a/qiskit/test/mock/backends/manila/fake_manila.py b/qiskit/providers/fake_provider/backends/manila/fake_manila.py similarity index 93% rename from qiskit/test/mock/backends/manila/fake_manila.py rename to qiskit/providers/fake_provider/backends/manila/fake_manila.py index d21167ba02da..6bcadc827ad9 100644 --- a/qiskit/test/mock/backends/manila/fake_manila.py +++ b/qiskit/providers/fake_provider/backends/manila/fake_manila.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeManilaV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/manila/props_manila.json b/qiskit/providers/fake_provider/backends/manila/props_manila.json similarity index 100% rename from qiskit/test/mock/backends/manila/props_manila.json rename to qiskit/providers/fake_provider/backends/manila/props_manila.json diff --git a/qiskit/providers/fake_provider/backends/melbourne/__init__.py b/qiskit/providers/fake_provider/backends/melbourne/__init__.py new file mode 100644 index 000000000000..05ecfdd82166 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/melbourne/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2019. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock melbourne backend""" + +from .fake_melbourne import FakeMelbourneV2 +from .fake_melbourne import FakeMelbourne diff --git a/qiskit/test/mock/backends/melbourne/conf_melbourne.json b/qiskit/providers/fake_provider/backends/melbourne/conf_melbourne.json similarity index 100% rename from qiskit/test/mock/backends/melbourne/conf_melbourne.json rename to qiskit/providers/fake_provider/backends/melbourne/conf_melbourne.json diff --git a/qiskit/test/mock/backends/melbourne/fake_melbourne.py b/qiskit/providers/fake_provider/backends/melbourne/fake_melbourne.py similarity index 87% rename from qiskit/test/mock/backends/melbourne/fake_melbourne.py rename to qiskit/providers/fake_provider/backends/melbourne/fake_melbourne.py index 4cd04674d0ec..a72a5ca66b17 100644 --- a/qiskit/test/mock/backends/melbourne/fake_melbourne.py +++ b/qiskit/providers/fake_provider/backends/melbourne/fake_melbourne.py @@ -18,8 +18,8 @@ import json from qiskit.providers.models import GateConfig, QasmBackendConfiguration, BackendProperties -from qiskit.test.mock.fake_backend import FakeBackend -from qiskit.test.mock import fake_backend +from qiskit.providers.fake_provider.fake_backend import FakeBackend +from qiskit.providers.fake_provider import fake_backend class FakeMelbourneV2(fake_backend.FakeBackendV2): @@ -36,9 +36,12 @@ class FakeMelbourne(FakeBackend): def __init__(self): """ - 0 ← 1 → 2 → 3 ← 4 ← 5 → 6 - ↑ ↑ ↑ ↓ ↓ ↓ - 13 → 12 ← 11 → 10 ← 9 → 8 ← 7 + + .. code-block:: text + + 0 ← 1 → 2 → 3 ← 4 ← 5 → 6 + ↑ ↑ ↑ ↓ ↓ ↓ + 13 → 12 ← 11 → 10 ← 9 → 8 ← 7 """ cmap = [ [1, 0], diff --git a/qiskit/test/mock/backends/melbourne/props_melbourne.json b/qiskit/providers/fake_provider/backends/melbourne/props_melbourne.json similarity index 100% rename from qiskit/test/mock/backends/melbourne/props_melbourne.json rename to qiskit/providers/fake_provider/backends/melbourne/props_melbourne.json diff --git a/qiskit/providers/fake_provider/backends/montreal/__init__.py b/qiskit/providers/fake_provider/backends/montreal/__init__.py new file mode 100644 index 000000000000..e4f42e6d5e00 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/montreal/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2020. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock montreal backend""" + +from .fake_montreal import FakeMontrealV2 +from .fake_montreal import FakeMontreal diff --git a/qiskit/test/mock/backends/montreal/conf_montreal.json b/qiskit/providers/fake_provider/backends/montreal/conf_montreal.json similarity index 100% rename from qiskit/test/mock/backends/montreal/conf_montreal.json rename to qiskit/providers/fake_provider/backends/montreal/conf_montreal.json diff --git a/qiskit/test/mock/backends/montreal/defs_montreal.json b/qiskit/providers/fake_provider/backends/montreal/defs_montreal.json similarity index 100% rename from qiskit/test/mock/backends/montreal/defs_montreal.json rename to qiskit/providers/fake_provider/backends/montreal/defs_montreal.json diff --git a/qiskit/test/mock/backends/montreal/fake_montreal.py b/qiskit/providers/fake_provider/backends/montreal/fake_montreal.py similarity index 93% rename from qiskit/test/mock/backends/montreal/fake_montreal.py rename to qiskit/providers/fake_provider/backends/montreal/fake_montreal.py index 552d7bc25367..3a86ac6f1ee4 100644 --- a/qiskit/test/mock/backends/montreal/fake_montreal.py +++ b/qiskit/providers/fake_provider/backends/montreal/fake_montreal.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeMontrealV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/montreal/props_montreal.json b/qiskit/providers/fake_provider/backends/montreal/props_montreal.json similarity index 100% rename from qiskit/test/mock/backends/montreal/props_montreal.json rename to qiskit/providers/fake_provider/backends/montreal/props_montreal.json diff --git a/qiskit/providers/fake_provider/backends/mumbai/__init__.py b/qiskit/providers/fake_provider/backends/mumbai/__init__.py new file mode 100644 index 000000000000..e6d7b6a17137 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/mumbai/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2021. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock mumbai backend""" + +from .fake_mumbai import FakeMumbaiV2 +from .fake_mumbai import FakeMumbai diff --git a/qiskit/test/mock/backends/mumbai/conf_mumbai.json b/qiskit/providers/fake_provider/backends/mumbai/conf_mumbai.json similarity index 100% rename from qiskit/test/mock/backends/mumbai/conf_mumbai.json rename to qiskit/providers/fake_provider/backends/mumbai/conf_mumbai.json diff --git a/qiskit/test/mock/backends/mumbai/defs_mumbai.json b/qiskit/providers/fake_provider/backends/mumbai/defs_mumbai.json similarity index 100% rename from qiskit/test/mock/backends/mumbai/defs_mumbai.json rename to qiskit/providers/fake_provider/backends/mumbai/defs_mumbai.json diff --git a/qiskit/test/mock/backends/mumbai/fake_mumbai.py b/qiskit/providers/fake_provider/backends/mumbai/fake_mumbai.py similarity index 93% rename from qiskit/test/mock/backends/mumbai/fake_mumbai.py rename to qiskit/providers/fake_provider/backends/mumbai/fake_mumbai.py index ee6de9fbc423..74cf90ba97b3 100644 --- a/qiskit/test/mock/backends/mumbai/fake_mumbai.py +++ b/qiskit/providers/fake_provider/backends/mumbai/fake_mumbai.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeMumbaiV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/mumbai/props_mumbai.json b/qiskit/providers/fake_provider/backends/mumbai/props_mumbai.json similarity index 100% rename from qiskit/test/mock/backends/mumbai/props_mumbai.json rename to qiskit/providers/fake_provider/backends/mumbai/props_mumbai.json diff --git a/qiskit/providers/fake_provider/backends/nairobi/__init__.py b/qiskit/providers/fake_provider/backends/nairobi/__init__.py new file mode 100644 index 000000000000..7c84cf255a72 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/nairobi/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2021. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock nairobi backend""" + +from .fake_nairobi import FakeNairobiV2 +from .fake_nairobi import FakeNairobi diff --git a/qiskit/test/mock/backends/nairobi/conf_nairobi.json b/qiskit/providers/fake_provider/backends/nairobi/conf_nairobi.json similarity index 100% rename from qiskit/test/mock/backends/nairobi/conf_nairobi.json rename to qiskit/providers/fake_provider/backends/nairobi/conf_nairobi.json diff --git a/qiskit/test/mock/backends/nairobi/defs_nairobi.json b/qiskit/providers/fake_provider/backends/nairobi/defs_nairobi.json similarity index 100% rename from qiskit/test/mock/backends/nairobi/defs_nairobi.json rename to qiskit/providers/fake_provider/backends/nairobi/defs_nairobi.json diff --git a/qiskit/test/mock/backends/nairobi/fake_nairobi.py b/qiskit/providers/fake_provider/backends/nairobi/fake_nairobi.py similarity index 93% rename from qiskit/test/mock/backends/nairobi/fake_nairobi.py rename to qiskit/providers/fake_provider/backends/nairobi/fake_nairobi.py index 7db8d0a8d7d9..c4dcd0954659 100644 --- a/qiskit/test/mock/backends/nairobi/fake_nairobi.py +++ b/qiskit/providers/fake_provider/backends/nairobi/fake_nairobi.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeNairobiV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/nairobi/props_nairobi.json b/qiskit/providers/fake_provider/backends/nairobi/props_nairobi.json similarity index 100% rename from qiskit/test/mock/backends/nairobi/props_nairobi.json rename to qiskit/providers/fake_provider/backends/nairobi/props_nairobi.json diff --git a/qiskit/providers/fake_provider/backends/ourense/__init__.py b/qiskit/providers/fake_provider/backends/ourense/__init__.py new file mode 100644 index 000000000000..eb3374d09caa --- /dev/null +++ b/qiskit/providers/fake_provider/backends/ourense/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2019. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock ourense backend""" + +from .fake_ourense import FakeOurenseV2 +from .fake_ourense import FakeOurense diff --git a/qiskit/test/mock/backends/ourense/conf_ourense.json b/qiskit/providers/fake_provider/backends/ourense/conf_ourense.json similarity index 100% rename from qiskit/test/mock/backends/ourense/conf_ourense.json rename to qiskit/providers/fake_provider/backends/ourense/conf_ourense.json diff --git a/qiskit/test/mock/backends/ourense/fake_ourense.py b/qiskit/providers/fake_provider/backends/ourense/fake_ourense.py similarity index 80% rename from qiskit/test/mock/backends/ourense/fake_ourense.py rename to qiskit/providers/fake_provider/backends/ourense/fake_ourense.py index 7282d2fcaabe..6e4fa15ba165 100644 --- a/qiskit/test/mock/backends/ourense/fake_ourense.py +++ b/qiskit/providers/fake_provider/backends/ourense/fake_ourense.py @@ -15,15 +15,17 @@ """ import os -from qiskit.test.mock import fake_qasm_backend, fake_backend +from qiskit.providers.fake_provider import fake_qasm_backend, fake_backend class FakeOurenseV2(fake_backend.FakeBackendV2): """A fake 5 qubit backend. - 0 ↔ 1 ↔ 3 ↔ 4 - ↕ - 2 + .. code-block:: text + + 0 ↔ 1 ↔ 3 ↔ 4 + ↕ + 2 """ dirname = os.path.dirname(__file__) @@ -35,9 +37,11 @@ class FakeOurenseV2(fake_backend.FakeBackendV2): class FakeOurense(fake_qasm_backend.FakeQasmBackend): """A fake 5 qubit backend. - 0 ↔ 1 ↔ 3 ↔ 4 - ↕ - 2 + .. code-block:: text + + 0 ↔ 1 ↔ 3 ↔ 4 + ↕ + 2 """ dirname = os.path.dirname(__file__) diff --git a/qiskit/test/mock/backends/ourense/props_ourense.json b/qiskit/providers/fake_provider/backends/ourense/props_ourense.json similarity index 100% rename from qiskit/test/mock/backends/ourense/props_ourense.json rename to qiskit/providers/fake_provider/backends/ourense/props_ourense.json diff --git a/qiskit/providers/fake_provider/backends/paris/__init__.py b/qiskit/providers/fake_provider/backends/paris/__init__.py new file mode 100644 index 000000000000..ec0d15fde1cb --- /dev/null +++ b/qiskit/providers/fake_provider/backends/paris/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2019. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock paris backend""" + +from .fake_paris import FakeParisV2 +from .fake_paris import FakeParis diff --git a/qiskit/test/mock/backends/paris/conf_paris.json b/qiskit/providers/fake_provider/backends/paris/conf_paris.json similarity index 100% rename from qiskit/test/mock/backends/paris/conf_paris.json rename to qiskit/providers/fake_provider/backends/paris/conf_paris.json diff --git a/qiskit/test/mock/backends/paris/defs_paris.json b/qiskit/providers/fake_provider/backends/paris/defs_paris.json similarity index 100% rename from qiskit/test/mock/backends/paris/defs_paris.json rename to qiskit/providers/fake_provider/backends/paris/defs_paris.json diff --git a/qiskit/providers/fake_provider/backends/paris/fake_paris.py b/qiskit/providers/fake_provider/backends/paris/fake_paris.py new file mode 100644 index 000000000000..3df1a4efbdce --- /dev/null +++ b/qiskit/providers/fake_provider/backends/paris/fake_paris.py @@ -0,0 +1,64 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2019. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +""" +Fake Paris device (20 qubit). +""" + +import os +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend + + +class FakeParisV2(fake_backend.FakeBackendV2): + """A fake Paris backend. + + .. code-block:: text + + 06 17 + ↕ ↕ + 00 ↔ 01 ↔ 04 ↔ 07 ↔ 10 ↔ 12 ↔ 15 ↔ 18 ↔ 20 ↔ 23 + ↕ ↕ ↕ + 02 13 24 + ↕ ↕ ↕ + 03 ↔ 05 ↔ 08 ↔ 11 ↔ 14 ↔ 16 ↔ 19 ↔ 22 ↔ 25 ↔ 26 + ↕ ↕ + 09 20 + """ + + dirname = os.path.dirname(__file__) + conf_filename = "conf_paris.json" + props_filename = "props_paris.json" + defs_filename = "defs_paris.json" + backend_name = "fake_paris_v2" + + +class FakeParis(fake_pulse_backend.FakePulseBackend): + """A fake Paris backend. + + .. code-block:: text + + 06 17 + ↕ ↕ + 00 ↔ 01 ↔ 04 ↔ 07 ↔ 10 ↔ 12 ↔ 15 ↔ 18 ↔ 20 ↔ 23 + ↕ ↕ ↕ + 02 13 24 + ↕ ↕ ↕ + 03 ↔ 05 ↔ 08 ↔ 11 ↔ 14 ↔ 16 ↔ 19 ↔ 22 ↔ 25 ↔ 26 + ↕ ↕ + 09 20 + """ + + dirname = os.path.dirname(__file__) + conf_filename = "conf_paris.json" + props_filename = "props_paris.json" + defs_filename = "defs_paris.json" + backend_name = "fake_paris" diff --git a/qiskit/test/mock/backends/paris/props_paris.json b/qiskit/providers/fake_provider/backends/paris/props_paris.json similarity index 100% rename from qiskit/test/mock/backends/paris/props_paris.json rename to qiskit/providers/fake_provider/backends/paris/props_paris.json diff --git a/qiskit/providers/fake_provider/backends/poughkeepsie/__init__.py b/qiskit/providers/fake_provider/backends/poughkeepsie/__init__.py new file mode 100644 index 000000000000..0bf5af896972 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/poughkeepsie/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2019. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock poughkeepsie backend""" + +from .fake_poughkeepsie import FakePoughkeepsieV2 +from .fake_poughkeepsie import FakePoughkeepsie diff --git a/qiskit/test/mock/backends/poughkeepsie/conf_poughkeepsie.json b/qiskit/providers/fake_provider/backends/poughkeepsie/conf_poughkeepsie.json similarity index 100% rename from qiskit/test/mock/backends/poughkeepsie/conf_poughkeepsie.json rename to qiskit/providers/fake_provider/backends/poughkeepsie/conf_poughkeepsie.json diff --git a/qiskit/test/mock/backends/poughkeepsie/defs_poughkeepsie.json b/qiskit/providers/fake_provider/backends/poughkeepsie/defs_poughkeepsie.json similarity index 100% rename from qiskit/test/mock/backends/poughkeepsie/defs_poughkeepsie.json rename to qiskit/providers/fake_provider/backends/poughkeepsie/defs_poughkeepsie.json diff --git a/qiskit/test/mock/backends/poughkeepsie/fake_poughkeepsie.py b/qiskit/providers/fake_provider/backends/poughkeepsie/fake_poughkeepsie.py similarity index 86% rename from qiskit/test/mock/backends/poughkeepsie/fake_poughkeepsie.py rename to qiskit/providers/fake_provider/backends/poughkeepsie/fake_poughkeepsie.py index fa3ac0aae016..528042c75b29 100644 --- a/qiskit/test/mock/backends/poughkeepsie/fake_poughkeepsie.py +++ b/qiskit/providers/fake_provider/backends/poughkeepsie/fake_poughkeepsie.py @@ -18,8 +18,8 @@ import json from qiskit.providers.models import GateConfig, QasmBackendConfiguration, BackendProperties -from qiskit.test.mock.fake_backend import FakeBackend -from qiskit.test.mock import fake_backend +from qiskit.providers.fake_provider.fake_backend import FakeBackend +from qiskit.providers.fake_provider import fake_backend class FakePoughkeepsieV2(fake_backend.FakeBackendV2): @@ -37,13 +37,16 @@ class FakePoughkeepsie(FakeBackend): def __init__(self): """ - 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 - ↕ ↕ - 05 ↔ 06 ↔ 07 ↔ 08 ↔ 09 - ↕ ↕ ↕ - 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 - ↕ ↕ - 15 ↔ 16 ↔ 17 ↔ 18 ↔ 19 + + .. code-block:: text + + 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 + ↕ ↕ + 05 ↔ 06 ↔ 07 ↔ 08 ↔ 09 + ↕ ↕ ↕ + 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 + ↕ ↕ + 15 ↔ 16 ↔ 17 ↔ 18 ↔ 19 """ cmap = [ [0, 1], diff --git a/qiskit/test/mock/backends/poughkeepsie/props_poughkeepsie.json b/qiskit/providers/fake_provider/backends/poughkeepsie/props_poughkeepsie.json similarity index 100% rename from qiskit/test/mock/backends/poughkeepsie/props_poughkeepsie.json rename to qiskit/providers/fake_provider/backends/poughkeepsie/props_poughkeepsie.json diff --git a/qiskit/providers/fake_provider/backends/quito/__init__.py b/qiskit/providers/fake_provider/backends/quito/__init__.py new file mode 100644 index 000000000000..e6ac098d4213 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/quito/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2021. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock quito backend""" + +from .fake_quito import FakeQuitoV2 +from .fake_quito import FakeQuito diff --git a/qiskit/test/mock/backends/quito/conf_quito.json b/qiskit/providers/fake_provider/backends/quito/conf_quito.json similarity index 100% rename from qiskit/test/mock/backends/quito/conf_quito.json rename to qiskit/providers/fake_provider/backends/quito/conf_quito.json diff --git a/qiskit/test/mock/backends/quito/defs_quito.json b/qiskit/providers/fake_provider/backends/quito/defs_quito.json similarity index 100% rename from qiskit/test/mock/backends/quito/defs_quito.json rename to qiskit/providers/fake_provider/backends/quito/defs_quito.json diff --git a/qiskit/test/mock/backends/quito/fake_quito.py b/qiskit/providers/fake_provider/backends/quito/fake_quito.py similarity index 93% rename from qiskit/test/mock/backends/quito/fake_quito.py rename to qiskit/providers/fake_provider/backends/quito/fake_quito.py index 376b824c305b..3eb73ea10396 100644 --- a/qiskit/test/mock/backends/quito/fake_quito.py +++ b/qiskit/providers/fake_provider/backends/quito/fake_quito.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeQuitoV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/quito/props_quito.json b/qiskit/providers/fake_provider/backends/quito/props_quito.json similarity index 100% rename from qiskit/test/mock/backends/quito/props_quito.json rename to qiskit/providers/fake_provider/backends/quito/props_quito.json diff --git a/qiskit/providers/fake_provider/backends/rochester/__init__.py b/qiskit/providers/fake_provider/backends/rochester/__init__.py new file mode 100644 index 000000000000..3ccc911f354d --- /dev/null +++ b/qiskit/providers/fake_provider/backends/rochester/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2019. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock rochester backend""" + +from .fake_rochester import FakeRochesterV2 +from .fake_rochester import FakeRochester diff --git a/qiskit/test/mock/backends/rochester/conf_rochester.json b/qiskit/providers/fake_provider/backends/rochester/conf_rochester.json similarity index 100% rename from qiskit/test/mock/backends/rochester/conf_rochester.json rename to qiskit/providers/fake_provider/backends/rochester/conf_rochester.json diff --git a/qiskit/test/mock/backends/rochester/fake_rochester.py b/qiskit/providers/fake_provider/backends/rochester/fake_rochester.py similarity index 93% rename from qiskit/test/mock/backends/rochester/fake_rochester.py rename to qiskit/providers/fake_provider/backends/rochester/fake_rochester.py index 62e177e3c703..4a9b31901166 100644 --- a/qiskit/test/mock/backends/rochester/fake_rochester.py +++ b/qiskit/providers/fake_provider/backends/rochester/fake_rochester.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_qasm_backend, fake_backend +from qiskit.providers.fake_provider import fake_qasm_backend, fake_backend class FakeRochesterV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/rochester/props_rochester.json b/qiskit/providers/fake_provider/backends/rochester/props_rochester.json similarity index 100% rename from qiskit/test/mock/backends/rochester/props_rochester.json rename to qiskit/providers/fake_provider/backends/rochester/props_rochester.json diff --git a/qiskit/providers/fake_provider/backends/rome/__init__.py b/qiskit/providers/fake_provider/backends/rome/__init__.py new file mode 100644 index 000000000000..727b53e9044b --- /dev/null +++ b/qiskit/providers/fake_provider/backends/rome/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2020. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock rome backend""" + +from .fake_rome import FakeRomeV2 +from .fake_rome import FakeRome diff --git a/qiskit/test/mock/backends/rome/conf_rome.json b/qiskit/providers/fake_provider/backends/rome/conf_rome.json similarity index 100% rename from qiskit/test/mock/backends/rome/conf_rome.json rename to qiskit/providers/fake_provider/backends/rome/conf_rome.json diff --git a/qiskit/test/mock/backends/rome/defs_rome.json b/qiskit/providers/fake_provider/backends/rome/defs_rome.json similarity index 100% rename from qiskit/test/mock/backends/rome/defs_rome.json rename to qiskit/providers/fake_provider/backends/rome/defs_rome.json diff --git a/qiskit/test/mock/backends/rome/fake_rome.py b/qiskit/providers/fake_provider/backends/rome/fake_rome.py similarity index 93% rename from qiskit/test/mock/backends/rome/fake_rome.py rename to qiskit/providers/fake_provider/backends/rome/fake_rome.py index cccf15190ece..51b180422eb5 100644 --- a/qiskit/test/mock/backends/rome/fake_rome.py +++ b/qiskit/providers/fake_provider/backends/rome/fake_rome.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeRomeV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/rome/props_rome.json b/qiskit/providers/fake_provider/backends/rome/props_rome.json similarity index 100% rename from qiskit/test/mock/backends/rome/props_rome.json rename to qiskit/providers/fake_provider/backends/rome/props_rome.json diff --git a/qiskit/providers/fake_provider/backends/rueschlikon/__init__.py b/qiskit/providers/fake_provider/backends/rueschlikon/__init__.py new file mode 100644 index 000000000000..861b5a751101 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/rueschlikon/__init__.py @@ -0,0 +1,15 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2019. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock rueschlikon backend""" + +from .fake_rueschlikon import FakeRueschlikon diff --git a/qiskit/test/mock/backends/rueschlikon/fake_rueschlikon.py b/qiskit/providers/fake_provider/backends/rueschlikon/fake_rueschlikon.py similarity index 86% rename from qiskit/test/mock/backends/rueschlikon/fake_rueschlikon.py rename to qiskit/providers/fake_provider/backends/rueschlikon/fake_rueschlikon.py index 914850ce710a..e26b0bbf5c7b 100644 --- a/qiskit/test/mock/backends/rueschlikon/fake_rueschlikon.py +++ b/qiskit/providers/fake_provider/backends/rueschlikon/fake_rueschlikon.py @@ -15,7 +15,7 @@ """ from qiskit.providers.models import GateConfig, QasmBackendConfiguration -from qiskit.test.mock.fake_backend import FakeBackend +from qiskit.providers.fake_provider.fake_backend import FakeBackend class FakeRueschlikon(FakeBackend): @@ -23,9 +23,12 @@ class FakeRueschlikon(FakeBackend): def __init__(self): """ - 1 → 2 → 3 → 4 ← 5 ← 6 → 7 ← 8 - ↓ ↑ ↓ ↓ ↑ ↓ ↓ ↑ - 0 ← 15 → 14 ← 13 ← 12 → 11 → 10 ← 9 + + .. code-block:: text + + 1 → 2 → 3 → 4 ← 5 ← 6 → 7 ← 8 + ↓ ↑ ↓ ↓ ↑ ↓ ↓ ↑ + 0 ← 15 → 14 ← 13 ← 12 → 11 → 10 ← 9 """ cmap = [ [1, 0], diff --git a/qiskit/providers/fake_provider/backends/santiago/__init__.py b/qiskit/providers/fake_provider/backends/santiago/__init__.py new file mode 100644 index 000000000000..24af2ecbe902 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/santiago/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2020. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock santiago backend""" + +from .fake_santiago import FakeSantiagoV2 +from .fake_santiago import FakeSantiago diff --git a/qiskit/test/mock/backends/santiago/conf_santiago.json b/qiskit/providers/fake_provider/backends/santiago/conf_santiago.json similarity index 100% rename from qiskit/test/mock/backends/santiago/conf_santiago.json rename to qiskit/providers/fake_provider/backends/santiago/conf_santiago.json diff --git a/qiskit/test/mock/backends/santiago/defs_santiago.json b/qiskit/providers/fake_provider/backends/santiago/defs_santiago.json similarity index 100% rename from qiskit/test/mock/backends/santiago/defs_santiago.json rename to qiskit/providers/fake_provider/backends/santiago/defs_santiago.json diff --git a/qiskit/test/mock/backends/santiago/fake_santiago.py b/qiskit/providers/fake_provider/backends/santiago/fake_santiago.py similarity index 93% rename from qiskit/test/mock/backends/santiago/fake_santiago.py rename to qiskit/providers/fake_provider/backends/santiago/fake_santiago.py index 9a19f1b3134d..3e9be068c298 100644 --- a/qiskit/test/mock/backends/santiago/fake_santiago.py +++ b/qiskit/providers/fake_provider/backends/santiago/fake_santiago.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeSantiagoV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/santiago/props_santiago.json b/qiskit/providers/fake_provider/backends/santiago/props_santiago.json similarity index 100% rename from qiskit/test/mock/backends/santiago/props_santiago.json rename to qiskit/providers/fake_provider/backends/santiago/props_santiago.json diff --git a/qiskit/providers/fake_provider/backends/singapore/__init__.py b/qiskit/providers/fake_provider/backends/singapore/__init__.py new file mode 100644 index 000000000000..ece759b10992 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/singapore/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2019. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock singapore backend""" + +from .fake_singapore import FakeSingaporeV2 +from .fake_singapore import FakeSingapore diff --git a/qiskit/test/mock/backends/singapore/conf_singapore.json b/qiskit/providers/fake_provider/backends/singapore/conf_singapore.json similarity index 100% rename from qiskit/test/mock/backends/singapore/conf_singapore.json rename to qiskit/providers/fake_provider/backends/singapore/conf_singapore.json diff --git a/qiskit/test/mock/backends/singapore/defs_singapore.json b/qiskit/providers/fake_provider/backends/singapore/defs_singapore.json similarity index 100% rename from qiskit/test/mock/backends/singapore/defs_singapore.json rename to qiskit/providers/fake_provider/backends/singapore/defs_singapore.json diff --git a/qiskit/test/mock/backends/singapore/fake_singapore.py b/qiskit/providers/fake_provider/backends/singapore/fake_singapore.py similarity index 64% rename from qiskit/test/mock/backends/singapore/fake_singapore.py rename to qiskit/providers/fake_provider/backends/singapore/fake_singapore.py index ae6dcb029ba7..1fe5e6925973 100644 --- a/qiskit/test/mock/backends/singapore/fake_singapore.py +++ b/qiskit/providers/fake_provider/backends/singapore/fake_singapore.py @@ -15,19 +15,21 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeSingaporeV2(fake_backend.FakeBackendV2): """A fake Singapore backend. - 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 - ↕ ↕ - 05 ↔ 06 ↔ 07 ↔ 08 ↔ 09 - ↕ ↕ ↕ - 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 - ↕ ↕ - 15 ↔ 16 ↔ 17 ↔ 18 ↔ 19 + .. code-block:: text + + 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 + ↕ ↕ + 05 ↔ 06 ↔ 07 ↔ 08 ↔ 09 + ↕ ↕ ↕ + 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 + ↕ ↕ + 15 ↔ 16 ↔ 17 ↔ 18 ↔ 19 """ dirname = os.path.dirname(__file__) @@ -40,13 +42,15 @@ class FakeSingaporeV2(fake_backend.FakeBackendV2): class FakeSingapore(fake_pulse_backend.FakePulseBackend): """A fake Singapore backend. - 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 - ↕ ↕ - 05 ↔ 06 ↔ 07 ↔ 08 ↔ 09 - ↕ ↕ ↕ - 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 - ↕ ↕ - 15 ↔ 16 ↔ 17 ↔ 18 ↔ 19 + .. code-block:: text + + 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 + ↕ ↕ + 05 ↔ 06 ↔ 07 ↔ 08 ↔ 09 + ↕ ↕ ↕ + 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 + ↕ ↕ + 15 ↔ 16 ↔ 17 ↔ 18 ↔ 19 """ dirname = os.path.dirname(__file__) diff --git a/qiskit/test/mock/backends/singapore/props_singapore.json b/qiskit/providers/fake_provider/backends/singapore/props_singapore.json similarity index 100% rename from qiskit/test/mock/backends/singapore/props_singapore.json rename to qiskit/providers/fake_provider/backends/singapore/props_singapore.json diff --git a/qiskit/providers/fake_provider/backends/sydney/__init__.py b/qiskit/providers/fake_provider/backends/sydney/__init__.py new file mode 100644 index 000000000000..c2d55c938369 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/sydney/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2021. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock sydney backend""" + +from .fake_sydney import FakeSydneyV2 +from .fake_sydney import FakeSydney diff --git a/qiskit/test/mock/backends/sydney/conf_sydney.json b/qiskit/providers/fake_provider/backends/sydney/conf_sydney.json similarity index 100% rename from qiskit/test/mock/backends/sydney/conf_sydney.json rename to qiskit/providers/fake_provider/backends/sydney/conf_sydney.json diff --git a/qiskit/test/mock/backends/sydney/defs_sydney.json b/qiskit/providers/fake_provider/backends/sydney/defs_sydney.json similarity index 100% rename from qiskit/test/mock/backends/sydney/defs_sydney.json rename to qiskit/providers/fake_provider/backends/sydney/defs_sydney.json diff --git a/qiskit/test/mock/backends/sydney/fake_sydney.py b/qiskit/providers/fake_provider/backends/sydney/fake_sydney.py similarity index 93% rename from qiskit/test/mock/backends/sydney/fake_sydney.py rename to qiskit/providers/fake_provider/backends/sydney/fake_sydney.py index 06076177de69..7a54f657d5c8 100644 --- a/qiskit/test/mock/backends/sydney/fake_sydney.py +++ b/qiskit/providers/fake_provider/backends/sydney/fake_sydney.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeSydneyV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/sydney/props_sydney.json b/qiskit/providers/fake_provider/backends/sydney/props_sydney.json similarity index 100% rename from qiskit/test/mock/backends/sydney/props_sydney.json rename to qiskit/providers/fake_provider/backends/sydney/props_sydney.json diff --git a/qiskit/providers/fake_provider/backends/tenerife/__init__.py b/qiskit/providers/fake_provider/backends/tenerife/__init__.py new file mode 100644 index 000000000000..00cfe76d9607 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/tenerife/__init__.py @@ -0,0 +1,15 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2019. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock tenerife backend""" + +from .fake_tenerife import FakeTenerife diff --git a/qiskit/test/mock/backends/tenerife/fake_tenerife.py b/qiskit/providers/fake_provider/backends/tenerife/fake_tenerife.py similarity index 89% rename from qiskit/test/mock/backends/tenerife/fake_tenerife.py rename to qiskit/providers/fake_provider/backends/tenerife/fake_tenerife.py index 653f74a90cba..251213fcedf4 100644 --- a/qiskit/test/mock/backends/tenerife/fake_tenerife.py +++ b/qiskit/providers/fake_provider/backends/tenerife/fake_tenerife.py @@ -18,7 +18,7 @@ import json from qiskit.providers.models import GateConfig, QasmBackendConfiguration, BackendProperties -from qiskit.test.mock.fake_backend import FakeBackend +from qiskit.providers.fake_provider.fake_backend import FakeBackend class FakeTenerife(FakeBackend): @@ -26,11 +26,14 @@ class FakeTenerife(FakeBackend): def __init__(self): """ - 1 - ↙ ↑ - 0 ← 2 ← 3 - ↑ ↙ - 4 + + .. code-block:: text + + 1 + ↙ ↑ + 0 ← 2 ← 3 + ↑ ↙ + 4 """ cmap = [[1, 0], [2, 0], [2, 1], [3, 2], [3, 4], [4, 2]] diff --git a/qiskit/test/mock/backends/tenerife/props_tenerife.json b/qiskit/providers/fake_provider/backends/tenerife/props_tenerife.json similarity index 100% rename from qiskit/test/mock/backends/tenerife/props_tenerife.json rename to qiskit/providers/fake_provider/backends/tenerife/props_tenerife.json diff --git a/qiskit/providers/fake_provider/backends/tokyo/__init__.py b/qiskit/providers/fake_provider/backends/tokyo/__init__.py new file mode 100644 index 000000000000..3792fa9557f9 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/tokyo/__init__.py @@ -0,0 +1,15 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2019. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock tokyo backend""" + +from .fake_tokyo import FakeTokyo diff --git a/qiskit/test/mock/backends/tokyo/fake_tokyo.py b/qiskit/providers/fake_provider/backends/tokyo/fake_tokyo.py similarity index 88% rename from qiskit/test/mock/backends/tokyo/fake_tokyo.py rename to qiskit/providers/fake_provider/backends/tokyo/fake_tokyo.py index 8b4d6be6ce5a..5b87864f654d 100644 --- a/qiskit/test/mock/backends/tokyo/fake_tokyo.py +++ b/qiskit/providers/fake_provider/backends/tokyo/fake_tokyo.py @@ -18,7 +18,7 @@ import json from qiskit.providers.models import GateConfig, QasmBackendConfiguration, BackendProperties -from qiskit.test.mock.fake_backend import FakeBackend +from qiskit.providers.fake_provider.fake_backend import FakeBackend class FakeTokyo(FakeBackend): @@ -26,13 +26,16 @@ class FakeTokyo(FakeBackend): def __init__(self): """ - 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 - ↕ ↕ ↕ ↕ ⤫ ↕ - 05 ↔ 06 ↔ 07 ↔ 08 ↔ 09 - ↕ ⤫ ↕ ↕ ⤫ ↕ - 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 - ↕ ↕ ⤫ ↕ ⤫ ↕ - 15 ↔ 16 ↔ 17 18 19 + + .. code-block:: text + + 00 ↔ 01 ↔ 02 ↔ 03 ↔ 04 + ↕ ↕ ↕ ↕ ⤫ ↕ + 05 ↔ 06 ↔ 07 ↔ 08 ↔ 09 + ↕ ⤫ ↕ ↕ ⤫ ↕ + 10 ↔ 11 ↔ 12 ↔ 13 ↔ 14 + ↕ ↕ ⤫ ↕ ⤫ ↕ + 15 ↔ 16 ↔ 17 18 19 """ cmap = [ [0, 1], diff --git a/qiskit/test/mock/backends/tokyo/props_tokyo.json b/qiskit/providers/fake_provider/backends/tokyo/props_tokyo.json similarity index 100% rename from qiskit/test/mock/backends/tokyo/props_tokyo.json rename to qiskit/providers/fake_provider/backends/tokyo/props_tokyo.json diff --git a/qiskit/providers/fake_provider/backends/toronto/__init__.py b/qiskit/providers/fake_provider/backends/toronto/__init__.py new file mode 100644 index 000000000000..0f0038099d1a --- /dev/null +++ b/qiskit/providers/fake_provider/backends/toronto/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2020. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock toronto backend""" + +from .fake_toronto import FakeTorontoV2 +from .fake_toronto import FakeToronto diff --git a/qiskit/test/mock/backends/toronto/conf_toronto.json b/qiskit/providers/fake_provider/backends/toronto/conf_toronto.json similarity index 100% rename from qiskit/test/mock/backends/toronto/conf_toronto.json rename to qiskit/providers/fake_provider/backends/toronto/conf_toronto.json diff --git a/qiskit/test/mock/backends/toronto/defs_toronto.json b/qiskit/providers/fake_provider/backends/toronto/defs_toronto.json similarity index 100% rename from qiskit/test/mock/backends/toronto/defs_toronto.json rename to qiskit/providers/fake_provider/backends/toronto/defs_toronto.json diff --git a/qiskit/test/mock/backends/toronto/fake_toronto.py b/qiskit/providers/fake_provider/backends/toronto/fake_toronto.py similarity index 93% rename from qiskit/test/mock/backends/toronto/fake_toronto.py rename to qiskit/providers/fake_provider/backends/toronto/fake_toronto.py index 039b0705016f..95c25afa7225 100644 --- a/qiskit/test/mock/backends/toronto/fake_toronto.py +++ b/qiskit/providers/fake_provider/backends/toronto/fake_toronto.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeTorontoV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/toronto/props_toronto.json b/qiskit/providers/fake_provider/backends/toronto/props_toronto.json similarity index 100% rename from qiskit/test/mock/backends/toronto/props_toronto.json rename to qiskit/providers/fake_provider/backends/toronto/props_toronto.json diff --git a/qiskit/providers/fake_provider/backends/valencia/__init__.py b/qiskit/providers/fake_provider/backends/valencia/__init__.py new file mode 100644 index 000000000000..a9e6b6d1851c --- /dev/null +++ b/qiskit/providers/fake_provider/backends/valencia/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2019. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock valencia backend""" + +from .fake_valencia import FakeValenciaV2 +from .fake_valencia import FakeValencia diff --git a/qiskit/test/mock/backends/valencia/conf_valencia.json b/qiskit/providers/fake_provider/backends/valencia/conf_valencia.json similarity index 100% rename from qiskit/test/mock/backends/valencia/conf_valencia.json rename to qiskit/providers/fake_provider/backends/valencia/conf_valencia.json diff --git a/qiskit/test/mock/backends/valencia/defs_valencia.json b/qiskit/providers/fake_provider/backends/valencia/defs_valencia.json similarity index 100% rename from qiskit/test/mock/backends/valencia/defs_valencia.json rename to qiskit/providers/fake_provider/backends/valencia/defs_valencia.json diff --git a/qiskit/test/mock/backends/valencia/fake_valencia.py b/qiskit/providers/fake_provider/backends/valencia/fake_valencia.py similarity index 93% rename from qiskit/test/mock/backends/valencia/fake_valencia.py rename to qiskit/providers/fake_provider/backends/valencia/fake_valencia.py index c21dbfd9ae76..b8e9fe8e22b5 100644 --- a/qiskit/test/mock/backends/valencia/fake_valencia.py +++ b/qiskit/providers/fake_provider/backends/valencia/fake_valencia.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeValenciaV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/valencia/props_valencia.json b/qiskit/providers/fake_provider/backends/valencia/props_valencia.json similarity index 100% rename from qiskit/test/mock/backends/valencia/props_valencia.json rename to qiskit/providers/fake_provider/backends/valencia/props_valencia.json diff --git a/qiskit/providers/fake_provider/backends/vigo/__init__.py b/qiskit/providers/fake_provider/backends/vigo/__init__.py new file mode 100644 index 000000000000..e019afc9e065 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/vigo/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2019. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock vigo backend""" + +from .fake_vigo import FakeVigoV2 +from .fake_vigo import FakeVigo diff --git a/qiskit/test/mock/backends/vigo/conf_vigo.json b/qiskit/providers/fake_provider/backends/vigo/conf_vigo.json similarity index 100% rename from qiskit/test/mock/backends/vigo/conf_vigo.json rename to qiskit/providers/fake_provider/backends/vigo/conf_vigo.json diff --git a/qiskit/test/mock/backends/vigo/fake_vigo.py b/qiskit/providers/fake_provider/backends/vigo/fake_vigo.py similarity index 80% rename from qiskit/test/mock/backends/vigo/fake_vigo.py rename to qiskit/providers/fake_provider/backends/vigo/fake_vigo.py index 71d3465329d8..6ae3aeeaaf94 100644 --- a/qiskit/test/mock/backends/vigo/fake_vigo.py +++ b/qiskit/providers/fake_provider/backends/vigo/fake_vigo.py @@ -15,15 +15,17 @@ """ import os -from qiskit.test.mock import fake_qasm_backend, fake_backend +from qiskit.providers.fake_provider import fake_qasm_backend, fake_backend class FakeVigoV2(fake_backend.FakeBackendV2): """A fake 5 qubit backend. - 0 ↔ 1 ↔ 3 ↔ 4 - ↕ - 2 + .. code-block:: text + + 0 ↔ 1 ↔ 3 ↔ 4 + ↕ + 2 """ dirname = os.path.dirname(__file__) @@ -35,9 +37,11 @@ class FakeVigoV2(fake_backend.FakeBackendV2): class FakeVigo(fake_qasm_backend.FakeQasmBackend): """A fake 5 qubit backend. - 0 ↔ 1 ↔ 3 ↔ 4 - ↕ - 2 + .. code-block:: text + + 0 ↔ 1 ↔ 3 ↔ 4 + ↕ + 2 """ dirname = os.path.dirname(__file__) diff --git a/qiskit/test/mock/backends/vigo/props_vigo.json b/qiskit/providers/fake_provider/backends/vigo/props_vigo.json similarity index 100% rename from qiskit/test/mock/backends/vigo/props_vigo.json rename to qiskit/providers/fake_provider/backends/vigo/props_vigo.json diff --git a/qiskit/providers/fake_provider/backends/washington/__init__.py b/qiskit/providers/fake_provider/backends/washington/__init__.py new file mode 100644 index 000000000000..e1a9d0ef6d4b --- /dev/null +++ b/qiskit/providers/fake_provider/backends/washington/__init__.py @@ -0,0 +1,18 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2021. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +""" +Fake Washington backend (127 qubit). +""" + +from .fake_washington import FakeWashingtonV2 +from .fake_washington import FakeWashington diff --git a/qiskit/test/mock/backends/washington/conf_washington.json b/qiskit/providers/fake_provider/backends/washington/conf_washington.json similarity index 100% rename from qiskit/test/mock/backends/washington/conf_washington.json rename to qiskit/providers/fake_provider/backends/washington/conf_washington.json diff --git a/qiskit/test/mock/backends/washington/defs_washington.json b/qiskit/providers/fake_provider/backends/washington/defs_washington.json similarity index 100% rename from qiskit/test/mock/backends/washington/defs_washington.json rename to qiskit/providers/fake_provider/backends/washington/defs_washington.json diff --git a/qiskit/test/mock/backends/washington/fake_washington.py b/qiskit/providers/fake_provider/backends/washington/fake_washington.py similarity index 93% rename from qiskit/test/mock/backends/washington/fake_washington.py rename to qiskit/providers/fake_provider/backends/washington/fake_washington.py index 472c382dd641..b09e739e60ca 100644 --- a/qiskit/test/mock/backends/washington/fake_washington.py +++ b/qiskit/providers/fake_provider/backends/washington/fake_washington.py @@ -15,7 +15,7 @@ """ import os -from qiskit.test.mock import fake_pulse_backend, fake_backend +from qiskit.providers.fake_provider import fake_pulse_backend, fake_backend class FakeWashingtonV2(fake_backend.FakeBackendV2): diff --git a/qiskit/test/mock/backends/washington/props_washington.json b/qiskit/providers/fake_provider/backends/washington/props_washington.json similarity index 100% rename from qiskit/test/mock/backends/washington/props_washington.json rename to qiskit/providers/fake_provider/backends/washington/props_washington.json diff --git a/qiskit/providers/fake_provider/backends/yorktown/__init__.py b/qiskit/providers/fake_provider/backends/yorktown/__init__.py new file mode 100644 index 000000000000..43037e7de333 --- /dev/null +++ b/qiskit/providers/fake_provider/backends/yorktown/__init__.py @@ -0,0 +1,16 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2019. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Mock yorktown backend""" + +from .fake_yorktown import FakeYorktownV2 +from .fake_yorktown import FakeYorktown diff --git a/qiskit/test/mock/backends/yorktown/conf_yorktown.json b/qiskit/providers/fake_provider/backends/yorktown/conf_yorktown.json similarity index 100% rename from qiskit/test/mock/backends/yorktown/conf_yorktown.json rename to qiskit/providers/fake_provider/backends/yorktown/conf_yorktown.json diff --git a/qiskit/test/mock/backends/yorktown/fake_yorktown.py b/qiskit/providers/fake_provider/backends/yorktown/fake_yorktown.py similarity index 78% rename from qiskit/test/mock/backends/yorktown/fake_yorktown.py rename to qiskit/providers/fake_provider/backends/yorktown/fake_yorktown.py index c4b84383b63a..4d6f529c5308 100644 --- a/qiskit/test/mock/backends/yorktown/fake_yorktown.py +++ b/qiskit/providers/fake_provider/backends/yorktown/fake_yorktown.py @@ -15,17 +15,19 @@ """ import os -from qiskit.test.mock import fake_qasm_backend, fake_backend +from qiskit.providers.fake_provider import fake_qasm_backend, fake_backend class FakeYorktownV2(fake_backend.FakeBackendV2): """A fake 5 qubit backend. - 1 - / | - 0 - 2 - 3 - | / - 4 + .. code-block:: text + + 1 + / | + 0 - 2 - 3 + | / + 4 """ dirname = os.path.dirname(__file__) @@ -37,11 +39,13 @@ class FakeYorktownV2(fake_backend.FakeBackendV2): class FakeYorktown(fake_qasm_backend.FakeQasmBackend): """A fake 5 qubit backend. - 1 - / | - 0 - 2 - 3 - | / - 4 + .. code-block:: text + + 1 + / | + 0 - 2 - 3 + | / + 4 """ dirname = os.path.dirname(__file__) diff --git a/qiskit/test/mock/backends/yorktown/props_yorktown.json b/qiskit/providers/fake_provider/backends/yorktown/props_yorktown.json similarity index 100% rename from qiskit/test/mock/backends/yorktown/props_yorktown.json rename to qiskit/providers/fake_provider/backends/yorktown/props_yorktown.json diff --git a/qiskit/test/mock/fake_1q.py b/qiskit/providers/fake_provider/fake_1q.py similarity index 98% rename from qiskit/test/mock/fake_1q.py rename to qiskit/providers/fake_provider/fake_1q.py index 3d57eb520147..cf1d7354ab73 100644 --- a/qiskit/test/mock/fake_1q.py +++ b/qiskit/providers/fake_provider/fake_1q.py @@ -16,7 +16,8 @@ import datetime from qiskit.providers.models.backendproperties import BackendProperties, Gate, Nduv -from qiskit.test.mock.fake_backend import FakeBackend + +from .fake_backend import FakeBackend class Fake1Q(FakeBackend): diff --git a/qiskit/test/mock/fake_backend.py b/qiskit/providers/fake_provider/fake_backend.py similarity index 97% rename from qiskit/test/mock/fake_backend.py rename to qiskit/providers/fake_provider/fake_backend.py index 6d152b899cdc..5bae916970f0 100644 --- a/qiskit/test/mock/fake_backend.py +++ b/qiskit/providers/fake_provider/fake_backend.py @@ -27,15 +27,16 @@ from qiskit.providers import BackendV2, BackendV1 from qiskit import pulse from qiskit.exceptions import QiskitError -from qiskit.test.mock.utils.json_decoder import ( +from qiskit.utils import optionals as _optionals +from qiskit.providers import basicaer +from qiskit.transpiler import Target + +from .utils.json_decoder import ( decode_backend_configuration, decode_backend_properties, decode_pulse_defaults, ) -from qiskit.test.mock.utils.backend_converter import convert_to_target -from qiskit.utils import optionals as _optionals -from qiskit.providers import basicaer -from qiskit.transpiler import Target +from .utils.backend_converter import convert_to_target class _Credentials: @@ -52,13 +53,13 @@ class FakeBackendV2(BackendV2): snapshots. The class inherits :class:`~qiskit.providers.BackendV2` class. This version - differs from earlier :class:`~qiskit.test.mock.FakeBackend` (V1) class in a + differs from earlier :class:`~qiskit.providers.fake_provider.FakeBackend` (V1) class in a few aspects. Firstly, configuration attribute no longer exsists. Instead, attributes exposing equivalent required immutable properties of the backend device are added. For example ``fake_backend.configuration().n_qubits`` is accessible from ``fake_backend.num_qubits`` now. Secondly, this version - removes extra abstractions :class:`~qiskit.test.mock.FakeQasmBackend` and - :class:`~qiskit.test.mock.FakePulseBackend` that were present in V1. + removes extra abstractions :class:`~qiskit.providers.fake_provider.FakeQasmBackend` and + :class:`~qiskit.providers.fake_provider.FakePulseBackend` that were present in V1. """ # directory and file names for real backend snapshots. diff --git a/qiskit/test/mock/fake_backend_v2.py b/qiskit/providers/fake_provider/fake_backend_v2.py similarity index 100% rename from qiskit/test/mock/fake_backend_v2.py rename to qiskit/providers/fake_provider/fake_backend_v2.py diff --git a/qiskit/test/mock/fake_job.py b/qiskit/providers/fake_provider/fake_job.py similarity index 100% rename from qiskit/test/mock/fake_job.py rename to qiskit/providers/fake_provider/fake_job.py diff --git a/qiskit/test/mock/fake_mumbai_v2.py b/qiskit/providers/fake_provider/fake_mumbai_v2.py similarity index 100% rename from qiskit/test/mock/fake_mumbai_v2.py rename to qiskit/providers/fake_provider/fake_mumbai_v2.py diff --git a/qiskit/test/mock/fake_openpulse_2q.py b/qiskit/providers/fake_provider/fake_openpulse_2q.py similarity index 99% rename from qiskit/test/mock/fake_openpulse_2q.py rename to qiskit/providers/fake_provider/fake_openpulse_2q.py index efd27d648212..6b9ea13bdbc7 100644 --- a/qiskit/test/mock/fake_openpulse_2q.py +++ b/qiskit/providers/fake_provider/fake_openpulse_2q.py @@ -24,6 +24,7 @@ ) from qiskit.providers.models.backendproperties import Nduv, Gate, BackendProperties from qiskit.qobj import PulseQobjInstruction + from .fake_backend import FakeBackend diff --git a/qiskit/test/mock/fake_openpulse_3q.py b/qiskit/providers/fake_provider/fake_openpulse_3q.py similarity index 99% rename from qiskit/test/mock/fake_openpulse_3q.py rename to qiskit/providers/fake_provider/fake_openpulse_3q.py index e50010fda528..8d2529a68a2a 100644 --- a/qiskit/test/mock/fake_openpulse_3q.py +++ b/qiskit/providers/fake_provider/fake_openpulse_3q.py @@ -22,6 +22,7 @@ UchannelLO, ) from qiskit.qobj import PulseQobjInstruction + from .fake_backend import FakeBackend diff --git a/qiskit/test/mock/fake_provider.py b/qiskit/providers/fake_provider/fake_provider.py similarity index 93% rename from qiskit/test/mock/fake_provider.py rename to qiskit/providers/fake_provider/fake_provider.py index b52a04a3c4ae..41b69e4ae30a 100644 --- a/qiskit/test/mock/fake_provider.py +++ b/qiskit/providers/fake_provider/fake_provider.py @@ -66,10 +66,10 @@ def get_provider(self, hub=None, group=None, project=None): class FakeProviderForBackendV2(ProviderV1): - """Dummy provider just for testing purposes. + """Fake provider containing fake V2 backends. - Only filtering backends by name is implemented. - This class contains fake V2 backends + Only filtering backends by name is implemented. This class contains all fake V2 backends + availabe in the :mod:`qiskit.providers.fake_provider`. """ def get_backend(self, name=None, **kwargs): @@ -134,9 +134,10 @@ def __init__(self): class FakeProvider(ProviderV1): - """Dummy provider just for testing purposes. + """Fake provider containing fake V1 backends. - Only filtering backends by name is implemented. + Only filtering backends by name is implemented. This class contains all fake V1 backends + availabe in the :mod:`qiskit.providers.fake_provider`. """ def get_backend(self, name=None, **kwargs): diff --git a/qiskit/test/mock/fake_pulse_backend.py b/qiskit/providers/fake_provider/fake_pulse_backend.py similarity index 90% rename from qiskit/test/mock/fake_pulse_backend.py rename to qiskit/providers/fake_provider/fake_pulse_backend.py index d22a3ba3ea7b..fdb02f7d4350 100644 --- a/qiskit/test/mock/fake_pulse_backend.py +++ b/qiskit/providers/fake_provider/fake_pulse_backend.py @@ -14,10 +14,11 @@ Fake backend abstract class for mock backends supporting OpenPulse. """ -from qiskit.providers.models import PulseBackendConfiguration, PulseDefaults -from qiskit.test.mock.fake_qasm_backend import FakeQasmBackend from qiskit.exceptions import QiskitError -from qiskit.test.mock.utils.json_decoder import decode_pulse_defaults +from qiskit.providers.models import PulseBackendConfiguration, PulseDefaults + +from .fake_qasm_backend import FakeQasmBackend +from .utils.json_decoder import decode_pulse_defaults class FakePulseBackend(FakeQasmBackend): diff --git a/qiskit/test/mock/fake_qasm_backend.py b/qiskit/providers/fake_provider/fake_qasm_backend.py similarity index 95% rename from qiskit/test/mock/fake_qasm_backend.py rename to qiskit/providers/fake_provider/fake_qasm_backend.py index d5e942922a3b..137d585bf4b3 100644 --- a/qiskit/test/mock/fake_qasm_backend.py +++ b/qiskit/providers/fake_provider/fake_qasm_backend.py @@ -17,13 +17,14 @@ import json import os +from qiskit.exceptions import QiskitError from qiskit.providers.models import BackendProperties, QasmBackendConfiguration -from qiskit.test.mock.fake_backend import FakeBackend -from qiskit.test.mock.utils.json_decoder import ( + +from .utils.json_decoder import ( decode_backend_configuration, decode_backend_properties, ) -from qiskit.exceptions import QiskitError +from .fake_backend import FakeBackend class FakeQasmBackend(FakeBackend): diff --git a/qiskit/test/mock/fake_qasm_simulator.py b/qiskit/providers/fake_provider/fake_qasm_simulator.py similarity index 99% rename from qiskit/test/mock/fake_qasm_simulator.py rename to qiskit/providers/fake_provider/fake_qasm_simulator.py index 2205a58584ef..790496856024 100644 --- a/qiskit/test/mock/fake_qasm_simulator.py +++ b/qiskit/providers/fake_provider/fake_qasm_simulator.py @@ -15,6 +15,7 @@ """ from qiskit.providers.models import GateConfig, QasmBackendConfiguration + from .fake_backend import FakeBackend diff --git a/qiskit/test/mock/fake_qobj.py b/qiskit/providers/fake_provider/fake_qobj.py similarity index 99% rename from qiskit/test/mock/fake_qobj.py rename to qiskit/providers/fake_provider/fake_qobj.py index f564fb2aa5d3..d6dd7fbd2655 100644 --- a/qiskit/test/mock/fake_qobj.py +++ b/qiskit/providers/fake_provider/fake_qobj.py @@ -23,6 +23,7 @@ QasmQobjExperiment, QasmQobjConfig, ) + from .fake_qasm_simulator import FakeQasmSimulator diff --git a/qiskit/test/mock/utils/__init__.py b/qiskit/providers/fake_provider/utils/__init__.py similarity index 100% rename from qiskit/test/mock/utils/__init__.py rename to qiskit/providers/fake_provider/utils/__init__.py diff --git a/qiskit/test/mock/utils/backend_converter.py b/qiskit/providers/fake_provider/utils/backend_converter.py similarity index 100% rename from qiskit/test/mock/utils/backend_converter.py rename to qiskit/providers/fake_provider/utils/backend_converter.py diff --git a/qiskit/test/mock/utils/configurable_backend.py b/qiskit/providers/fake_provider/utils/configurable_backend.py similarity index 99% rename from qiskit/test/mock/utils/configurable_backend.py rename to qiskit/providers/fake_provider/utils/configurable_backend.py index c55ca0eddb21..a3dd72eed97a 100644 --- a/qiskit/test/mock/utils/configurable_backend.py +++ b/qiskit/providers/fake_provider/utils/configurable_backend.py @@ -27,7 +27,8 @@ ) from qiskit.providers.models.backendproperties import Nduv, Gate from qiskit.qobj import PulseQobjInstruction -from qiskit.test.mock.fake_backend import FakeBackend + +from ..fake_backend import FakeBackend class ConfigurableFakeBackend(FakeBackend): diff --git a/qiskit/test/mock/utils/json_decoder.py b/qiskit/providers/fake_provider/utils/json_decoder.py similarity index 100% rename from qiskit/test/mock/utils/json_decoder.py rename to qiskit/providers/fake_provider/utils/json_decoder.py diff --git a/qiskit/pulse/builder.py b/qiskit/pulse/builder.py index 85ca476153b0..ab556e47ecfb 100644 --- a/qiskit/pulse/builder.py +++ b/qiskit/pulse/builder.py @@ -90,7 +90,7 @@ import math from qiskit import pulse - from qiskit.test.mock import FakeOpenPulse3Q + from qiskit.providers.fake_provider import FakeOpenPulse3Q # TODO: This example should use a real mock backend. backend = FakeOpenPulse3Q() @@ -124,7 +124,7 @@ from qiskit import pulse, QuantumCircuit from qiskit.pulse import library - from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.providers.fake_provider import FakeOpenPulse2Q backend = FakeOpenPulse2Q() @@ -240,7 +240,7 @@ .. jupyter-execute:: from qiskit import pulse - from qiskit.test.mock import FakeArmonk + from qiskit.providers.fake_provider import FakeArmonk backend = FakeArmonk() @@ -266,7 +266,7 @@ .. jupyter-execute:: from qiskit import pulse - from qiskit.test.mock import FakeArmonk + from qiskit.providers.fake_provider import FakeArmonk backend = FakeArmonk() @@ -353,7 +353,7 @@ .. jupyter-execute:: from qiskit import pulse - from qiskit.test.mock import FakeArmonk + from qiskit.providers.fake_provider import FakeArmonk backend = FakeArmonk() @@ -385,7 +385,7 @@ import math from qiskit import pulse - from qiskit.test.mock import FakeArmonk + from qiskit.providers.fake_provider import FakeArmonk backend = FakeArmonk() @@ -412,7 +412,7 @@ from qiskit import pulse - from qiskit.test.mock import FakeArmonk + from qiskit.providers.fake_provider import FakeArmonk backend = FakeArmonk() @@ -860,7 +860,7 @@ def build( .. jupyter-execute:: from qiskit import execute, pulse - from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.providers.fake_provider import FakeOpenPulse2Q backend = FakeOpenPulse2Q() @@ -991,7 +991,7 @@ def num_qubits() -> int: .. jupyter-execute:: from qiskit import pulse - from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.providers.fake_provider import FakeOpenPulse2Q backend = FakeOpenPulse2Q() @@ -1041,7 +1041,7 @@ def qubit_channels(qubit: int) -> Set[chans.Channel]: .. jupyter-execute:: from qiskit import pulse - from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.providers.fake_provider import FakeOpenPulse2Q backend = FakeOpenPulse2Q() @@ -1080,7 +1080,7 @@ def active_transpiler_settings() -> Dict[str, Any]: .. jupyter-execute:: from qiskit import pulse - from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.providers.fake_provider import FakeOpenPulse2Q backend = FakeOpenPulse2Q() @@ -1102,7 +1102,7 @@ def active_circuit_scheduler_settings() -> Dict[str, Any]: # pylint: disable=in .. jupyter-execute:: from qiskit import pulse - from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.providers.fake_provider import FakeOpenPulse2Q backend = FakeOpenPulse2Q() @@ -1437,7 +1437,7 @@ def transpiler_settings(**settings) -> ContextManager[None]: .. jupyter-execute:: from qiskit import pulse - from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.providers.fake_provider import FakeOpenPulse2Q backend = FakeOpenPulse2Q() @@ -1464,7 +1464,7 @@ def circuit_scheduler_settings(**settings) -> ContextManager[None]: .. jupyter-execute:: from qiskit import pulse - from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.providers.fake_provider import FakeOpenPulse2Q backend = FakeOpenPulse2Q() @@ -1592,7 +1592,7 @@ def drive_channel(qubit: int) -> chans.DriveChannel: .. jupyter-execute:: from qiskit import pulse - from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.providers.fake_provider import FakeOpenPulse2Q backend = FakeOpenPulse2Q() @@ -1612,7 +1612,7 @@ def measure_channel(qubit: int) -> chans.MeasureChannel: .. jupyter-execute:: from qiskit import pulse - from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.providers.fake_provider import FakeOpenPulse2Q backend = FakeOpenPulse2Q() @@ -1632,7 +1632,7 @@ def acquire_channel(qubit: int) -> chans.AcquireChannel: .. jupyter-execute:: from qiskit import pulse - from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.providers.fake_provider import FakeOpenPulse2Q backend = FakeOpenPulse2Q() @@ -1655,7 +1655,7 @@ def control_channels(*qubits: Iterable[int]) -> List[chans.ControlChannel]: .. jupyter-execute:: from qiskit import pulse - from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.providers.fake_provider import FakeOpenPulse2Q backend = FakeOpenPulse2Q() with pulse.build(backend): @@ -1910,7 +1910,7 @@ def call( .. code-block:: python from qiskit import circuit, pulse, schedule, transpile - from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.providers.fake_provider import FakeOpenPulse2Q backend = FakeOpenPulse2Q() @@ -1991,7 +1991,7 @@ def barrier(*channels_or_qubits: Union[chans.Channel, int], name: Optional[str] .. jupyter-execute:: from qiskit import pulse - from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.providers.fake_provider import FakeOpenPulse2Q backend = FakeOpenPulse2Q() @@ -2130,7 +2130,7 @@ def measure( .. jupyter-execute:: from qiskit import pulse - from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.providers.fake_provider import FakeOpenPulse2Q backend = FakeOpenPulse2Q() @@ -2211,7 +2211,7 @@ def measure_all() -> List[chans.MemorySlot]: .. jupyter-execute:: from qiskit import pulse - from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.providers.fake_provider import FakeOpenPulse2Q backend = FakeOpenPulse2Q() @@ -2251,7 +2251,7 @@ def delay_qubits(duration: int, *qubits: Union[int, Iterable[int]]): .. jupyter-execute:: from qiskit import pulse - from qiskit.test.mock import FakeOpenPulse3Q + from qiskit.providers.fake_provider import FakeOpenPulse3Q backend = FakeOpenPulse3Q() @@ -2292,7 +2292,7 @@ def call_gate(gate: circuit.Gate, qubits: Tuple[int, ...], lazy: bool = True): from qiskit import pulse from qiskit.pulse import builder from qiskit.circuit.library import standard_gates as gates - from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.providers.fake_provider import FakeOpenPulse2Q backend = FakeOpenPulse2Q() @@ -2343,7 +2343,7 @@ def cx(control: int, target: int): # pylint: disable=invalid-name .. jupyter-execute:: from qiskit import pulse - from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.providers.fake_provider import FakeOpenPulse2Q backend = FakeOpenPulse2Q() @@ -2370,7 +2370,7 @@ def u1(theta: float, qubit: int): # pylint: disable=invalid-name import math from qiskit import pulse - from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.providers.fake_provider import FakeOpenPulse2Q backend = FakeOpenPulse2Q() @@ -2397,7 +2397,7 @@ def u2(phi: float, lam: float, qubit: int): # pylint: disable=invalid-name import math from qiskit import pulse - from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.providers.fake_provider import FakeOpenPulse2Q backend = FakeOpenPulse2Q() @@ -2424,7 +2424,7 @@ def u3(theta: float, phi: float, lam: float, qubit: int): # pylint: disable=inv import math from qiskit import pulse - from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.providers.fake_provider import FakeOpenPulse2Q backend = FakeOpenPulse2Q() @@ -2449,7 +2449,7 @@ def x(qubit: int): .. jupyter-execute:: from qiskit import pulse - from qiskit.test.mock import FakeOpenPulse2Q + from qiskit.providers.fake_provider import FakeOpenPulse2Q backend = FakeOpenPulse2Q() diff --git a/qiskit/test/ibmq_mock.py b/qiskit/test/ibmq_mock.py index c5b64537fc5f..73b30f4f44ec 100644 --- a/qiskit/test/ibmq_mock.py +++ b/qiskit/test/ibmq_mock.py @@ -14,7 +14,7 @@ from unittest.mock import MagicMock import qiskit -from qiskit.test import mock as backend_mocks +from qiskit.providers import fake_provider as backend_mocks def mock_get_backend(backend): @@ -36,7 +36,9 @@ def mock_get_backend(backend): mock_ibmq = MagicMock() mock_provider = MagicMock() if not hasattr(backend_mocks, backend): - raise NameError("The specified backend name is not a valid mock from qiskit.test.mock") + raise NameError( + "The specified backend name is not a valid mock from qiskit.providers.fake_provider." + ) fake_backend = getattr(backend_mocks, backend)() mock_provider.get_backend.return_value = fake_backend mock_ibmq.get_provider.return_value = mock_provider diff --git a/qiskit/test/mock/__init__.py b/qiskit/test/mock/__init__.py index 4c9ce4a0603d..760a0b1772a9 100644 --- a/qiskit/test/mock/__init__.py +++ b/qiskit/test/mock/__init__.py @@ -20,17 +20,21 @@ The mock devices are mainly for testing the compiler. """ -from .fake_provider import FakeProviderForBackendV2, FakeProvider -from .fake_provider import FakeProviderFactory -from .fake_backend import FakeBackend -from .fake_backend_v2 import FakeBackendV2, FakeBackend5QV2 -from .fake_mumbai_v2 import FakeMumbaiFractionalCX -from .fake_job import FakeJob -from .fake_qobj import FakeQobj - -from .backends import * - -from .fake_qasm_simulator import FakeQasmSimulator -from .fake_openpulse_2q import FakeOpenPulse2Q -from .fake_openpulse_3q import FakeOpenPulse3Q -from .fake_1q import Fake1Q +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import the desired object directly 'qiskit.providers.fake_provider'.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/__init__.py b/qiskit/test/mock/backends/__init__.py index 2b85aac04439..7682c117d41c 100644 --- a/qiskit/test/mock/backends/__init__.py +++ b/qiskit/test/mock/backends/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2019. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,95 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. +"""Deprecation warnings for moved functionality.""" -""" -Mocked versions of real quantum backends. -""" +import warnings -# BackendV2 Backends -from .almaden import FakeAlmadenV2 -from .armonk import FakeArmonkV2 -from .athens import FakeAthensV2 -from .belem import FakeBelemV2 -from .boeblingen import FakeBoeblingenV2 -from .bogota import FakeBogotaV2 -from .brooklyn import FakeBrooklynV2 -from .burlington import FakeBurlingtonV2 -from .cairo import FakeCairoV2 -from .cambridge import FakeCambridgeV2 -from .casablanca import FakeCasablancaV2 -from .essex import FakeEssexV2 -from .guadalupe import FakeGuadalupeV2 -from .hanoi import FakeHanoiV2 -from .jakarta import FakeJakartaV2 -from .johannesburg import FakeJohannesburgV2 -from .kolkata import FakeKolkataV2 -from .lagos import FakeLagosV2 -from .lima import FakeLimaV2 -from .london import FakeLondonV2 -from .manhattan import FakeManhattanV2 -from .manila import FakeManilaV2 -from .melbourne import FakeMelbourneV2 -from .montreal import FakeMontrealV2 -from .mumbai import FakeMumbaiV2 -from .nairobi import FakeNairobiV2 -from .ourense import FakeOurenseV2 -from .paris import FakeParisV2 -from .poughkeepsie import FakePoughkeepsieV2 -from .quito import FakeQuitoV2 -from .rochester import FakeRochesterV2 -from .rome import FakeRomeV2 -from .santiago import FakeSantiagoV2 -from .singapore import FakeSingaporeV2 -from .sydney import FakeSydneyV2 -from .toronto import FakeTorontoV2 -from .valencia import FakeValenciaV2 -from .vigo import FakeVigoV2 -from .washington import FakeWashingtonV2 -from .yorktown import FakeYorktownV2 +import qiskit.providers.fake_provider -# BackendV1 Backends -from .almaden import FakeAlmaden -from .armonk import FakeArmonk -from .athens import FakeAthens -from .belem import FakeBelem -from .boeblingen import FakeBoeblingen -from .bogota import FakeBogota -from .brooklyn import FakeBrooklyn -from .burlington import FakeBurlington -from .cairo import FakeCairo -from .cambridge import FakeCambridge -from .cambridge import FakeCambridgeAlternativeBasis -from .casablanca import FakeCasablanca -from .essex import FakeEssex -from .guadalupe import FakeGuadalupe -from .hanoi import FakeHanoi -from .jakarta import FakeJakarta -from .johannesburg import FakeJohannesburg -from .kolkata import FakeKolkata -from .lagos import FakeLagos -from .lima import FakeLima -from .london import FakeLondon -from .manhattan import FakeManhattan -from .manila import FakeManila -from .melbourne import FakeMelbourne -from .montreal import FakeMontreal -from .mumbai import FakeMumbai -from .nairobi import FakeNairobi -from .ourense import FakeOurense -from .paris import FakeParis -from .poughkeepsie import FakePoughkeepsie -from .quito import FakeQuito -from .rochester import FakeRochester -from .rome import FakeRome -from .rueschlikon import FakeRueschlikon -from .santiago import FakeSantiago -from .singapore import FakeSingapore -from .sydney import FakeSydney -from .tenerife import FakeTenerife -from .tokyo import FakeTokyo -from .toronto import FakeToronto -from .valencia import FakeValencia -from .vigo import FakeVigo -from .washington import FakeWashington -from .yorktown import FakeYorktown + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/almaden/__init__.py b/qiskit/test/mock/backends/almaden/__init__.py index 9f0e03a7b79e..7682c117d41c 100644 --- a/qiskit/test/mock/backends/almaden/__init__.py +++ b/qiskit/test/mock/backends/almaden/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2019. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock almaden backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_almaden import FakeAlmadenV2 -from .fake_almaden import FakeAlmaden +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/armonk/__init__.py b/qiskit/test/mock/backends/armonk/__init__.py index 1a9453bcb450..7682c117d41c 100644 --- a/qiskit/test/mock/backends/armonk/__init__.py +++ b/qiskit/test/mock/backends/armonk/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2020. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock armonk backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_armonk import FakeArmonkV2 -from .fake_armonk import FakeArmonk +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/athens/__init__.py b/qiskit/test/mock/backends/athens/__init__.py index 3a7c0c18f718..7682c117d41c 100644 --- a/qiskit/test/mock/backends/athens/__init__.py +++ b/qiskit/test/mock/backends/athens/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2020. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock athens backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_athens import FakeAthensV2 -from .fake_athens import FakeAthens +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/belem/__init__.py b/qiskit/test/mock/backends/belem/__init__.py index d60733f78686..7682c117d41c 100644 --- a/qiskit/test/mock/backends/belem/__init__.py +++ b/qiskit/test/mock/backends/belem/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2021. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock belem backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_belem import FakeBelemV2 -from .fake_belem import FakeBelem +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/boeblingen/__init__.py b/qiskit/test/mock/backends/boeblingen/__init__.py index 79d0e6d1feb7..7682c117d41c 100644 --- a/qiskit/test/mock/backends/boeblingen/__init__.py +++ b/qiskit/test/mock/backends/boeblingen/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2019. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock boeblingen backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_boeblingen import FakeBoeblingenV2 -from .fake_boeblingen import FakeBoeblingen +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/bogota/__init__.py b/qiskit/test/mock/backends/bogota/__init__.py index eff8cf957c39..7682c117d41c 100644 --- a/qiskit/test/mock/backends/bogota/__init__.py +++ b/qiskit/test/mock/backends/bogota/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2020. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock bogota backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_bogota import FakeBogotaV2 -from .fake_bogota import FakeBogota +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/brooklyn/__init__.py b/qiskit/test/mock/backends/brooklyn/__init__.py index cb0eadb49f42..7682c117d41c 100644 --- a/qiskit/test/mock/backends/brooklyn/__init__.py +++ b/qiskit/test/mock/backends/brooklyn/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2020. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock brooklyn backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_brooklyn import FakeBrooklynV2 -from .fake_brooklyn import FakeBrooklyn +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/burlington/__init__.py b/qiskit/test/mock/backends/burlington/__init__.py index b6d11e698499..7682c117d41c 100644 --- a/qiskit/test/mock/backends/burlington/__init__.py +++ b/qiskit/test/mock/backends/burlington/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2019. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock burlington backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_burlington import FakeBurlingtonV2 -from .fake_burlington import FakeBurlington +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/cairo/__init__.py b/qiskit/test/mock/backends/cairo/__init__.py index a765383df106..7682c117d41c 100644 --- a/qiskit/test/mock/backends/cairo/__init__.py +++ b/qiskit/test/mock/backends/cairo/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2021. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock cairo backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_cairo import FakeCairoV2 -from .fake_cairo import FakeCairo +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/cambridge/__init__.py b/qiskit/test/mock/backends/cambridge/__init__.py index b65dd250f1c9..7682c117d41c 100644 --- a/qiskit/test/mock/backends/cambridge/__init__.py +++ b/qiskit/test/mock/backends/cambridge/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2019. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,8 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock cambridge backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_cambridge import FakeCambridgeV2 -from .fake_cambridge import FakeCambridge -from .fake_cambridge import FakeCambridgeAlternativeBasis +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/casablanca/__init__.py b/qiskit/test/mock/backends/casablanca/__init__.py index acf7033490f4..7682c117d41c 100644 --- a/qiskit/test/mock/backends/casablanca/__init__.py +++ b/qiskit/test/mock/backends/casablanca/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2021. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock casablanca backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_casablanca import FakeCasablancaV2 -from .fake_casablanca import FakeCasablanca +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/essex/__init__.py b/qiskit/test/mock/backends/essex/__init__.py index ed23aa4b0359..7682c117d41c 100644 --- a/qiskit/test/mock/backends/essex/__init__.py +++ b/qiskit/test/mock/backends/essex/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2019. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock essex backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_essex import FakeEssexV2 -from .fake_essex import FakeEssex +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/guadalupe/__init__.py b/qiskit/test/mock/backends/guadalupe/__init__.py index e15013b69fab..7682c117d41c 100644 --- a/qiskit/test/mock/backends/guadalupe/__init__.py +++ b/qiskit/test/mock/backends/guadalupe/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2021. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock guadalupe backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_guadalupe import FakeGuadalupeV2 -from .fake_guadalupe import FakeGuadalupe +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/hanoi/__init__.py b/qiskit/test/mock/backends/hanoi/__init__.py index f51accab3679..7682c117d41c 100644 --- a/qiskit/test/mock/backends/hanoi/__init__.py +++ b/qiskit/test/mock/backends/hanoi/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2021. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock hanoi backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_hanoi import FakeHanoiV2 -from .fake_hanoi import FakeHanoi +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/jakarta/__init__.py b/qiskit/test/mock/backends/jakarta/__init__.py index df7db5e263ae..7682c117d41c 100644 --- a/qiskit/test/mock/backends/jakarta/__init__.py +++ b/qiskit/test/mock/backends/jakarta/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2021. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock jakarta backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_jakarta import FakeJakartaV2 -from .fake_jakarta import FakeJakarta +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/johannesburg/__init__.py b/qiskit/test/mock/backends/johannesburg/__init__.py index 5a7e95e60bd6..7682c117d41c 100644 --- a/qiskit/test/mock/backends/johannesburg/__init__.py +++ b/qiskit/test/mock/backends/johannesburg/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2019. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock johannesburg backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_johannesburg import FakeJohannesburgV2 -from .fake_johannesburg import FakeJohannesburg +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/kolkata/__init__.py b/qiskit/test/mock/backends/kolkata/__init__.py index 03c5143c9502..7682c117d41c 100644 --- a/qiskit/test/mock/backends/kolkata/__init__.py +++ b/qiskit/test/mock/backends/kolkata/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2021. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock kolkata backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_kolkata import FakeKolkataV2 -from .fake_kolkata import FakeKolkata +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/lagos/__init__.py b/qiskit/test/mock/backends/lagos/__init__.py index 387afc6a5fe7..7682c117d41c 100644 --- a/qiskit/test/mock/backends/lagos/__init__.py +++ b/qiskit/test/mock/backends/lagos/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2021. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock lagos backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_lagos import FakeLagosV2 -from .fake_lagos import FakeLagos +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/lima/__init__.py b/qiskit/test/mock/backends/lima/__init__.py index ce24c99c763a..7682c117d41c 100644 --- a/qiskit/test/mock/backends/lima/__init__.py +++ b/qiskit/test/mock/backends/lima/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2021. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock lima backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_lima import FakeLimaV2 -from .fake_lima import FakeLima +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/london/__init__.py b/qiskit/test/mock/backends/london/__init__.py index 058905944966..7682c117d41c 100644 --- a/qiskit/test/mock/backends/london/__init__.py +++ b/qiskit/test/mock/backends/london/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2019. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock london backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_london import FakeLondonV2 -from .fake_london import FakeLondon +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/manhattan/__init__.py b/qiskit/test/mock/backends/manhattan/__init__.py index 3adf4fcbe625..7682c117d41c 100644 --- a/qiskit/test/mock/backends/manhattan/__init__.py +++ b/qiskit/test/mock/backends/manhattan/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2020. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock manhattan backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_manhattan import FakeManhattanV2 -from .fake_manhattan import FakeManhattan +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/manila/__init__.py b/qiskit/test/mock/backends/manila/__init__.py index 4ee7576ea3c4..7682c117d41c 100644 --- a/qiskit/test/mock/backends/manila/__init__.py +++ b/qiskit/test/mock/backends/manila/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2019. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock manila backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_manila import FakeManilaV2 -from .fake_manila import FakeManila +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/melbourne/__init__.py b/qiskit/test/mock/backends/melbourne/__init__.py index 05ecfdd82166..7682c117d41c 100644 --- a/qiskit/test/mock/backends/melbourne/__init__.py +++ b/qiskit/test/mock/backends/melbourne/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2019. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock melbourne backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_melbourne import FakeMelbourneV2 -from .fake_melbourne import FakeMelbourne +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/montreal/__init__.py b/qiskit/test/mock/backends/montreal/__init__.py index e4f42e6d5e00..7682c117d41c 100644 --- a/qiskit/test/mock/backends/montreal/__init__.py +++ b/qiskit/test/mock/backends/montreal/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2020. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock montreal backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_montreal import FakeMontrealV2 -from .fake_montreal import FakeMontreal +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/mumbai/__init__.py b/qiskit/test/mock/backends/mumbai/__init__.py index e6d7b6a17137..7682c117d41c 100644 --- a/qiskit/test/mock/backends/mumbai/__init__.py +++ b/qiskit/test/mock/backends/mumbai/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2021. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock mumbai backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_mumbai import FakeMumbaiV2 -from .fake_mumbai import FakeMumbai +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/nairobi/__init__.py b/qiskit/test/mock/backends/nairobi/__init__.py index 7c84cf255a72..7682c117d41c 100644 --- a/qiskit/test/mock/backends/nairobi/__init__.py +++ b/qiskit/test/mock/backends/nairobi/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2021. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock nairobi backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_nairobi import FakeNairobiV2 -from .fake_nairobi import FakeNairobi +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/ourense/__init__.py b/qiskit/test/mock/backends/ourense/__init__.py index eb3374d09caa..7682c117d41c 100644 --- a/qiskit/test/mock/backends/ourense/__init__.py +++ b/qiskit/test/mock/backends/ourense/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2019. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock ourense backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_ourense import FakeOurenseV2 -from .fake_ourense import FakeOurense +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/paris/__init__.py b/qiskit/test/mock/backends/paris/__init__.py index ec0d15fde1cb..7682c117d41c 100644 --- a/qiskit/test/mock/backends/paris/__init__.py +++ b/qiskit/test/mock/backends/paris/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2019. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock paris backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_paris import FakeParisV2 -from .fake_paris import FakeParis +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/paris/fake_paris.py b/qiskit/test/mock/backends/paris/fake_paris.py deleted file mode 100644 index e54b4442fc20..000000000000 --- a/qiskit/test/mock/backends/paris/fake_paris.py +++ /dev/null @@ -1,60 +0,0 @@ -# This code is part of Qiskit. -# -# (C) Copyright IBM 2019. -# -# This code is licensed under the Apache License, Version 2.0. You may -# obtain a copy of this license in the LICENSE.txt file in the root directory -# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. -# -# Any modifications or derivative works of this code must retain this -# copyright notice, and modified files need to carry a notice indicating -# that they have been altered from the originals. - -""" -Fake Paris device (20 qubit). -""" - -import os -from qiskit.test.mock import fake_pulse_backend, fake_backend - - -class FakeParisV2(fake_backend.FakeBackendV2): - """A fake Paris backend. - - 06 17 - ↕ ↕ - 00 ↔ 01 ↔ 04 ↔ 07 ↔ 10 ↔ 12 ↔ 15 ↔ 18 ↔ 20 ↔ 23 - ↕ ↕ ↕ - 02 13 24 - ↕ ↕ ↕ - 03 ↔ 05 ↔ 08 ↔ 11 ↔ 14 ↔ 16 ↔ 19 ↔ 22 ↔ 25 ↔ 26 - ↕ ↕ - 09 20 - """ - - dirname = os.path.dirname(__file__) - conf_filename = "conf_paris.json" - props_filename = "props_paris.json" - defs_filename = "defs_paris.json" - backend_name = "fake_paris_v2" - - -class FakeParis(fake_pulse_backend.FakePulseBackend): - """A fake Paris backend. - - 06 17 - ↕ ↕ - 00 ↔ 01 ↔ 04 ↔ 07 ↔ 10 ↔ 12 ↔ 15 ↔ 18 ↔ 20 ↔ 23 - ↕ ↕ ↕ - 02 13 24 - ↕ ↕ ↕ - 03 ↔ 05 ↔ 08 ↔ 11 ↔ 14 ↔ 16 ↔ 19 ↔ 22 ↔ 25 ↔ 26 - ↕ ↕ - 09 20 - """ - - dirname = os.path.dirname(__file__) - conf_filename = "conf_paris.json" - props_filename = "props_paris.json" - defs_filename = "defs_paris.json" - backend_name = "fake_paris" diff --git a/qiskit/test/mock/backends/poughkeepsie/__init__.py b/qiskit/test/mock/backends/poughkeepsie/__init__.py index 0bf5af896972..7682c117d41c 100644 --- a/qiskit/test/mock/backends/poughkeepsie/__init__.py +++ b/qiskit/test/mock/backends/poughkeepsie/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2019. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock poughkeepsie backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_poughkeepsie import FakePoughkeepsieV2 -from .fake_poughkeepsie import FakePoughkeepsie +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/quito/__init__.py b/qiskit/test/mock/backends/quito/__init__.py index e6ac098d4213..7682c117d41c 100644 --- a/qiskit/test/mock/backends/quito/__init__.py +++ b/qiskit/test/mock/backends/quito/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2021. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock quito backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_quito import FakeQuitoV2 -from .fake_quito import FakeQuito +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/rochester/__init__.py b/qiskit/test/mock/backends/rochester/__init__.py index 3ccc911f354d..7682c117d41c 100644 --- a/qiskit/test/mock/backends/rochester/__init__.py +++ b/qiskit/test/mock/backends/rochester/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2019. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock rochester backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_rochester import FakeRochesterV2 -from .fake_rochester import FakeRochester +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/rome/__init__.py b/qiskit/test/mock/backends/rome/__init__.py index 727b53e9044b..7682c117d41c 100644 --- a/qiskit/test/mock/backends/rome/__init__.py +++ b/qiskit/test/mock/backends/rome/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2020. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock rome backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_rome import FakeRomeV2 -from .fake_rome import FakeRome +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/rueschlikon/__init__.py b/qiskit/test/mock/backends/rueschlikon/__init__.py index 861b5a751101..7682c117d41c 100644 --- a/qiskit/test/mock/backends/rueschlikon/__init__.py +++ b/qiskit/test/mock/backends/rueschlikon/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2019. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,6 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock rueschlikon backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_rueschlikon import FakeRueschlikon +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/santiago/__init__.py b/qiskit/test/mock/backends/santiago/__init__.py index 24af2ecbe902..7682c117d41c 100644 --- a/qiskit/test/mock/backends/santiago/__init__.py +++ b/qiskit/test/mock/backends/santiago/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2020. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock santiago backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_santiago import FakeSantiagoV2 -from .fake_santiago import FakeSantiago +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/singapore/__init__.py b/qiskit/test/mock/backends/singapore/__init__.py index ece759b10992..7682c117d41c 100644 --- a/qiskit/test/mock/backends/singapore/__init__.py +++ b/qiskit/test/mock/backends/singapore/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2019. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock singapore backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_singapore import FakeSingaporeV2 -from .fake_singapore import FakeSingapore +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/sydney/__init__.py b/qiskit/test/mock/backends/sydney/__init__.py index c2d55c938369..7682c117d41c 100644 --- a/qiskit/test/mock/backends/sydney/__init__.py +++ b/qiskit/test/mock/backends/sydney/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2021. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock sydney backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_sydney import FakeSydneyV2 -from .fake_sydney import FakeSydney +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/tenerife/__init__.py b/qiskit/test/mock/backends/tenerife/__init__.py index 00cfe76d9607..7682c117d41c 100644 --- a/qiskit/test/mock/backends/tenerife/__init__.py +++ b/qiskit/test/mock/backends/tenerife/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2019. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,6 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock tenerife backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_tenerife import FakeTenerife +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/tokyo/__init__.py b/qiskit/test/mock/backends/tokyo/__init__.py index 3792fa9557f9..7682c117d41c 100644 --- a/qiskit/test/mock/backends/tokyo/__init__.py +++ b/qiskit/test/mock/backends/tokyo/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2019. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,6 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock tokyo backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_tokyo import FakeTokyo +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/toronto/__init__.py b/qiskit/test/mock/backends/toronto/__init__.py index 0f0038099d1a..7682c117d41c 100644 --- a/qiskit/test/mock/backends/toronto/__init__.py +++ b/qiskit/test/mock/backends/toronto/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2020. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock toronto backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_toronto import FakeTorontoV2 -from .fake_toronto import FakeToronto +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/valencia/__init__.py b/qiskit/test/mock/backends/valencia/__init__.py index a9e6b6d1851c..7682c117d41c 100644 --- a/qiskit/test/mock/backends/valencia/__init__.py +++ b/qiskit/test/mock/backends/valencia/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2019. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock valencia backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_valencia import FakeValenciaV2 -from .fake_valencia import FakeValencia +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/vigo/__init__.py b/qiskit/test/mock/backends/vigo/__init__.py index e019afc9e065..7682c117d41c 100644 --- a/qiskit/test/mock/backends/vigo/__init__.py +++ b/qiskit/test/mock/backends/vigo/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2019. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock vigo backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_vigo import FakeVigoV2 -from .fake_vigo import FakeVigo +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/washington/__init__.py b/qiskit/test/mock/backends/washington/__init__.py index e1a9d0ef6d4b..7682c117d41c 100644 --- a/qiskit/test/mock/backends/washington/__init__.py +++ b/qiskit/test/mock/backends/washington/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2021. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,9 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Fake Washington backend (127 qubit). -""" +"""Deprecation warnings for moved functionality.""" -from .fake_washington import FakeWashingtonV2 -from .fake_washington import FakeWashington +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/test/mock/backends/yorktown/__init__.py b/qiskit/test/mock/backends/yorktown/__init__.py index 43037e7de333..7682c117d41c 100644 --- a/qiskit/test/mock/backends/yorktown/__init__.py +++ b/qiskit/test/mock/backends/yorktown/__init__.py @@ -1,6 +1,6 @@ # This code is part of Qiskit. # -# (C) Copyright IBM 2019. +# (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory @@ -10,7 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Mock yorktown backend""" +"""Deprecation warnings for moved functionality.""" -from .fake_yorktown import FakeYorktownV2 -from .fake_yorktown import FakeYorktown +import warnings + +import qiskit.providers.fake_provider + + +def __getattr__(name): + if name.startswith("_"): + # Some Python components (including tests) do funny things with dunders. + raise AttributeError(f"module '{__name__}' has no attribute '{name}'") + + warnings.warn( + f"The module '{__name__}' is deprecated since " + "Qiskit Terra 0.21.0, and will be removed 3 months or more later. " + "Instead, you should import from `qiskit.providers.fake_provider` directly.", + category=DeprecationWarning, + stacklevel=2, + ) + return getattr(qiskit.providers.fake_provider, name) diff --git a/qiskit/tools/jupyter/__init__.py b/qiskit/tools/jupyter/__init__.py index c6bc1e0690dd..7e99de070a6f 100644 --- a/qiskit/tools/jupyter/__init__.py +++ b/qiskit/tools/jupyter/__init__.py @@ -100,7 +100,7 @@ import warnings from IPython import get_ipython -from qiskit.test.mock import FakeBackend +from qiskit.providers.fake_provider import FakeBackend from qiskit.utils import optionals as _optionals from .jupyter_magics import ProgressBarMagic, StatusMagic from .progressbar import HTMLProgressBar diff --git a/qiskit/tools/jupyter/backend_monitor.py b/qiskit/tools/jupyter/backend_monitor.py index 1c8ca931b28e..ecb401521caf 100644 --- a/qiskit/tools/jupyter/backend_monitor.py +++ b/qiskit/tools/jupyter/backend_monitor.py @@ -21,7 +21,7 @@ import ipywidgets as widgets from qiskit.exceptions import QiskitError from qiskit.visualization.gate_map import plot_gate_map, plot_error_map -from qiskit.test.mock import FakeBackend +from qiskit.providers.fake_provider import FakeBackend try: from qiskit.providers.ibmq import IBMQBackend diff --git a/qiskit/transpiler/__init__.py b/qiskit/transpiler/__init__.py index ccaec1f4d224..ac4233e6deb1 100644 --- a/qiskit/transpiler/__init__.py +++ b/qiskit/transpiler/__init__.py @@ -64,7 +64,7 @@ :hide-code: :hide-output: - from qiskit.test.mock import FakeVigo + from qiskit.providers.fake_provider import FakeVigo backend = FakeVigo() .. jupyter-execute:: @@ -198,7 +198,7 @@ from qiskit import QuantumCircuit, transpile from qiskit.visualization import plot_circuit_layout - from qiskit.test.mock import FakeVigo + from qiskit.providers.fake_provider import FakeVigo backend = FakeVigo() ghz = QuantumCircuit(3, 3) @@ -274,7 +274,7 @@ import matplotlib.pyplot as plt from qiskit import QuantumCircuit, transpile - from qiskit.test.mock import FakeBoeblingen + from qiskit.providers.fake_provider import FakeBoeblingen backend = FakeBoeblingen() ghz = QuantumCircuit(5) @@ -335,7 +335,7 @@ import matplotlib.pyplot as plt from qiskit import QuantumCircuit, transpile - from qiskit.test.mock import FakeBoeblingen + from qiskit.providers.fake_provider import FakeBoeblingen backend = FakeBoeblingen() ghz = QuantumCircuit(5) @@ -370,7 +370,7 @@ .. jupyter-execute:: from qiskit import QuantumCircuit, transpile - from qiskit.test.mock import FakeBoeblingen + from qiskit.providers.fake_provider import FakeBoeblingen backend = FakeBoeblingen() ghz = QuantumCircuit(5) diff --git a/qiskit/visualization/pulse_v2/interface.py b/qiskit/visualization/pulse_v2/interface.py index cba4389be768..180dc274a52c 100644 --- a/qiskit/visualization/pulse_v2/interface.py +++ b/qiskit/visualization/pulse_v2/interface.py @@ -309,7 +309,7 @@ def draw( from qiskit import QuantumCircuit, transpile, schedule from qiskit.visualization.pulse_v2 import draw - from qiskit.test.mock import FakeAlmaden + from qiskit.providers.fake_provider import FakeAlmaden qc = QuantumCircuit(2) qc.h(0) @@ -326,7 +326,7 @@ def draw( from qiskit import QuantumCircuit, transpile, schedule from qiskit.visualization.pulse_v2 import draw, IQXSimple - from qiskit.test.mock import FakeAlmaden + from qiskit.providers.fake_provider import FakeAlmaden qc = QuantumCircuit(2) qc.h(0) @@ -343,7 +343,7 @@ def draw( from qiskit import QuantumCircuit, transpile, schedule from qiskit.visualization.pulse_v2 import draw, IQXDebugging - from qiskit.test.mock import FakeAlmaden + from qiskit.providers.fake_provider import FakeAlmaden qc = QuantumCircuit(2) qc.h(0) diff --git a/qiskit/visualization/pulse_visualization.py b/qiskit/visualization/pulse_visualization.py index fa5485a625ce..d8088678e268 100644 --- a/qiskit/visualization/pulse_visualization.py +++ b/qiskit/visualization/pulse_visualization.py @@ -89,7 +89,7 @@ def pulse_drawer( import numpy as np import qiskit from qiskit import pulse - from qiskit.test.mock.backends.almaden import FakeAlmaden + from qiskit.providers.fake_provider import FakeAlmaden inst_map = FakeAlmaden().defaults().instruction_schedule_map @@ -117,7 +117,7 @@ def pulse_drawer( import numpy as np import qiskit from qiskit import pulse - from qiskit.test.mock.backends.almaden import FakeAlmaden + from qiskit.providers.fake_provider import FakeAlmaden inst_map = FakeAlmaden().defaults().instruction_schedule_map diff --git a/qiskit/visualization/timeline/interface.py b/qiskit/visualization/timeline/interface.py index 689757fe5f1e..7a3f2dc15750 100644 --- a/qiskit/visualization/timeline/interface.py +++ b/qiskit/visualization/timeline/interface.py @@ -291,7 +291,7 @@ def draw( from qiskit import QuantumCircuit, transpile, schedule from qiskit.visualization.timeline import draw - from qiskit.test.mock import FakeAlmaden + from qiskit.providers.fake_provider import FakeAlmaden qc = QuantumCircuit(2) qc.h(0) @@ -306,7 +306,7 @@ def draw( from qiskit import QuantumCircuit, transpile, schedule from qiskit.visualization.timeline import draw, IQXSimple - from qiskit.test.mock import FakeAlmaden + from qiskit.providers.fake_provider import FakeAlmaden qc = QuantumCircuit(2) qc.h(0) @@ -321,7 +321,7 @@ def draw( from qiskit import QuantumCircuit, transpile, schedule from qiskit.visualization.timeline import draw, IQXDebugging - from qiskit.test.mock import FakeAlmaden + from qiskit.providers.fake_provider import FakeAlmaden qc = QuantumCircuit(2) qc.h(0) diff --git a/releasenotes/notes/0.12/physical-qubits-as-integers-86b999bcfe0098dd.yaml b/releasenotes/notes/0.12/physical-qubits-as-integers-86b999bcfe0098dd.yaml index 392373fc3c1f..b2de8a28d278 100644 --- a/releasenotes/notes/0.12/physical-qubits-as-integers-86b999bcfe0098dd.yaml +++ b/releasenotes/notes/0.12/physical-qubits-as-integers-86b999bcfe0098dd.yaml @@ -9,7 +9,7 @@ features: For Example: - .. jupyter-execute:: + .. code-block:: python from qiskit import QuantumCircuit from qiskit import transpile diff --git a/releasenotes/notes/0.16/delay-in-circuit-33f0d81783ac12ea.yaml b/releasenotes/notes/0.16/delay-in-circuit-33f0d81783ac12ea.yaml index bc04ad96c472..d482e3f97e2f 100644 --- a/releasenotes/notes/0.16/delay-in-circuit-33f0d81783ac12ea.yaml +++ b/releasenotes/notes/0.16/delay-in-circuit-33f0d81783ac12ea.yaml @@ -26,7 +26,7 @@ features: determined). This makes it possible to see how scheduled instructions (gates) look in the circuit level. - .. jupyter-execute:: + .. code-block:: from qiskit import QuantumCircuit, transpile from qiskit.test.mock.backends import FakeAthens @@ -56,7 +56,7 @@ features: The :func:`~qiskit.compiler.schedule` has been updated so that it can schedule circuits with delays. Now there are two paths to schedule a circuit with delay: - + .. code-block:: python qc = QuantumCircuit(1, 1) diff --git a/releasenotes/notes/0.16/pulse-schedule-disassembler-5315a00bd5d17dfd.yaml b/releasenotes/notes/0.16/pulse-schedule-disassembler-5315a00bd5d17dfd.yaml index 965e8087821e..81951496da9b 100644 --- a/releasenotes/notes/0.16/pulse-schedule-disassembler-5315a00bd5d17dfd.yaml +++ b/releasenotes/notes/0.16/pulse-schedule-disassembler-5315a00bd5d17dfd.yaml @@ -5,7 +5,7 @@ features: been added to the :func:`qiskit.assembler.disassemble` function. For example: - .. code-block:: + .. code-block:: python from qiskit import pulse from qiskit.assembler.disassemble import disassemble diff --git a/releasenotes/notes/0.16/timeline-drawer-1c5e9b4a7f50f8c8.yaml b/releasenotes/notes/0.16/timeline-drawer-1c5e9b4a7f50f8c8.yaml index eae7075348ab..55508c83ac97 100644 --- a/releasenotes/notes/0.16/timeline-drawer-1c5e9b4a7f50f8c8.yaml +++ b/releasenotes/notes/0.16/timeline-drawer-1c5e9b4a7f50f8c8.yaml @@ -6,7 +6,7 @@ features: For example: - .. jupyter-execute:: + .. code-block:: python from qiskit.visualization import timeline_drawer from qiskit import QuantumCircuit, transpile diff --git a/releasenotes/notes/0.18/add-alignment-management-passes-650b8172e1426a73.yaml b/releasenotes/notes/0.18/add-alignment-management-passes-650b8172e1426a73.yaml index 1ec2d1fff385..7b3c694b80ad 100644 --- a/releasenotes/notes/0.18/add-alignment-management-passes-650b8172e1426a73.yaml +++ b/releasenotes/notes/0.18/add-alignment-management-passes-650b8172e1426a73.yaml @@ -31,10 +31,10 @@ features: The backends from IBM Quantum Services (accessible via the `qiskit-ibmq-provider `__ package) will provide the alignment information in the near future. - + For example: - .. jupyter-execute:: + .. code-block:: python from qiskit import circuit, transpile from qiskit.test.mock import FakeArmonk @@ -47,7 +47,7 @@ features: qc.measure(0, 0) qc.draw('mpl') - .. jupyter-execute:: + .. code-block:: qct = transpile(qc, backend, scheduling_method='alap', timing_constraints={'acquire_alignment': 16}) diff --git a/releasenotes/notes/move-qiskit.test.mock-to-qiskit.providers.fake_provider-7f36ff80a05f9a9a.yaml b/releasenotes/notes/move-qiskit.test.mock-to-qiskit.providers.fake_provider-7f36ff80a05f9a9a.yaml new file mode 100644 index 000000000000..df488aaaac4b --- /dev/null +++ b/releasenotes/notes/move-qiskit.test.mock-to-qiskit.providers.fake_provider-7f36ff80a05f9a9a.yaml @@ -0,0 +1,8 @@ +--- +deprecations: + - | + The ``qiskit.test.mock`` modules is now deprecated. The fake backend and fake provider classes + which were previously available in ``qiskit.test.mock`` have been accessible in + :mod:`qiskit.providers.fake_provider` since Terra 0.20.0. This change represents a proper + commitment to support the fake backend classes as part of Qiskit, whereas previously they were + just part of the internal testing suite, which were exposed to users as a side effect. diff --git a/test/ipynb/mpl/circuit/test_circuit_matplotlib_drawer.py b/test/ipynb/mpl/circuit/test_circuit_matplotlib_drawer.py index 3da563cbf881..9a6ded17f808 100644 --- a/test/ipynb/mpl/circuit/test_circuit_matplotlib_drawer.py +++ b/test/ipynb/mpl/circuit/test_circuit_matplotlib_drawer.py @@ -23,7 +23,7 @@ from qiskit.test import QiskitTestCase from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, transpile -from qiskit.test.mock import FakeTenerife +from qiskit.providers.fake_provider import FakeTenerife from qiskit.visualization.circuit_visualization import _matplotlib_circuit_drawer from qiskit.circuit.library import ( XGate, diff --git a/test/ipynb/mpl/graph/test_graph_matplotlib_drawer.py b/test/ipynb/mpl/graph/test_graph_matplotlib_drawer.py index 879e2c7b21d5..8218475f5b09 100644 --- a/test/ipynb/mpl/graph/test_graph_matplotlib_drawer.py +++ b/test/ipynb/mpl/graph/test_graph_matplotlib_drawer.py @@ -25,7 +25,7 @@ from qiskit.utils import optionals from qiskit.visualization.counts_visualization import plot_histogram from qiskit.visualization.gate_map import plot_gate_map, plot_coupling_map -from qiskit.test.mock.fake_provider import ( +from qiskit.providers.fake_provider import ( FakeArmonk, FakeBelem, FakeCasablanca, diff --git a/test/python/algorithms/test_backendv1.py b/test/python/algorithms/test_backendv1.py index 484ec99d4ed4..aa251841e744 100644 --- a/test/python/algorithms/test_backendv1.py +++ b/test/python/algorithms/test_backendv1.py @@ -15,7 +15,7 @@ import unittest from test.python.algorithms import QiskitAlgorithmsTestCase from qiskit import QuantumCircuit -from qiskit.test.mock import FakeProvider +from qiskit.providers.fake_provider import FakeProvider from qiskit.utils import QuantumInstance, algorithm_globals from qiskit.algorithms import Shor, VQE, Grover, AmplificationProblem from qiskit.opflow import X, Z, I diff --git a/test/python/algorithms/test_backendv2.py b/test/python/algorithms/test_backendv2.py index e96d5d2176bf..27cf0f7cfb86 100644 --- a/test/python/algorithms/test_backendv2.py +++ b/test/python/algorithms/test_backendv2.py @@ -15,8 +15,8 @@ import unittest from test.python.algorithms import QiskitAlgorithmsTestCase from qiskit import QuantumCircuit -from qiskit.test.mock import FakeProvider -from qiskit.test.mock.fake_backend_v2 import FakeBackendSimple +from qiskit.providers.fake_provider import FakeProvider +from qiskit.providers.fake_provider.fake_backend_v2 import FakeBackendSimple from qiskit.utils import QuantumInstance from qiskit.algorithms import Shor, VQE, Grover, AmplificationProblem from qiskit.opflow import X, Z, I diff --git a/test/python/circuit/test_parameters.py b/test/python/circuit/test_parameters.py index 633190415164..ed25350bf227 100644 --- a/test/python/circuit/test_parameters.py +++ b/test/python/circuit/test_parameters.py @@ -35,7 +35,7 @@ from qiskit import pulse from qiskit.quantum_info import Operator from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeOurense +from qiskit.providers.fake_provider import FakeOurense from qiskit.tools import parallel_map diff --git a/test/python/circuit/test_scheduled_circuit.py b/test/python/circuit/test_scheduled_circuit.py index cf817a1a7f51..ad8f66e0d27d 100644 --- a/test/python/circuit/test_scheduled_circuit.py +++ b/test/python/circuit/test_scheduled_circuit.py @@ -17,7 +17,7 @@ from qiskit import QuantumCircuit, QiskitError from qiskit import transpile, assemble, BasicAer from qiskit.circuit import Parameter -from qiskit.test.mock.backends import FakeParis +from qiskit.providers.fake_provider import FakeParis from qiskit.transpiler.exceptions import TranspilerError from qiskit.transpiler.instruction_durations import InstructionDurations diff --git a/test/python/compiler/test_assembler.py b/test/python/compiler/test_assembler.py index b93f8f3496e3..9dae6a17b579 100644 --- a/test/python/compiler/test_assembler.py +++ b/test/python/compiler/test_assembler.py @@ -32,7 +32,12 @@ from qiskit.qobj.utils import MeasLevel, MeasReturnType from qiskit.pulse.macros import measure from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeOpenPulse2Q, FakeOpenPulse3Q, FakeYorktown, FakeAlmaden +from qiskit.providers.fake_provider import ( + FakeOpenPulse2Q, + FakeOpenPulse3Q, + FakeYorktown, + FakeAlmaden, +) class RxGate(Gate): diff --git a/test/python/compiler/test_compiler.py b/test/python/compiler/test_compiler.py index 6218270a5cb8..ce7b9d44f402 100644 --- a/test/python/compiler/test_compiler.py +++ b/test/python/compiler/test_compiler.py @@ -22,7 +22,7 @@ from qiskit.circuit.library import U1Gate, U2Gate from qiskit.compiler import transpile, assemble from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeRueschlikon, FakeTenerife +from qiskit.providers.fake_provider import FakeRueschlikon, FakeTenerife from qiskit.qobj import QasmQobj diff --git a/test/python/compiler/test_disassembler.py b/test/python/compiler/test_disassembler.py index 42e127f71601..9828f1ba3c1c 100644 --- a/test/python/compiler/test_disassembler.py +++ b/test/python/compiler/test_disassembler.py @@ -27,7 +27,7 @@ from qiskit.circuit.library import RXGate from qiskit.pulse.transforms import target_qobj_transform from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeOpenPulse2Q +from qiskit.providers.fake_provider import FakeOpenPulse2Q import qiskit.quantum_info as qi diff --git a/test/python/compiler/test_scheduler.py b/test/python/compiler/test_scheduler.py index e396d9068a8a..bb3379d490bc 100644 --- a/test/python/compiler/test_scheduler.py +++ b/test/python/compiler/test_scheduler.py @@ -16,7 +16,7 @@ from qiskit.exceptions import QiskitError from qiskit.pulse import InstructionScheduleMap, Schedule from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeOpenPulse3Q +from qiskit.providers.fake_provider import FakeOpenPulse3Q from qiskit.compiler.scheduler import schedule diff --git a/test/python/compiler/test_sequencer.py b/test/python/compiler/test_sequencer.py index 80e742120c7b..d065bff42e5f 100644 --- a/test/python/compiler/test_sequencer.py +++ b/test/python/compiler/test_sequencer.py @@ -18,7 +18,7 @@ from qiskit import QuantumCircuit, pulse from qiskit.compiler import sequence, transpile, schedule from qiskit.pulse.transforms import pad -from qiskit.test.mock import FakeParis +from qiskit.providers.fake_provider import FakeParis from qiskit.test import QiskitTestCase diff --git a/test/python/compiler/test_transpiler.py b/test/python/compiler/test_transpiler.py index 095b6753c04a..40f5d59113dd 100644 --- a/test/python/compiler/test_transpiler.py +++ b/test/python/compiler/test_transpiler.py @@ -35,7 +35,7 @@ from qiskit.circuit.library import CXGate, U3Gate, U2Gate, U1Gate, RXGate, RYGate, RZGate, UGate from qiskit.circuit.measure import Measure from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeMelbourne, FakeRueschlikon, FakeAlmaden, FakeMumbaiV2 +from qiskit.providers.fake_provider import FakeMelbourne, FakeRueschlikon, FakeAlmaden, FakeMumbaiV2 from qiskit.transpiler import Layout, CouplingMap from qiskit.transpiler import PassManager from qiskit.transpiler.target import Target diff --git a/test/python/mock/test_mock_module_deprecation.py b/test/python/mock/test_mock_module_deprecation.py new file mode 100644 index 000000000000..d2355c84717b --- /dev/null +++ b/test/python/mock/test_mock_module_deprecation.py @@ -0,0 +1,28 @@ +# This code is part of Qiskit. +# +# (C) Copyright IBM 2022. +# +# This code is licensed under the Apache License, Version 2.0. You may +# obtain a copy of this license in the LICENSE.txt file in the root directory +# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. +# +# Any modifications or derivative works of this code must retain this +# copyright notice, and modified files need to carry a notice indicating +# that they have been altered from the originals. + +"""Test for deprecation of qiskit.test.mock module.""" +from qiskit.test import QiskitTestCase + + +class MockModuleDeprecationTest(QiskitTestCase): + """Test for deprecation of qiskit.test.mock module.""" + + def test_deprecated_mock_module(self): + """Test that the mock module is deprecated.""" + # pylint: disable=unused-import,no-name-in-module + with self.assertWarns(DeprecationWarning): + from qiskit.test.mock import FakeWashington + with self.assertWarns(DeprecationWarning): + from qiskit.test.mock.backends import FakeWashington + with self.assertWarns(DeprecationWarning): + from qiskit.test.mock.backends.washington import FakeWashington diff --git a/test/python/mock/test_new_qasm_backend.py b/test/python/mock/test_new_qasm_backend.py deleted file mode 100644 index 0b8425647666..000000000000 --- a/test/python/mock/test_new_qasm_backend.py +++ /dev/null @@ -1,36 +0,0 @@ -# This code is part of Qiskit. -# -# (C) Copyright IBM 2021. -# -# This code is licensed under the Apache License, Version 2.0. You may -# obtain a copy of this license in the LICENSE.txt file in the root directory -# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. -# -# Any modifications or derivative works of this code must retain this -# copyright notice, and modified files need to carry a notice indicating -# that they have been altered from the originals. - -"""Test of qasm fake backends from qiskit.mock package.""" -import unittest -from qiskit import QuantumCircuit, transpile -from qiskit.test import QiskitTestCase -from qiskit.providers.fake_provider import FakeBogota -from qiskit.utils import optionals as _optionals - - -class FakeQasmBackendsTest(QiskitTestCase): - """Tests for FakeQasmBackend""" - - @unittest.skipUnless(_optionals.HAS_AER, "qiskit-aer is required to run this test") - def test_fake_qasm_backend_configured(self): - """Fake backends honor kwargs passed.""" - backend = FakeBogota() # this is a FakePulseBackend implementation - - qc = QuantumCircuit(2) - qc.x(range(0, 2)) - qc.measure_all() - - trans_qc = transpile(qc, backend) - raw_counts = backend.run(trans_qc, shots=1000).result().get_counts() - - self.assertEqual(sum(raw_counts.values()), 1000) diff --git a/test/python/mock/test_configurable_backend.py b/test/python/providers/fake_provider/test_configurable_backend.py similarity index 98% rename from test/python/mock/test_configurable_backend.py rename to test/python/providers/fake_provider/test_configurable_backend.py index f8c03c7d5e44..a5c59d64c4f1 100644 --- a/test/python/mock/test_configurable_backend.py +++ b/test/python/providers/fake_provider/test_configurable_backend.py @@ -12,7 +12,7 @@ """Test of configurable backend generation.""" from qiskit.test import QiskitTestCase -from qiskit.test.mock.utils.configurable_backend import ConfigurableFakeBackend +from qiskit.providers.fake_provider.utils.configurable_backend import ConfigurableFakeBackend class TestConfigurableFakeBackend(QiskitTestCase): diff --git a/test/python/mock/test_fake_backends.py b/test/python/providers/fake_provider/test_fake_backends.py similarity index 95% rename from test/python/mock/test_fake_backends.py rename to test/python/providers/fake_provider/test_fake_backends.py index 79bd4405916b..d150a894a120 100644 --- a/test/python/mock/test_fake_backends.py +++ b/test/python/providers/fake_provider/test_fake_backends.py @@ -18,8 +18,8 @@ from qiskit.pulse import Schedule from qiskit.qobj import PulseQobj from qiskit.test import QiskitTestCase -from qiskit.test.mock.utils.configurable_backend import ConfigurableFakeBackend -from qiskit.test.mock import FakeAthens +from qiskit.providers.fake_provider.utils.configurable_backend import ConfigurableFakeBackend +from qiskit.providers.fake_provider import FakeAthens from qiskit.utils import optionals diff --git a/test/python/providers/fake_provider/test_new_pulse_backend.py b/test/python/providers/fake_provider/test_new_pulse_backend.py deleted file mode 100644 index e9c41334db54..000000000000 --- a/test/python/providers/fake_provider/test_new_pulse_backend.py +++ /dev/null @@ -1,49 +0,0 @@ -# This code is part of Qiskit. -# -# (C) Copyright IBM 2021. -# -# This code is licensed under the Apache License, Version 2.0. You may -# obtain a copy of this license in the LICENSE.txt file in the root directory -# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. -# -# Any modifications or derivative works of this code must retain this -# copyright notice, and modified files need to carry a notice indicating -# that they have been altered from the originals. - -"""Test of pulse fake backends from qiskit.mock package.""" -import unittest -from qiskit import QuantumCircuit, transpile -from qiskit.test import QiskitTestCase -from qiskit.providers.fake_provider import FakeAthens -from qiskit.utils import optionals as _optionals -from qiskit.providers.fake_provider import FakePulseBackend - - -class FakePulseBackendConfigError(FakePulseBackend): - """Example backend not configured used for testing errors.""" - - props_filename = None - - -class FakePulseBackendsTest(QiskitTestCase): - """Tests for FakePulseBackend""" - - @unittest.skipUnless(_optionals.HAS_AER, "qiskit-aer is required to run this test") - def test_fake_pulse_backend_configured(self): - """Fake backends honor kwargs passed.""" - backend = FakeAthens() # this is a FakePulseBackend implementation - - qc = QuantumCircuit(2) - qc.x(range(0, 2)) - qc.measure_all() - - trans_qc = transpile(qc, backend) - raw_counts = backend.run(trans_qc, shots=1000).result().get_counts() - - self.assertEqual(sum(raw_counts.values()), 1000) - - @unittest.expectedFailure - def test_fake_pulse_backend_configuration_error(self): - """Test configuration error for pulse backend.""" - backend = FakePulseBackendConfigError() - backend.defaults() diff --git a/test/python/providers/faulty_backends.py b/test/python/providers/faulty_backends.py index a7260b51bbcb..575c192ced07 100644 --- a/test/python/providers/faulty_backends.py +++ b/test/python/providers/faulty_backends.py @@ -13,7 +13,7 @@ """Faulty fake backends for testing""" from qiskit.providers.models import BackendProperties -from qiskit.test.mock import FakeOurense +from qiskit.providers.fake_provider import FakeOurense class FakeOurenseFaultyQ1(FakeOurense): diff --git a/test/python/providers/test_backend_v2.py b/test/python/providers/test_backend_v2.py index a4625d7c3ce7..1be5c96950b3 100644 --- a/test/python/providers/test_backend_v2.py +++ b/test/python/providers/test_backend_v2.py @@ -24,13 +24,13 @@ from qiskit.compiler.transpiler import _parse_inst_map from qiskit.pulse.instruction_schedule_map import InstructionScheduleMap from qiskit.test.base import QiskitTestCase -from qiskit.test.mock.fake_backend_v2 import ( +from qiskit.providers.fake_provider import FakeMumbaiFractionalCX +from qiskit.providers.fake_provider.fake_backend_v2 import ( FakeBackendV2, FakeBackend5QV2, FakeBackendSimple, FakeBackendV2LegacyQubitProps, ) -from qiskit.test.mock.fake_mumbai_v2 import FakeMumbaiFractionalCX from qiskit.quantum_info import Operator diff --git a/test/python/providers/test_backendconfiguration.py b/test/python/providers/test_backendconfiguration.py index d96f4f6e4d0e..e418fef2e19a 100644 --- a/test/python/providers/test_backendconfiguration.py +++ b/test/python/providers/test_backendconfiguration.py @@ -16,7 +16,7 @@ import copy from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeProvider +from qiskit.providers.fake_provider import FakeProvider from qiskit.pulse.channels import DriveChannel, MeasureChannel, ControlChannel, AcquireChannel from qiskit.providers import BackendConfigurationError diff --git a/test/python/providers/test_backendproperties.py b/test/python/providers/test_backendproperties.py index 3e0c9adf574e..3bb15bda1064 100644 --- a/test/python/providers/test_backendproperties.py +++ b/test/python/providers/test_backendproperties.py @@ -14,8 +14,7 @@ import copy -from qiskit.test.mock import FakeOurense -from qiskit.test.mock import FakeProvider +from qiskit.providers.fake_provider import FakeProvider, FakeOurense from qiskit.test import QiskitTestCase from qiskit.providers.exceptions import BackendPropertyError diff --git a/test/python/providers/test_backendstatus.py b/test/python/providers/test_backendstatus.py index 35bbb67766b0..95f9e6d9aa82 100644 --- a/test/python/providers/test_backendstatus.py +++ b/test/python/providers/test_backendstatus.py @@ -14,7 +14,7 @@ """ from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeLondon +from qiskit.providers.fake_provider import FakeLondon from qiskit.providers.models import BackendStatus diff --git a/test/python/providers/test_fake_backends.py b/test/python/providers/test_fake_backends.py index da7b6ebd6127..79dfc27121fd 100644 --- a/test/python/providers/test_fake_backends.py +++ b/test/python/providers/test_fake_backends.py @@ -24,8 +24,7 @@ from qiskit.exceptions import QiskitError from qiskit.execute_function import execute from qiskit.test.base import QiskitTestCase -from qiskit.test.mock import FakeProviderForBackendV2, FakeProvider -from qiskit.test.mock import FakeMumbaiV2 +from qiskit.providers.fake_provider import FakeProviderForBackendV2, FakeProvider, FakeMumbaiV2 from qiskit.utils import optionals FAKE_PROVIDER_FOR_BACKEND_V2 = FakeProviderForBackendV2() diff --git a/test/python/providers/test_pulse_defaults.py b/test/python/providers/test_pulse_defaults.py index d4e493343e18..a85e1bdaec46 100644 --- a/test/python/providers/test_pulse_defaults.py +++ b/test/python/providers/test_pulse_defaults.py @@ -18,7 +18,7 @@ import numpy as np from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeOpenPulse2Q +from qiskit.providers.fake_provider import FakeOpenPulse2Q class TestPulseDefaults(QiskitTestCase): diff --git a/test/python/pulse/test_block.py b/test/python/pulse/test_block.py index 5ed91e110697..201da25fb156 100644 --- a/test/python/pulse/test_block.py +++ b/test/python/pulse/test_block.py @@ -18,7 +18,7 @@ from qiskit.pulse import transforms from qiskit.pulse.exceptions import PulseError from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeOpenPulse2Q, FakeArmonk +from qiskit.providers.fake_provider import FakeOpenPulse2Q, FakeArmonk from qiskit.utils import has_aer diff --git a/test/python/pulse/test_builder.py b/test/python/pulse/test_builder.py index eb3223695b90..d17b5954da74 100644 --- a/test/python/pulse/test_builder.py +++ b/test/python/pulse/test_builder.py @@ -21,8 +21,8 @@ from qiskit.pulse.instructions import directives from qiskit.pulse.transforms import target_qobj_transform from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeOpenPulse2Q -from qiskit.test.mock.utils.configurable_backend import ( +from qiskit.providers.fake_provider import FakeOpenPulse2Q +from qiskit.providers.fake_provider.utils.configurable_backend import ( ConfigurableFakeBackend as ConfigurableBackend, ) from qiskit.pulse import library, instructions diff --git a/test/python/pulse/test_calibrationbuilder.py b/test/python/pulse/test_calibrationbuilder.py index e9e942d71dcc..67c0de561257 100644 --- a/test/python/pulse/test_calibrationbuilder.py +++ b/test/python/pulse/test_calibrationbuilder.py @@ -20,7 +20,7 @@ from qiskit import circuit, schedule from qiskit.pulse import ControlChannel, Delay, DriveChannel, GaussianSquare, Play, ShiftPhase from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeAthens +from qiskit.providers.fake_provider import FakeAthens from qiskit.transpiler import PassManager from qiskit.transpiler.passes.calibration.builders import ( RZXCalibrationBuilder, diff --git a/test/python/pulse/test_instruction_schedule_map.py b/test/python/pulse/test_instruction_schedule_map.py index 1121ed57819c..34f59a7e6671 100644 --- a/test/python/pulse/test_instruction_schedule_map.py +++ b/test/python/pulse/test_instruction_schedule_map.py @@ -35,7 +35,7 @@ from qiskit.qobj import PulseQobjInstruction from qiskit.qobj.converters import QobjToInstructionConverter from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeOpenPulse2Q, FakeAthens +from qiskit.providers.fake_provider import FakeOpenPulse2Q, FakeAthens class TestInstructionScheduleMap(QiskitTestCase): diff --git a/test/python/pulse/test_macros.py b/test/python/pulse/test_macros.py index 8fe0f8f8f088..3fa7553b3a74 100644 --- a/test/python/pulse/test_macros.py +++ b/test/python/pulse/test_macros.py @@ -24,7 +24,7 @@ ) from qiskit.pulse import macros from qiskit.pulse.exceptions import PulseError -from qiskit.test.mock import FakeOpenPulse2Q +from qiskit.providers.fake_provider import FakeOpenPulse2Q from qiskit.test import QiskitTestCase diff --git a/test/python/pulse/test_schedule.py b/test/python/pulse/test_schedule.py index e0d516333ef5..e8f6a2f5a84f 100644 --- a/test/python/pulse/test_schedule.py +++ b/test/python/pulse/test_schedule.py @@ -46,7 +46,7 @@ from qiskit.pulse.exceptions import PulseError from qiskit.pulse.schedule import Schedule, _overlaps, _find_insertion_index from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeOpenPulse2Q +from qiskit.providers.fake_provider import FakeOpenPulse2Q class BaseTestSchedule(QiskitTestCase): diff --git a/test/python/pulse/test_transforms.py b/test/python/pulse/test_transforms.py index abaefe8fdac3..49038afdb096 100644 --- a/test/python/pulse/test_transforms.py +++ b/test/python/pulse/test_transforms.py @@ -32,7 +32,7 @@ from qiskit.pulse.channels import MemorySlot, DriveChannel, AcquireChannel from qiskit.pulse.instructions import directives from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeOpenPulse2Q +from qiskit.providers.fake_provider import FakeOpenPulse2Q class TestAlignMeasures(QiskitTestCase): diff --git a/test/python/result/test_mitigators.py b/test/python/result/test_mitigators.py index d4f6ed04cfc6..ce40791ed3df 100644 --- a/test/python/result/test_mitigators.py +++ b/test/python/result/test_mitigators.py @@ -34,7 +34,7 @@ ) from qiskit.result.utils import marginal_counts from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeYorktown +from qiskit.providers.fake_provider import FakeYorktown class TestReadoutMitigation(QiskitTestCase): diff --git a/test/python/scheduler/test_basic_scheduler.py b/test/python/scheduler/test_basic_scheduler.py index 68bb76bc7d18..8b7944eb7883 100644 --- a/test/python/scheduler/test_basic_scheduler.py +++ b/test/python/scheduler/test_basic_scheduler.py @@ -29,7 +29,7 @@ ) from qiskit.pulse import build, macros, play, InstructionScheduleMap -from qiskit.test.mock import FakeBackend, FakeOpenPulse2Q, FakeOpenPulse3Q +from qiskit.providers.fake_provider import FakeBackend, FakeOpenPulse2Q, FakeOpenPulse3Q from qiskit.test import QiskitTestCase diff --git a/test/python/tools/jupyter/test_notebooks.py b/test/python/tools/jupyter/test_notebooks.py index 9a4e5a9f2427..82b30e77e7f5 100644 --- a/test/python/tools/jupyter/test_notebooks.py +++ b/test/python/tools/jupyter/test_notebooks.py @@ -53,7 +53,7 @@ def _execute_notebook(self, filename): import qiskit.providers.ibmq import sys from unittest.mock import create_autospec, MagicMock - from qiskit.test.mock import FakeProviderFactory + from qiskit.providers.fake_provider import FakeProviderFactory from qiskit.providers import basicaer fake_prov = FakeProviderFactory() qiskit.IBMQ = fake_prov diff --git a/test/python/tools/monitor/test_backend_monitor.py b/test/python/tools/monitor/test_backend_monitor.py index a38614a81a23..a2c4802802e6 100644 --- a/test/python/tools/monitor/test_backend_monitor.py +++ b/test/python/tools/monitor/test_backend_monitor.py @@ -22,9 +22,7 @@ from qiskit import providers from qiskit.tools.monitor import backend_overview, backend_monitor from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeProviderFactory -from qiskit.test.mock import FakeBackend -from qiskit.test.mock import FakeVigo +from qiskit.providers.fake_provider import FakeProviderFactory, FakeBackend, FakeVigo class TestBackendOverview(QiskitTestCase): diff --git a/test/python/transpiler/test_1q.py b/test/python/transpiler/test_1q.py index 7a40bc2988b0..3ecf438f8fa0 100644 --- a/test/python/transpiler/test_1q.py +++ b/test/python/transpiler/test_1q.py @@ -17,7 +17,7 @@ from qiskit import QuantumCircuit from qiskit.compiler import transpile from qiskit.test import QiskitTestCase -from qiskit.test.mock import Fake1Q +from qiskit.providers.fake_provider import Fake1Q from qiskit.transpiler import TranspilerError diff --git a/test/python/transpiler/test_bip_mapping.py b/test/python/transpiler/test_bip_mapping.py index 5cc5171428f9..68101fa58a33 100644 --- a/test/python/transpiler/test_bip_mapping.py +++ b/test/python/transpiler/test_bip_mapping.py @@ -19,7 +19,7 @@ from qiskit.circuit.library.standard_gates import SwapGate from qiskit.converters import circuit_to_dag from qiskit.test import QiskitTestCase -from qiskit.test.mock.backends import FakeLima +from qiskit.providers.fake_provider import FakeLima from qiskit.transpiler import CouplingMap, Layout, PassManager from qiskit.transpiler.exceptions import TranspilerError from qiskit.transpiler.passes import BIPMapping diff --git a/test/python/transpiler/test_coupling.py b/test/python/transpiler/test_coupling.py index 9eb3293d187b..bf210178abae 100644 --- a/test/python/transpiler/test_coupling.py +++ b/test/python/transpiler/test_coupling.py @@ -14,7 +14,7 @@ from qiskit.transpiler import CouplingMap from qiskit.transpiler.exceptions import CouplingError -from qiskit.test.mock import FakeRueschlikon +from qiskit.providers.fake_provider import FakeRueschlikon from qiskit.test import QiskitTestCase diff --git a/test/python/transpiler/test_csp_layout.py b/test/python/transpiler/test_csp_layout.py index d1bff383bd54..86564c553a0d 100644 --- a/test/python/transpiler/test_csp_layout.py +++ b/test/python/transpiler/test_csp_layout.py @@ -20,7 +20,7 @@ from qiskit.transpiler.passes import CSPLayout from qiskit.converters import circuit_to_dag from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeTenerife, FakeRueschlikon, FakeTokyo +from qiskit.providers.fake_provider import FakeTenerife, FakeRueschlikon, FakeTokyo class TestCSPLayout(QiskitTestCase): diff --git a/test/python/transpiler/test_dense_layout.py b/test/python/transpiler/test_dense_layout.py index 8582c6e2970d..5dbfb17e52b8 100644 --- a/test/python/transpiler/test_dense_layout.py +++ b/test/python/transpiler/test_dense_layout.py @@ -23,7 +23,7 @@ from qiskit.transpiler.passes import DenseLayout from qiskit.converters import circuit_to_dag from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeTokyo +from qiskit.providers.fake_provider import FakeTokyo class TestDenseLayout(QiskitTestCase): diff --git a/test/python/transpiler/test_echo_rzx_weyl_decomposition.py b/test/python/transpiler/test_echo_rzx_weyl_decomposition.py index 410a1441ffcf..54f630d4ed24 100644 --- a/test/python/transpiler/test_echo_rzx_weyl_decomposition.py +++ b/test/python/transpiler/test_echo_rzx_weyl_decomposition.py @@ -23,7 +23,7 @@ ) from qiskit.converters import circuit_to_dag, dag_to_circuit from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeParis +from qiskit.providers.fake_provider import FakeParis import qiskit.quantum_info as qi diff --git a/test/python/transpiler/test_gates_in_basis_pass.py b/test/python/transpiler/test_gates_in_basis_pass.py index 299d1dff7b06..929ee7c89d93 100644 --- a/test/python/transpiler/test_gates_in_basis_pass.py +++ b/test/python/transpiler/test_gates_in_basis_pass.py @@ -21,7 +21,7 @@ from qiskit.transpiler.passes import GatesInBasis from qiskit.transpiler.target import Target from qiskit.test import QiskitTestCase -from qiskit.test.mock.fake_backend_v2 import FakeBackend5QV2 +from qiskit.providers.fake_provider.fake_backend_v2 import FakeBackend5QV2 class TestGatesInBasisPass(QiskitTestCase): diff --git a/test/python/transpiler/test_instruction_durations.py b/test/python/transpiler/test_instruction_durations.py index e7c296ae89dc..4c5a5959a799 100644 --- a/test/python/transpiler/test_instruction_durations.py +++ b/test/python/transpiler/test_instruction_durations.py @@ -15,7 +15,7 @@ """Test InstructionDurations class.""" from qiskit.circuit import Delay, Parameter -from qiskit.test.mock.backends import FakeParis, FakeTokyo +from qiskit.providers.fake_provider import FakeParis, FakeTokyo from qiskit.transpiler.exceptions import TranspilerError from qiskit.transpiler.instruction_durations import InstructionDurations diff --git a/test/python/transpiler/test_lookahead_swap.py b/test/python/transpiler/test_lookahead_swap.py index f7a0fe9388d1..c28a6f62d681 100644 --- a/test/python/transpiler/test_lookahead_swap.py +++ b/test/python/transpiler/test_lookahead_swap.py @@ -20,7 +20,7 @@ from qiskit.converters import circuit_to_dag from qiskit import ClassicalRegister, QuantumRegister, QuantumCircuit from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeMelbourne +from qiskit.providers.fake_provider import FakeMelbourne class TestLookaheadSwap(QiskitTestCase): diff --git a/test/python/transpiler/test_passmanager_config.py b/test/python/transpiler/test_passmanager_config.py index 375efb9704f5..5c581a892109 100644 --- a/test/python/transpiler/test_passmanager_config.py +++ b/test/python/transpiler/test_passmanager_config.py @@ -15,9 +15,7 @@ from qiskit import QuantumRegister from qiskit.providers.backend import Backend from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeMelbourne -from qiskit.test.mock.backends.almaden.fake_almaden import FakeAlmaden, FakeAlmadenV2 -from qiskit.test.mock.backends import FakeArmonk +from qiskit.providers.fake_provider import FakeMelbourne, FakeAlmaden, FakeAlmadenV2, FakeArmonk from qiskit.transpiler.coupling import CouplingMap from qiskit.transpiler.passmanager_config import PassManagerConfig diff --git a/test/python/transpiler/test_passmanager_run.py b/test/python/transpiler/test_passmanager_run.py index b1cd24a7a63c..c2a90d0debb7 100644 --- a/test/python/transpiler/test_passmanager_run.py +++ b/test/python/transpiler/test_passmanager_run.py @@ -16,7 +16,7 @@ from qiskit.circuit.library import CXGate from qiskit.transpiler.preset_passmanagers import level_1_pass_manager from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeMelbourne +from qiskit.providers.fake_provider import FakeMelbourne from qiskit.transpiler import Layout from qiskit.transpiler.passmanager_config import PassManagerConfig diff --git a/test/python/transpiler/test_preset_passmanagers.py b/test/python/transpiler/test_preset_passmanagers.py index 57f7dfc0ee65..bfe84c65ba43 100644 --- a/test/python/transpiler/test_preset_passmanagers.py +++ b/test/python/transpiler/test_preset_passmanagers.py @@ -25,7 +25,7 @@ from qiskit.transpiler import CouplingMap, Layout, PassManager, TranspilerError from qiskit.circuit.library import U2Gate, U3Gate from qiskit.test import QiskitTestCase -from qiskit.test.mock import ( +from qiskit.providers.fake_provider import ( FakeTenerife, FakeMelbourne, FakeJohannesburg, diff --git a/test/python/transpiler/test_pulse_gate_pass.py b/test/python/transpiler/test_pulse_gate_pass.py index e0e96e2a4449..b6a227f6a724 100644 --- a/test/python/transpiler/test_pulse_gate_pass.py +++ b/test/python/transpiler/test_pulse_gate_pass.py @@ -14,7 +14,7 @@ from qiskit import pulse, circuit, transpile from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeAthens +from qiskit.providers.fake_provider import FakeAthens class TestPulseGate(QiskitTestCase): diff --git a/test/python/transpiler/test_sabre_layout.py b/test/python/transpiler/test_sabre_layout.py index 2c0d57f25df5..85561f102e47 100644 --- a/test/python/transpiler/test_sabre_layout.py +++ b/test/python/transpiler/test_sabre_layout.py @@ -19,7 +19,7 @@ from qiskit.transpiler.passes import SabreLayout from qiskit.converters import circuit_to_dag from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeAlmaden +from qiskit.providers.fake_provider import FakeAlmaden class TestSabreLayout(QiskitTestCase): diff --git a/test/python/transpiler/test_target.py b/test/python/transpiler/test_target.py index 418996056b26..939432c33e81 100644 --- a/test/python/transpiler/test_target.py +++ b/test/python/transpiler/test_target.py @@ -40,8 +40,7 @@ from qiskit.transpiler import Target from qiskit.transpiler import InstructionProperties from qiskit.test import QiskitTestCase -from qiskit.test.mock.fake_backend_v2 import FakeBackendV2 -from qiskit.test.mock.fake_mumbai_v2 import FakeMumbaiFractionalCX +from qiskit.providers.fake_provider import FakeBackendV2, FakeMumbaiFractionalCX class TestTarget(QiskitTestCase): diff --git a/test/python/transpiler/test_trivial_layout.py b/test/python/transpiler/test_trivial_layout.py index 8fab7b662f40..f75478676b34 100644 --- a/test/python/transpiler/test_trivial_layout.py +++ b/test/python/transpiler/test_trivial_layout.py @@ -20,7 +20,7 @@ from qiskit.transpiler import TranspilerError from qiskit.converters import circuit_to_dag from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeTenerife, FakeRueschlikon +from qiskit.providers.fake_provider import FakeTenerife, FakeRueschlikon class TestTrivialLayout(QiskitTestCase): diff --git a/test/python/transpiler/test_unitary_synthesis.py b/test/python/transpiler/test_unitary_synthesis.py index 3ac77aa4a08c..253ec2939ee7 100644 --- a/test/python/transpiler/test_unitary_synthesis.py +++ b/test/python/transpiler/test_unitary_synthesis.py @@ -24,7 +24,8 @@ from qiskit import transpile from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeVigo, FakeBackend5QV2, FakeBackendV2, FakeMumbaiFractionalCX +from qiskit.providers.fake_provider import FakeVigo, FakeMumbaiFractionalCX +from qiskit.providers.fake_provider.fake_backend_v2 import FakeBackendV2, FakeBackend5QV2 from qiskit.circuit import QuantumCircuit, QuantumRegister from qiskit.circuit.library import QuantumVolume from qiskit.converters import circuit_to_dag diff --git a/test/python/transpiler/test_vf2_layout.py b/test/python/transpiler/test_vf2_layout.py index 6294df7c8c25..57eaa09a0330 100644 --- a/test/python/transpiler/test_vf2_layout.py +++ b/test/python/transpiler/test_vf2_layout.py @@ -21,7 +21,12 @@ from qiskit.transpiler.passes.layout.vf2_layout import VF2Layout, VF2LayoutStopReason from qiskit.converters import circuit_to_dag from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeTenerife, FakeRueschlikon, FakeManhattan, FakeYorktown +from qiskit.providers.fake_provider import ( + FakeTenerife, + FakeRueschlikon, + FakeManhattan, + FakeYorktown, +) from qiskit.circuit.library import GraphState, CXGate diff --git a/test/python/transpiler/test_vf2_post_layout.py b/test/python/transpiler/test_vf2_post_layout.py index 64898ffe8f64..1eea1602519f 100644 --- a/test/python/transpiler/test_vf2_post_layout.py +++ b/test/python/transpiler/test_vf2_post_layout.py @@ -20,7 +20,7 @@ from qiskit.transpiler.passes.layout.vf2_post_layout import VF2PostLayout, VF2PostLayoutStopReason from qiskit.converters import circuit_to_dag from qiskit.test import QiskitTestCase -from qiskit.test.mock import FakeYorktown, FakeLima, FakeLimaV2, FakeYorktownV2 +from qiskit.providers.fake_provider import FakeLima, FakeYorktown, FakeLimaV2, FakeYorktownV2 from qiskit.circuit import Qubit from qiskit.compiler.transpiler import transpile diff --git a/test/python/visualization/test_circuit_latex.py b/test/python/visualization/test_circuit_latex.py index cef69b972d07..51b1c28050bc 100644 --- a/test/python/visualization/test_circuit_latex.py +++ b/test/python/visualization/test_circuit_latex.py @@ -21,7 +21,7 @@ from qiskit.visualization import circuit_drawer from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, transpile -from qiskit.test.mock import FakeTenerife +from qiskit.providers.fake_provider import FakeTenerife from qiskit.circuit.library import XGate, MCXGate, RZZGate, SwapGate, DCXGate, CPhaseGate from qiskit.extensions import HamiltonianGate from qiskit.circuit import Parameter, Qubit, Clbit diff --git a/test/python/visualization/test_gate_map.py b/test/python/visualization/test_gate_map.py index 99541fe37564..4f1a5a31276a 100644 --- a/test/python/visualization/test_gate_map.py +++ b/test/python/visualization/test_gate_map.py @@ -17,8 +17,8 @@ from io import BytesIO from PIL import Image from ddt import ddt, data -from qiskit.test.mock import FakeProvider from qiskit.providers.fake_provider import ( + FakeProvider, FakeKolkata, FakeWashington, FakeKolkataV2, diff --git a/test/randomized/test_transpiler_equivalence.py b/test/randomized/test_transpiler_equivalence.py index 4c123b51c6f9..bfb48d0068de 100644 --- a/test/randomized/test_transpiler_equivalence.py +++ b/test/randomized/test_transpiler_equivalence.py @@ -59,7 +59,7 @@ from qiskit import transpile, Aer from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister from qiskit.circuit import Measure, Reset, Gate, Barrier -from qiskit.test.mock import ( +from qiskit.providers.fake_provider import ( FakeProvider, FakeOpenPulse2Q, FakeOpenPulse3Q, diff --git a/tools/update_fake_backends.py b/tools/update_fake_backends.py index 470ff8f6346c..6ac32028e97e 100755 --- a/tools/update_fake_backends.py +++ b/tools/update_fake_backends.py @@ -43,8 +43,8 @@ def default(self, o): DEFAULT_DIR = os.path.join( os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "qiskit", - "test", - "mock", + "providers", + "fake_provider", "backends", ) diff --git a/tools/verify_parallel_map.py b/tools/verify_parallel_map.py index 87fc8830abf7..d7559933504e 100755 --- a/tools/verify_parallel_map.py +++ b/tools/verify_parallel_map.py @@ -28,7 +28,7 @@ from qiskit.compiler import transpile from qiskit.circuit import QuantumCircuit, QuantumRegister, ClassicalRegister -from qiskit.test.mock import FakeRueschlikon +from qiskit.providers.fake_provider import FakeRueschlikon def run_test(): diff --git a/tox.ini b/tox.ini index d6ea51e275ad..ee04a83bc77e 100644 --- a/tox.ini +++ b/tox.ini @@ -72,6 +72,7 @@ setenv = QISKIT_SUPPRESS_PACKAGING_WARNINGS=Y deps = -r{toxinidir}/requirements-dev.txt + qiskit-aer commands = sphinx-build -W -T --keep-going -b html docs/ docs/_build/html {posargs}