Skip to main content

Alice & Bob Qiskit provider

This project contains a provider that allows access to Alice & Bob QPUs and emulators using the Qiskit framework.

Full documentation is available here and sample notebooks using the provider are available here.

Installation

You can install the provider using pip:

pip install qiskit-alice-bob-provider

pip will handle installing all the python dependencies automatically and you will always install the latest (and well-tested) version.

The provider requires Python 3.10 to 3.13 and Qiskit 2.x (2.5 or a later 2.x release).

Migration from Qiskit 1.x

If your code was written for Qiskit 1.x, update it as follows:

  • Replace c_if with if_test:

    # Qiskit 1.x
    circ.x(0).c_if(0, 1)
    # Qiskit 2.x
    with circ.if_test((circ.clbits[0], 1)):
        circ.x(0)
    
  • Read the result headers as dictionaries: write result.results[0].header['name'], not result.results[0].header.name.

  • qiskit.execute, BackendV1 and ProviderV1 do not exist. Call transpile(circ, backend), then backend.run(...). The provider backends are BackendV2 instances.

  • Give the backend to transpile. transpile(circ, basis_gates=[...]) does not accept the provider instructions (initialize, measure_x), and transpile has no instruction_durations argument.

  • Bind the parameters with assign_parameters before you call transpile. The durations of delay and rz and the Solovay-Kitaev synthesis need the parameter values, so an unbound parameter causes an error. For the same reason, do not give parameter values to BackendSamplerV2 in a PUB.

  • QuantumCircuit.duration still works, but Qiskit marks it as deprecated. Its replacement, QuantumCircuit.estimate_duration(backend.target), does not work with the provider backends yet.

  • On EMU:40Q:PHYSICAL_CATS, prepare each qubit with its own initialize. A multi-qubit initialize, for example circ.initialize('0000+'), stops the VF2 layout pass, and the transpiler can then add SWAP gates.

Remote execution on Alice & Bob QPUs: use your API key

To obtain an API key, get a Felis Cloud subscription on the Google Cloud Marketplace or contact Alice & Bob.

You can initialize the Alice & Bob remote provider using your API key locally with:

from qiskit_alice_bob_provider import AliceBobRemoteProvider
ab = AliceBobRemoteProvider('MY_API_KEY')

Where MY_API_KEY is your API key to the Alice & Bob API.

print(ab.backends())
backend = ab.get_backend('EMU:1Q:LESCANNE_2020')

The backend can then be used like a regular Qiskit backend:

from qiskit import QuantumCircuit

c = QuantumCircuit(1, 2)
c.initialize('+', 0)
c.measure_x(0, 0)
c.measure(0, 1)
job = backend.run(c)
res = job.result()
print(res.get_counts())

On QPU:18Q:HELIUM, a reset prepares the qubit in the state 0, like initialize('0'). A reset in the middle of a circuit is at your own risk. An X or Y preparation or measurement becomes a Z one plus one Q gate. After an X or Y measurement, the qubit stays in the Z basis, because a measurement on Helium destroys the qubit.

Execution through Qaptiva: use a myQLM server

A Qaptiva node can have no access to the Alice & Bob API. On such a node, the provider sends its jobs through an anb-myqlm-server, which runs them on the API. Install the qaptiva extra, which adds myQLM:

pip install "qiskit-alice-bob-provider[qaptiva]"

Connect the provider to the server with a myQLM RemoteQPU. The backends take the same options as the remote backends:

from qat.qpus import RemoteQPU
from qiskit import transpile
from qiskit_alice_bob_provider.qaptiva import AliceBobQaptivaProvider

ab = AliceBobQaptivaProvider(RemoteQPU(port=1235, ip='10.0.0.1'))
backend = ab.get_backend('EMU:1Q:LESCANNE_2020', average_nb_photons=6.0)
job = backend.run(transpile(c, backend), shots=500)
print(job.result().get_counts())

run waits until the server returns the counts. The memory option is not available through Qaptiva. The provider refuses a server with another protocol version: use the anb-myqlm-server release that matches the provider.

Local emulation of cat qubit processors

This project contains multiple emulators of multi cat qubit processors.

from qiskit_alice_bob_provider import AliceBobLocalProvider
from qiskit import QuantumCircuit, transpile

provider = AliceBobLocalProvider()
print(provider.backends())
# EMU:6Q:PHYSICAL_CATS, EMU:40Q:PHYSICAL_CATS, EMU:40Q:LOGICAL_TARGET,
# EMU:40Q:LOGICAL_NOISELESS, EMU:15Q:LOGICAL_EARLY, EMU:1Q:LESCANNE_2020

