Provider for running Qiskit circuits on Alice & Bob QPUs and simulators
Project description
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.
[!WARNING] Transpilation of gates CRY, RCCX and RCCCX does not work on macOS currently.
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())
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: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: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())
# {'11': 49823, '00': 50177}
# 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': 557, '11': 49422, '10': 596, '00': 49425}
Setting Up Development Environment (for contributors only)
To ensure code consistency and enforce commit message conventions, we use pre-commit (Python-based) and commitlint (Node.js-based). Follow these steps to set up your development environment.
Prerequisites
You need the following installed on your system:
- Python 3.12
- Node.js (latest LTS version recommended, required for
commitlint) - pnpm (used to install
commitlintdependencies)
Installation Steps
-
Install Python dependencies
Run the following command to set up the Python environment and install dependencies:make installThis will:
- Create a Python virtual environment
- Install all required dependencies, including
pre-commit
-
Install commitlint dependencies
Run the following command to install the necessary Node.js packages:pnpm install -
Install Git hooks
Run the following command to install all required Git hooks:make precommit-hooks
Happy coding! 🚀
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qiskit_alice_bob_provider-1.2.0.tar.gz.
File metadata
- Download URL: qiskit_alice_bob_provider-1.2.0.tar.gz
- Upload date:
- Size: 85.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8e0453d6b74d6e6f7ade37b285ea0f93f6c88d04ba6a2f225ac567fb07e9a22
|
|
| MD5 |
b174a27dbc097e450939fd8947e1a6d3
|
|
| BLAKE2b-256 |
ca6c054c3de8cc47063ecb3324f9c586021ff29d45b6e9712b251e6393bec559
|
Provenance
The following attestation bundles were made for qiskit_alice_bob_provider-1.2.0.tar.gz:
Publisher:
main.yml on Alice-Bob-SW/qiskit-alice-bob-provider
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qiskit_alice_bob_provider-1.2.0.tar.gz -
Subject digest:
c8e0453d6b74d6e6f7ade37b285ea0f93f6c88d04ba6a2f225ac567fb07e9a22 - Sigstore transparency entry: 188876167
- Sigstore integration time:
-
Permalink:
Alice-Bob-SW/qiskit-alice-bob-provider@4651c1837702d496edc11dfedaf3062abc5dd9db -
Branch / Tag:
refs/heads/release - Owner: https://github.com/Alice-Bob-SW
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@4651c1837702d496edc11dfedaf3062abc5dd9db -
Trigger Event:
push
-
Statement type:
File details
Details for the file qiskit_alice_bob_provider-1.2.0-py3-none-any.whl.
File metadata
- Download URL: qiskit_alice_bob_provider-1.2.0-py3-none-any.whl
- Upload date:
- Size: 109.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4aa055fd73d5a5199d1f92fba470a1f791c5e209ebccb96d794f3aa65b204fcf
|
|
| MD5 |
3fd9914b98b034b1a6badff2e4a1b21e
|
|
| BLAKE2b-256 |
3d0d0c68bfa543d1c8eb9ebea87b3887fea67b4574f126113cb8d1ff5dd09b22
|
Provenance
The following attestation bundles were made for qiskit_alice_bob_provider-1.2.0-py3-none-any.whl:
Publisher:
main.yml on Alice-Bob-SW/qiskit-alice-bob-provider
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qiskit_alice_bob_provider-1.2.0-py3-none-any.whl -
Subject digest:
4aa055fd73d5a5199d1f92fba470a1f791c5e209ebccb96d794f3aa65b204fcf - Sigstore transparency entry: 188876169
- Sigstore integration time:
-
Permalink:
Alice-Bob-SW/qiskit-alice-bob-provider@4651c1837702d496edc11dfedaf3062abc5dd9db -
Branch / Tag:
refs/heads/release - Owner: https://github.com/Alice-Bob-SW
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@4651c1837702d496edc11dfedaf3062abc5dd9db -
Trigger Event:
push
-
Statement type: