Skip to main content

Qibolab

codecov PyPI - Version PyPI - Python Version

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

docs

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

arXiv DOI

If you use the package please refer to the documentation for citation instructions.

Metadata

Release files for qibolab 0.2.18

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

Source distribution (sdist)

Source distribution for qibolab 0.2.18
File Size Uploaded Provenance Actions
qibolab-0.2.18.tar.gz 166.0 kB Without provenance Details for qibolab-0.2.18.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qibolab 0.2.18
File Interpreter ABI Platform Actions
qibolab-0.2.18-py3-none-any.whl Python 3 none any Details for qibolab-0.2.18-py3-none-any.whl

Total release size: 379.1 kB

Release files / qibolab-0.2.18.tar.gz

Download URL qibolab-0.2.18.tar.gz
Size 166.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c22d5357c22be3dc50bd685679d2d8cb63cb608f075e315015220eb19596f2a9
BLAKE2b-256 checksum
How to use checksums
3f120a3ba312533cf3e613edace71449da5948e3ea101071d70c1f9c663a3a39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / qibolab-0.2.18-py3-none-any.whl

Download URL qibolab-0.2.18-py3-none-any.whl
Size 213.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
15d4531bee2bb4f44f29e46f5c613cdab4f00246efdc4fee4c1e5f8112c2acd4
BLAKE2b-256 checksum
How to use checksums
37e0a3d3d8383bf9c7ac38cf08d6e95b567914d6b6559a10bf7085fd32c9a907
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for qibolab 0.2.18

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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

0.2.18 This release

2 release files No 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