The EMU:nQ:PHYSICAL_CATS backends are theoretical models of quantum processors made up of physical cat qubits. They can be used to study the properties of error correction codes implemented with physical cat qubits, for different hardware performance levels (see the parameters of class PhysicalCatProcessor).

The EMU:nQ:LOGICAL_* backends model logical qubits made of physical cat qubits, assembled with a repetition code that corrects phase flips. They expose the discrete Clifford+T gate set (h, s, sdg, t, tdg, x, z, cx, ccx), so the transpiler approximates any other rotation with the Solovay-Kitaev algorithm. The default recursion degree is 3, and the default depth of the basic approximations is 5. A higher degree gives a longer circuit. It gives a more accurate approximation only if the depth is also high enough. To change them:

transpile(
    circ,
    backend,
    unitary_synthesis_plugin_config={'recursion_degree': 3, 'depth': 10},
)

Qiskit 2.5 does not accept a basic_approximations value in this configuration.

The EMU:1Q:LESCANNE_2020 backend is an interpolated model simulating the processor used in the seminal paper by Raphaël Lescanne in 2020. This interpolated model is configured to act as a digital twin of the cat qubit used in this paper. It does not represent the current performance of Alice & Bob's cat qubits.

The example below schedules and simulates a Bell state preparation circuit on a EMU:6Q:PHYSICAL_CATS processor, for different values of parameters average_nb_photons and kappa_2.

from qiskit_alice_bob_provider import AliceBobLocalProvider
from qiskit import QuantumCircuit, transpile

provider = AliceBobLocalProvider()

circ = QuantumCircuit(2, 2)
circ.initialize('0+')
circ.cx(0, 1)
circ.measure(0, 0)
circ.measure(1, 1)

# Default 6-qubit QPU with the ratio of memory dissipation rates set to
# k1/k2=1e-5 and cat size, average_nb_photons, set to 16.
backend = provider.get_backend('EMU:6Q:PHYSICAL_CATS')

print(transpile(circ, backend).draw())
# *Displays a timed and scheduled circuit*

print(backend.run(circ, shots=100000).result().get_counts())
# {'00': 49910, '11': 50090}

# Changing the cat size from 16 (default) to 4 and k1/k2 to 1e-2.
backend = provider.get_backend(
    'EMU:6Q:PHYSICAL_CATS', average_nb_photons=4, kappa_2=1e4
)
print(backend.run(circ, shots=100000).result().get_counts())
# {'01': 1788, '10': 1757, '00': 48122, '11': 48333}

Setting Up Development Environment (for contributors only)

You need uv. Then run:

uv sync                        # create .venv/ with dev dependencies
uv run pre-commit install      # install the git hooks
uv run pytest                  # run the tests
uv run ruff format             # format the code
uv run ruff check              # lint the code
uv run mypy .                  # check the types

Commit messages follow Conventional Commits: release version numbers are computed from them.

Metadata

Release files for qiskit-alice-bob-provider 3.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qiskit-alice-bob-provider 3.2.0
File Size Uploaded Provenance Actions
qiskit_alice_bob_provider-3.2.0.tar.gz 346.4 kB With provenance Details for qiskit_alice_bob_provider-3.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qiskit-alice-bob-provider 3.2.0
File Interpreter ABI Platform Actions
qiskit_alice_bob_provider-3.2.0-py3-none-any.whl Python 3 none any Details for qiskit_alice_bob_provider-3.2.0-py3-none-any.whl

Total release size: 470.0 kB

Release files / qiskit_alice_bob_provider-3.2.0.tar.gz

Download URL qiskit_alice_bob_provider-3.2.0.tar.gz
Size 346.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8d81a7e7994ee1e2b7380e756ea70cc8a47baa91a6aa0619c59c1c57f9732b6a
BLAKE2b-256 checksum
How to use checksums
f463a184255570f6bc088b6094f47cfbf22db199a51cfbd80a9857b1a8dfb5e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / qiskit_alice_bob_provider-3.2.0-py3-none-any.whl

Download URL qiskit_alice_bob_provider-3.2.0-py3-none-any.whl
Size 123.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e8882f4cfd0dd93c628ce083dffb5d1452a4179508c5e530992b76f6e2beccf
BLAKE2b-256 checksum
How to use checksums
717720f1f61b032abd814b9b8cb9294fe8bc06db0cfda9c2ba70ad6f49fc24eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Security for qiskit-alice-bob-provider 3.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for qiskit_alice_bob_provider-3.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

3.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page