Move `qiskit.test.mock` to `qiskit.providers.fake_provider` and deprecate (#8121)

* redirect imports from qiskit.test.mock to qiskit.providers.fake_provider

* import the rest of classes in fake_backend_v2 to fake_provider

* redirect imports to fake_provider

Anything that can be imported from fake_provider root are imported from there instead of sub files.

* change jupyter-execute to code-block

* redirect import

* Combine multiple imports into one

* Add missing )

* move all files except __init__ from qiskit.test.mock to qiskit.providers.fake_provider

* redirect imports in fake_provider.__init__.py

* redirect imports in mock.__init__.py

* Use relative imports in fake_provider.__init__.py

* redirect .utlis imports

* Don't import fake_backend_v2.py in __init__ to avoid clashes of FakeBackendV2 names

* Match imports from the old and new __init__

* Organize imports

* black linting

* Fix FakePulseBackend import order dependency

* fix cyclic import

* move relative import after absolute import

* fix cyclic import

* Update MANIFEST.ini with new path

* add deprecation warning

* add deprecation test

* add release note

* move test files from test.python.mock to test.python.providers.fake_provider

* linting

* linting

* change deprecation warning location

* update path for tools/update_fake_backends.py

* rename docstrings

* Update ibmq_mock.py

* import back FakeBackendV2 and FakeBackend5QV2 in __init__

* Modify release note

* reformat release note

* remove unnecessary tests

These two tests were introduced in PR #7437 to test the new imports which are not needed any more: https://github.com/Qiskit/qiskit-terra/pull/7437#discussion_r810843786

* Use relative imports

* redirect import in test_schedular.py

* first draft of module level doc

* Update docstring of fake provider v1 and v2

* Update wording of module level doc

* add fake V1 and V2 backends

* Correct fake v1 and v2 backends in the list

* comment on backends that do not have V2 versions

* list special fake backends

* Add descriptions for sections

* add code example using jupyter execute

* Update code example and improve descriptions of the module

* not using fake provider before fake provider get backend name is fixed

* modify comment

* formating fix

* Remove fake backend coupling map from docstrings

* linting

* remove coupling map of Pooughkeepsie

* add qiskit-aer to tox.ini as deps for docs build

* Revert "remove coupling map of Pooughkeepsie"

This reverts commit 4560748930.

* Revert "linting"

This reverts commit eddfa65bf6.

* Revert "Remove fake backend coupling map from docstrings"

This reverts commit 3aee7a8b57.

* fix coupling maps

* Fix minor typos

* Issue deprecation warnings from all levels of package

The previous commits in this PR did not maintain the old import paths
for submodules of `qisit.test.mock`.  This re-instatates them, with
suitable deprecation warnings.  Hopefully nobody is using these anyway,
but it's better to be on the safe side.

* Import from the correct location

Co-authored-by: Jake Lishman <jake@binhbar.com>
Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Junye Huang 2022-06-23 04:28:30 +02:00 committed by GitHub
parent f25a7ed586
commit 3241978340
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
341 changed files with 2442 additions and 779 deletions

View File

@ -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

View File

@ -0,0 +1,6 @@
.. _qiskit-providers-fakeprovider:
.. automodule:: qiskit.providers.fake_provider
:no-members:
:no-inherited-members:
:no-special-members:

View File

@ -18,6 +18,7 @@ Qiskit Terra API Reference
extensions
providers_basicaer
providers
providers_fake_provider
providers_models
pulse
scheduler

View File

@ -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
# Fake job and qobj classes
from .fake_job import FakeJob
from .fake_qobj import FakeQobj
from qiskit.test.mock.backends import *
# Base classes for fake backends
from .fake_backend import FakeBackend
from .fake_qasm_backend import FakeQasmBackend
from .fake_pulse_backend import FakePulseBackend
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 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

View File

@ -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

View File

@ -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

View File

@ -15,19 +15,21 @@ Fake Almaden device (20 qubit).
"""
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__)

View File

@ -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

View File

@ -15,13 +15,15 @@ Fake Armonk device (5 qubit).
"""
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__)

View File

@ -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

View File

@ -15,7 +15,7 @@ Fake Athens device (5 qubit).
"""
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):

View File

@ -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

View File

@ -15,7 +15,7 @@ Fake Belem device (5 qubit).
"""
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):

View File

@ -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

View File

@ -15,19 +15,21 @@ Fake Boeblingen device (20 qubit).
"""
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__)

View File

@ -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

View File

@ -15,7 +15,7 @@ Fake Bogota device (5 qubit).
"""
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):

View File

@ -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

View File

@ -15,7 +15,7 @@ Fake Brooklyn device (65 qubit).
"""
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):

View File

@ -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

View File

@ -15,15 +15,17 @@ Fake Burlington device (5 qubit).
"""
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__)

View File

@ -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

View File

@ -15,7 +15,7 @@ Fake Cairo device (27 qubit).
"""
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):

View File

@ -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

View File

@ -15,21 +15,23 @@ Fake Cambridge device (20 qubit).
"""
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__)

View File

@ -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

View File

@ -15,7 +15,7 @@ Fake Casablanca device (7 qubit).
"""
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):

View File

@ -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

View File

@ -15,17 +15,19 @@ Fake Essex device (5 qubit).
"""
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__)

View File

@ -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

View File

@ -16,7 +16,7 @@ Fake Guadalupe device (5 qubit).
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):

View File

@ -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

View File

@ -15,7 +15,7 @@ Fake Hanoi device (27 qubit).
"""
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):

View File

@ -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

View File

@ -15,7 +15,7 @@ Fake Jakarta device (7 qubit).
"""
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):

View File

@ -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

View File

@ -15,19 +15,21 @@ Fake Johannesburg device (20 qubit).
"""
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__)

View File

@ -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

View File

@ -15,7 +15,7 @@ Fake Kolkata device (27 qubit).
"""
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):

View File

@ -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

View File

@ -15,7 +15,7 @@ Fake Lagos device (7 qubit).
"""
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):

View File

@ -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

View File

@ -15,7 +15,7 @@ Fake Lima device (5 qubit).
"""
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):

View File

@ -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

Some files were not shown because too many files have changed in this diff Show More