Qibolab
Qibolab is the dedicated Qibo backend for the automatic deployment of quantum circuits on quantum hardware.
Some of the key features of Qibolab are:
- Deploy Qibo models on quantum hardware easily.
- Create experimental drivers for custom lab setup.
- Support multiple heterogeneous platforms.
- Use calibration procedures from Qibocal.
Documentation
The qibolab backend documentation is available at https://qibo.science/qibolab/stable/.
Minimum working example
A simple example on how to connect to a platform and use it execute a pulse sequence:
from qibolab import create_platform
# Define platform and load specific runcard
platform = create_platform("my_platform")
# Create a pulse sequence based on native gates of qubit 0
natives = platform.natives.single_qubit[0]
sequence = natives.RX() | natives.MZ()
# Connects to lab instruments using the details specified in the calibration settings.
platform.connect()
# Execute a pulse sequence
results = platform.execute([sequence], nshots=1000)
# Grab the acquired shots corresponding to
# the measurement using its pulse id.
# The ``PulseSequence`` structure is list[tuple[ChannelId, Pulse]]
# thererefore we need to index it appropriately
# to get the acquisition pulse
readout_id = sequence.acquisitions[0][1].id
print(results[readout_id])
# Disconnect from the instruments
platform.disconnect()
Arbitrary pulse sequences can also be created using the pulse API:
from qibolab import (
Acquisition,
Delay,
Gaussian,
Pulse,
PulseSequence,
Readout,
Rectangular,
)
# Crete some pulses
pulse = Pulse(
amplitude=0.3,
duration=40,
relative_phase=0,
envelope=Gaussian(rel_sigma=0.2), # Gaussian shape with std = 0.2 * duration
)
delay = Delay(duration=40)
readout = Readout(
acquisition=Acquisition(duration=2000),
probe=Pulse(
amplitude=0.9,
duration=2000,
envelope=Rectangular(),
relative_phase=0,
),
)
# Add them to a PulseSequence
sequence = PulseSequence(
[
(1, pulse), # pulse plays on channel 1
(2, delay), # delay and readout plays on channel 2
(2, readout),
]
)
Here is another example on how to execute circuits:
from qibo import gates, models, set_backend
# Create circuit and add native gates
c = models.Circuit(1)
c.add(gates.GPI2(0, phi=0.2))
c.add(gates.M(0))
# Simulate the circuit using numpy
set_backend("numpy")
result = c(nshots=1024)
print(result.probabilities())
# Execute the circuit on hardware
set_backend("qibolab", platform="my_platform")
result = c(nshots=1024)
print(result.probabilities())
Citation policy
If you use the package please refer to the documentation for citation instructions.
Metadata
Release files for qibolab 0.2.17
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| qibolab-0.2.17.tar.gz | 139.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| qibolab-0.2.17-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 330.3 kB
Release files / qibolab-0.2.17.tar.gz
| Download URL | qibolab-0.2.17.tar.gz |
|---|---|
| Size | 139.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a92ba15b6c9f4e9e0857d7e53c50344b5ce962cedd1028951cef75ecaf2c874
|
|
BLAKE2b-256 checksum How to use checksums |
f543e8b3dace94136583cec303fa1c6f22a827195d669d2a0ed7bb14b1d3ec21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / qibolab-0.2.17-py3-none-any.whl
| Download URL | qibolab-0.2.17-py3-none-any.whl |
|---|---|
| Size | 190.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cc5a6acdb7ab9b2e93a1dfff448df5a9ca4844468c9c53c1529bac9c88fb2a26
|
|
BLAKE2b-256 checksum How to use checksums |
ced6b97499fa40577f8caac4fe79653f25273543315ef2ff7cdecdc331bea94e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|