Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove provider-specific fake backends,FakeProvider class and related tools in 1.0 #11376

Merged
merged 15 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ include requirements.txt
recursive-include qiskit/qasm/libs *.inc
include qiskit/VERSION.txt
include qiskit/visualization/circuit/styles/*.json
recursive-include qiskit/providers/fake_provider/backends *.json
recursive-include qiskit/providers/fake_provider/backends_v1 *.json

# Include the tests files.
Expand Down
191 changes: 20 additions & 171 deletions qiskit/providers/fake_provider/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,23 @@
Overview
========

The fake provider module contains fake providers, fake backends and other simulated backend
implementations. 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.
The fake provider module in Qiskit contains fake (simulated) backend classes
useful for testing the transpiler and other backend-facing functionality.

Example Usage
=============

Here is an example of using a fake backend for transpilation and simulation.
Here is an example of using a simulated backend for transpilation and running.

.. plot::
:include-source:

from qiskit import QuantumCircuit
from qiskit.providers.fake_provider import FakeManilaV2
from qiskit import transpile
from qiskit import QuantumCircuit, transpile
from qiskit.providers.fake_provider import GenericBackendV2
from qiskit.visualization import plot_histogram


# Get a fake backend from the fake provider
backend = FakeManilaV2()
# Generate a 5-qubit simulated backend
backend = GenericBackendV2(num_qubits=5)

# Create a simple circuit
circuit = QuantumCircuit(3)
Expand All @@ -56,201 +50,56 @@
transpiled_circuit = transpile(circuit, backend)
transpiled_circuit.draw('mpl')

# Run the transpiled circuit using the simulated fake backend
# Run the transpiled circuit using the simulated 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 you will need to create a noise
model from the current properties of the backend manually.

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. They are all subclasses of
:class:`FakeBackendV2`.

.. autosummary::
:toctree: ../stubs/

FakeAlmadenV2
FakeArmonkV2
FakeAthensV2
FakeAuckland
FakeBelemV2
FakeBoeblingenV2
FakeBogotaV2
FakeBrooklynV2
FakeBurlingtonV2
FakeCairoV2
FakeCambridgeV2
FakeCasablancaV2
FakeEssexV2
FakeGeneva
FakeGuadalupeV2
FakeHanoiV2
FakeJakartaV2
FakeJohannesburgV2
FakeKolkataV2
FakeLagosV2
FakeLimaV2
FakeLondonV2
FakeManhattanV2
FakeManilaV2
FakeMelbourneV2
FakeMontrealV2
FakeMumbaiV2
FakeNairobiV2
FakeOslo
FakeOurenseV2
FakeParisV2
FakePerth
FakePrague
FakePoughkeepsieV2
FakeQuitoV2
FakeRochesterV2
FakeRomeV2
.. FakeRueschlikonV2 # no v2 version
FakeSantiagoV2
FakeSherbrooke
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.
V2 Simulated Backends
=====================

.. 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
=====================
GenericBackendV2

Special fake backends are fake backends that were created for special testing purposes.
V1 Fake Backends (Legacy interface)
===================================

.. autosummary::
:toctree: ../stubs/

FakeQasmSimulator
FakeOpenPulse2Q
FakeOpenPulse3Q
Fake1Q
FakeBackendV2
FakeBackend5QV2
FakeMumbaiFractionalCX
GenericBackendV2
Fake5QV1
Fake20QV1
Fake7QPulseV1
Fake27QPulseV1
Fake127QPulseV1

Fake Backend Base Classes
=========================

The fake backends based on IBM hardware are based on a set of base classes:

.. currentmodule:: qiskit.providers.fake_provider.fake_backend
.. autoclass:: qiskit.providers.fake_provider.fake_backend.FakeBackendV2
The V1 fake backends are based on a set of base classes:

.. currentmodule:: qiskit.providers.fake_provider
.. autoclass:: FakeBackend
.. autoclass:: FakeQasmBackend
.. autoclass:: FakePulseBackend
"""

# Fake job and qobj classes
from .fake_job import FakeJob
from .fake_qobj import FakeQobj

# Base classes for fake backends
from . import fake_backend
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 purposes
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

# Generic fake backends
from .backends_v1 import *
from .backends_v1 import Fake5QV1, Fake20QV1, Fake7QPulseV1, Fake27QPulseV1, Fake127QPulseV1
from .generic_backend_v2 import GenericBackendV2
110 changes: 0 additions & 110 deletions qiskit/providers/fake_provider/backends/__init__.py

This file was deleted.

16 changes: 0 additions & 16 deletions qiskit/providers/fake_provider/backends/almaden/__init__.py

This file was deleted.

This file was deleted.

Loading
Loading