Skip to main content

Quantum hardware module and drivers for Qibo

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qibolab-0.2.9.tar.gz (106.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qibolab-0.2.9-py3-none-any.whl (149.2 kB view details)

Uploaded Python 3

File details

Details for the file qibolab-0.2.9.tar.gz.

File metadata

  • Download URL: qibolab-0.2.9.tar.gz
  • Upload date:
  • Size: 106.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for qibolab-0.2.9.tar.gz
Algorithm Hash digest
SHA256 67335a5be3fc6083a2c60c613cff27930ef27a9c2fa1dfbf4c9064c59bac8644
MD5 a196f962f89df4a6e271e4f17c4ede20
BLAKE2b-256 56e3c199f51442b6d8026ba862ac3485ead00d1cb30a6c224a8e0af044d4e5fa

See more details on using hashes here.

File details

Details for the file qibolab-0.2.9-py3-none-any.whl.

File metadata

  • Download URL: qibolab-0.2.9-py3-none-any.whl
  • Upload date:
  • Size: 149.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for qibolab-0.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 8d99d76614851865b640147b6e74eb2a83547c2e3e1578914570d404bb43d1c4
MD5 70d28dfe64bcdcd7a904925d665cf97d
BLAKE2b-256 f22437b71f7421e4b4ab1a11a6548e77cfde266b8b838c9798058ca3ab57b317

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page