French
Languages
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

Fake Provider (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.

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()
        ┌───┐           ░ ┌─┐      
   q_0: ┤ H ├──■────■───░─┤M├──────
        └───┘┌─┴─┐  │   ░ └╥┘┌─┐   
   q_1: ─────┤ X ├──┼───░──╫─┤M├───
             └───┘┌─┴─┐ ░  ║ └╥┘┌─┐
   q_2: ──────────┤ X ├─░──╫──╫─┤M├
                  └───┘ ░  ║  ║ └╥┘
meas: 3/═══════════════════╩══╩══╩═
                           0  1  2 
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()
global phase: π/4

ancilla_0 -> 0 ──────────────────────────────────────────────────

ancilla_1 -> 1 ──────────────────────────────────────────────────
                                           ┌───┐      ░    ┌─┐   
      q_1 -> 2 ────────────────────────────┤ X ├──────░────┤M├───
               ┌─────────┐┌────┐┌─────────┐└─┬─┘      ░ ┌─┐└╥┘   
      q_0 -> 3 ┤ Rz(π/2) ├┤ √X ├┤ Rz(π/2) ├──■────■───░─┤M├─╫────
               └─────────┘└────┘└─────────┘     ┌─┴─┐ ░ └╥┘ ║ ┌─┐
      q_2 -> 4 ─────────────────────────────────┤ X ├─░──╫──╫─┤M├
                                                └───┘ ░  ║  ║ └╥┘
       meas: 3/══════════════════════════════════════════╩══╩══╩═
                                                         0  1  2 
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)
../_images/providers_fake_provider_2_0.png

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.

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.

FakeProviderForBackendV2()

Fake provider containing fake V2 backends.

FakeProvider()

Fake provider containing fake V1 backends.

Fake Backends

Fake V2 Backends

Fake V2 backends are fake backends with IBM Quantum systems snapshots implemented with BackendV2 interface.

FakeAlmadenV2()

A fake Almaden V2 backend.

FakeArmonkV2()

A fake 1 qubit backend.

FakeAthensV2()

A fake 5 qubit backend.

FakeAuckland()

A fake 27 qubit backend.

FakeBelemV2()

A fake 5 qubit backend.

FakeBoeblingenV2()

A fake Boeblingen V2 backend.

FakeBogotaV2()

A fake 5 qubit backend.

FakeBrooklynV2()

A fake Brooklyn V2 backend.

FakeBurlingtonV2()

A fake 5 qubit backend.

FakeCairoV2()

A fake 27 qubit backend.

FakeCambridgeV2()

A fake Cambridge backend.

FakeCasablancaV2()

A fake 7 qubit backend.

FakeEssexV2()

A fake 5 qubit backend.

FakeGeneva()

A fake 27 qubit backend.

FakeGuadalupeV2()

A fake 16 qubit backend.

FakeHanoiV2()

A fake 27 qubit backend.

FakeJakartaV2()

A fake 7 qubit V2 backend.

FakeJohannesburgV2()

A fake Johannesburg V2 backend.

FakeKolkataV2()

A fake 27 qubit backend.

FakeLagosV2()

A fake 7 qubit backend.

FakeLimaV2()

A fake 5 qubit backend.

FakeLondonV2()

A fake 5 qubit backend.

FakeManhattanV2()

A fake Manhattan backend.

FakeManilaV2()

A fake 5 qubit backend.

FakeMelbourneV2()

A fake 14 qubit backend.

FakeMontrealV2()

A fake 27 qubit backend.

FakeMumbaiV2()

A fake 27 qubit backend.

FakeNairobiV2()

A fake 7 qubit backend.

FakeOslo()

A fake 7 qubit backend.

FakeOurenseV2()

A fake 5 qubit backend.

FakeParisV2()

A fake Paris backend.

FakePerth()

A fake 7 qubit backend.

FakePoughkeepsieV2()

