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 custom experimental drivers for custom lab setup.
- Support multiple heterogeneous platforms.
- Use existing calibration procedures for experimentalists.
The qibolab backend documentation is available at https://qibo.science/qibolab/stable/.
A simple example on how to connect to a platform and use it execute a pulse sequence:
from qibolab import create_platform, ExecutionParameters
from qibolab.pulses import Pulse, Delay, PulseType
# Define PulseSequence
sequence = PulseSequence()
# Add some pulses to the pulse sequence
sequence.append(
Pulse(
amplitude=0.3,
duration=4000,
frequency=200_000_000,
relative_phase=0,
shape="Gaussian(5)", # Gaussian shape with std = duration / 5
type=PulseType.DRIVE,
channel=1,
)
)
sequence.append(
Delay(
duration=4000,
channel=2,
)
)
sequence.append(
ReadoutPulse(
amplitude=0.9,
duration=2000,
frequency=20_000_000,
relative_phase=0,
shape="Rectangular",
type=PulseType.READOUT,
channel=2,
)
)
# Define platform and load specific runcard
platform = create_platform("my_platform")
# Connects to lab instruments using the details specified in the calibration settings.
platform.connect()
# Execute a pulse sequence
options = ExecutionParameters(nshots=1000)
results = platform.execute([sequence], options)
# Print the acquired shots
print(results.samples)
# Disconnect from the instruments
platform.disconnect()
Here is another example on how to execute circuits:
import qibo
from qibo import gates, models
# Create circuit and add gates
c = models.Circuit(1)
c.add(gates.H(0))
c.add(gates.RX(0, theta=0.2))
c.add(gates.X(0))
c.add(gates.M(0))
# Simulate the circuit using numpy
qibo.set_backend("numpy")
for _ in range(5):
result = c(nshots=1024)
print(result.probabilities())
# Execute the circuit on hardware
qibo.set_backend("qibolab", platform="my_platform")
for _ in range(5):
result = c(nshots=1024)
print(result.probabilities())
If you use the package please refer to the documentation for citation instructions.