Fake Provider
qiskit_ibm_runtime.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 simulations of the system.
Example Usage
Here is an example of using a fake backend for transpilation and simulation.
from qiskit import QuantumCircuit
from qiskit import transpile
from qiskit.visualization import plot_histogram
from qiskit_ibm_runtime import SamplerV2
from qiskit_ibm_runtime.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('mpl', style="iqp")
# Transpile the ideal circuit to a circuit that can be directly executed by the backend
transpiled_circuit = transpile(circuit, backend)
transpiled_circuit.draw('mpl', style="iqp")
# Run the transpiled circuit using the simulated fake backend
sampler = SamplerV2(backend)
job = sampler.run([transpiled_circuit])
pub_result = job.result()[0]
counts = pub_result.data.meas.get_counts()
plot_histogram(counts)
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 should use the qiskit_aer
library. After installation, you can follow the steps below to generate a simulator that mimics a real quantum system with the latest calibration results.
from qiskit_ibm_runtime import QiskitRuntimeService
from qiskit_aer import AerSimulator
# get a real backend from the runtime service
service = QiskitRuntimeService()
backend = service.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. |
Fake Backends
Fake V2 Backends
Fake V2 backends are fake backends with IBM Quantum systems snapshots implemented with BackendV2
interface. They are all subclasses of FakeBackendV2
.
FakeAlgiers () | A fake 27 qubit backend. |
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. |
FakeBrisbane () | A fake 127 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. |
FakeCusco () | A fake 127 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. |
FakeKawasaki () | A fake 127 qubit backend. |
FakeKolkataV2 () | A fake 27 qubit backend. |
FakeKyiv () | A fake 127 qubit backend. |
FakeKyoto () | A fake 127 qubit backend. |
FakeLagosV2 () | A fake 7 qubit backend. |
FakeLimaV2 () | A fake 5 qubit backend. |
FakeFractionalBackend () | A fake 5 qubit backend with dynamic and fractional feature modeled based on FakeLima. |
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. |
FakeOsaka () | A fake 127 qubit backend. |
FakeOslo () | A fake 7 qubit backend. |
FakeOurenseV2 () | A fake 5 qubit backend. |
FakeParisV2 () | A fake Paris backend. |
FakePeekskill () | A fake 27 qubit backend. |
FakePerth () | A fake 7 qubit backend. |
FakePrague () | A fake 33 qubit backend. |
FakePoughkeepsieV2 () | A fake Poughkeepsie backend. |
FakeQuebec () | A fake 127 qubit backend. |
FakeQuitoV2 () | A fake 5 qubit backend. |
FakeRochesterV2 () | A fake Rochester backend. |
FakeRomeV2 () | A fake 5 qubit backend. |
FakeSantiagoV2 () | A fake Santiago backend. |
FakeSherbrooke () | A fake 127 qubit backend. |
FakeSingaporeV2 () | A fake Singapore backend. |
FakeSydneyV2 () | A fake 27 qubit backend. |
FakeTorino () | A fake 133 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. |