A fake Poughkeepsie backend.

FakeQuitoV2()

A fake 5 qubit backend.

FakeRochesterV2()

A fake Rochester backend.

FakeRomeV2()

A fake 5 qubit backend.

FakeSantiagoV2()

A fake Santiago backend.

FakeSingaporeV2()

A fake Singapore backend.

FakeSydneyV2()

A fake 27 qubit backend.

FakeTorontoV2()

A fake 27 qubit backend.

FakeValenciaV2()

A fake 5 qubit backend.

FakeVigoV2()

A fake 5 qubit backend.

FakeWashingtonV2()

A fake 127 qubit backend.

FakeYorktownV2()

A fake 5 qubit backend.

Fake V1 Backends

Fake V1 backends are fake backends with IBM Quantum systems snapshots implemented with BackendV1 interface.

FakeAlmaden()

A fake Almaden backend.

FakeArmonk()

A fake 1 qubit backend.

FakeAthens()

A fake 5 qubit backend.

FakeBelem()

A fake 5 qubit backend.

FakeBoeblingen()

A fake Boeblingen backend.

FakeBogota()

A fake 5 qubit backend.

FakeBrooklyn()

A fake Brooklyn backend.

FakeBurlington()

A fake 5 qubit backend.

FakeCairo()

A fake 27 qubit backend.

FakeCambridge()

A fake Cambridge backend.

FakeCasablanca()

A fake 7 qubit backend.

FakeEssex()

A fake 5 qubit backend.

FakeGuadalupe()

A fake 16 qubit backend.

FakeHanoi()

A fake 27 qubit backend.

FakeJakarta()

A fake 7 qubit backend.

FakeJohannesburg()

A fake Johannesburg backend.

FakeKolkata()

A fake 27 qubit backend.

FakeLagos()

A fake 7 qubit backend.

FakeLima()

A fake 5 qubit backend.

FakeLondon()

A fake 5 qubit backend.

FakeManhattan()

A fake Manhattan backend.

FakeManila()

A fake 5 qubit backend.

FakeMelbourne()

A fake 14 qubit backend.

FakeMontreal()

A fake 27 qubit backend.

FakeMumbai()

A fake 27 qubit backend.

FakeNairobi()

A fake 7 qubit backend.

FakeOurense()

A fake 5 qubit backend.

FakeParis()

A fake Paris backend.

FakePoughkeepsie()

A fake Poughkeepsie backend.

FakeQuito()

A fake 5 qubit backend.

FakeRochester()

A fake Rochester backend.

FakeRome()

A fake 5 qubit backend.

FakeRueschlikon()

A fake 16 qubit backend.

FakeSantiago()

A fake Santiago backend.

FakeSingapore()

A fake Singapore backend.

FakeSydney()

A fake 27 qubit backend.

FakeTenerife()

A fake 5 qubit backend.

FakeTokyo()

A fake 20 qubit backend.

FakeToronto()

A fake 27 qubit backend.

FakeValencia()

A fake 5 qubit backend.

FakeVigo()

A fake 5 qubit backend.

FakeWashington()

A fake 127 qubit backend.

FakeYorktown()

A fake 5 qubit backend.

Special Fake Backends

Special fake backends are fake backends that were created for special testing purposes.

FakeQasmSimulator()

A fake simulator backend.

FakeOpenPulse2Q()

A fake 2 qubit backend for pulse test.

FakeOpenPulse3Q()

Trivial extension of the FakeOpenPulse2Q.

Fake1Q()

A fake 1Q backend.

FakeBackendV2()

A mock backend that doesn't implement run() to test compatibility with Terra internals.

FakeBackend5QV2([bidirectional])

A mock backend that doesn't implement run() to test compatibility with Terra internals.

FakeMumbaiFractionalCX()

A fake mumbai backend.

ConfigurableFakeBackend(name, n_qubits[, ...])

Configurable backend.