qiskit-maestro

Run your Qiskit code on the Maestro quantum simulator, on your machine or in the Qoro cloud, by changing one import.

  • Drop-in for Aer: a BackendV2, a SamplerV2 and an EstimatorV2, with Aer’s option names, noise models and save instructions.

  • Beyond statevector: matrix product state (MPS) for hundreds of qubits, plus stabilizer, density matrix, tensor network and Pauli propagation.

  • CPU, GPU or cloud: run locally, on your own GPU, or on Qoro’s GPUs with no hardware of your own.

Install

pip install qiskit-maestro            # local simulation, Python 3.10+
pip install "qiskit-maestro[cloud]"   # adds the Qoro cloud, Python 3.11+

Quick start

from qiskit import QuantumCircuit, transpile
from qiskit_maestro import MaestroBackend   # was: from qiskit_aer import AerSimulator

qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
qc.measure_all()

backend = MaestroBackend()                  # was: AerSimulator()
counts = backend.run(transpile(qc, backend), shots=1000).result().get_counts()

The Sampler and Estimator swap the same way:

You use

Switch to

AerSimulator

MaestroBackend

StatevectorSampler, Aer’s SamplerV2

MaestroSampler

StatevectorEstimator, Aer’s EstimatorV2

MaestroEstimator

Results come back in Qiskit’s usual form and bit order.

Run on the Qoro cloud

  1. Sign up at dash.qoroquantum.net to get an API key. New accounts get 1,000 free tokens, with no credit card.

  2. Install the cloud extra and set your key:

    pip install "qiskit-maestro[cloud]"
    export QORO_API_KEY=...   # or put it in a .env file
    
  3. Pass service= to the backend, Sampler or Estimator. Nothing else changes:

    from divi.backends import QoroService
    from qiskit_maestro import MaestroBackend
    
    backend = MaestroBackend(service=QoroService(), method="mps")
    counts = backend.run(transpile(qc, backend), shots=1000).result().get_counts()
    

Add device="GPU" to run on Qoro’s GPU cluster. examples/qoro_cloud.py runs all three on the cloud. A few features, such as noise models and classical control, run locally only for now: see the guide.

Pick a simulation method

backend = MaestroBackend(method="mps", max_bond_dimension=64)

method

Use it for

"statevector" (default)

exact results; memory doubles with each qubit

"mps"

many qubits with limited entanglement

"stabilizer"

Clifford circuits, any size

"density_matrix"

small noisy circuits, exact

"pauli_propagation"

expectation values on wide circuits, by evolving the observable

"automatic"

let Maestro pick, as Aer does

Pauli propagation runs on MaestroEstimator. For deep circuits, give it a threshold below which Pauli terms are dropped:

estimator = MaestroEstimator(
    method="pauli_propagation", maestro_options={"pp_coefficient_threshold": 1e-4}
)

Pass an Aer NoiseModel as noise_model=, and device="GPU" for your own GPU (get GPU access). The guide lists every method and option.

Next steps

  • Guide: how each interface maps over, every option, and each feature, one topic per page.

  • Examples: runnable scripts, from a Bell state to Pauli propagation on 115 qubits.

  • API reference: every class and method.

qiskit-maestro is open source under GPL-3.0-or-later, at github.com/QoroQuantum/qiskit-maestro. For Maestro itself, see the Maestro docs.