API Reference:
qbraid.runtime.pasqal
Overview
Theqbraid.runtime.PasqalProvider provides support for Pasqal’s neutral-atom quantum computers and emulators via
Pasqal Cloud Services. Unlike gate-model providers, Pasqal devices run analog
quantum programs: pulse sequences built with Pulser, Pasqal’s open-source framework
for programming neutral-atom arrays. You write a pulser.Sequence, and qBraid serializes it, submits it as a Pasqal
Cloud batch, and returns measurement counts—all from within the
qBraid Runtime framework.
Getting started
Before you begin, you’ll need a Pasqal Cloud account and a project ID. Jobs (batches) are billed and organized per project—you can find your project ID in the Pasqal Cloud portal.Set up the qBraid-SDK
Install qBraid with thepasqal extra from PyPI using pip:
Note: The qBraid-SDK requires Python 3.10 or greater. You can check your
Python version by running
python --version from the command line.Set up your environment
By default, qBraid will look in your local environment for variables namedPASQAL_USERNAME, PASQAL_PASSWORD,
and PASQAL_PROJECT_ID:
username but leave password unset, pasqal-cloud will prompt for it interactively. For
machine-to-machine authentication with a pre-issued token, you can pass a custom pasqal_cloud.TokenProvider
via the token_provider argument instead.
In the examples below, we show PasqalProvider() initialized with no arguments and assume that qBraid will
automatically find your credentials in the environment.
List available devices
Use thePasqalProvider to list the available Pasqal devices:
EMU_ are emulators; the rest are QPUs:
You can confirm whether a device is a simulator, and inspect its runtime profile, directly from the device object:
Build a Pulser sequence
Pasqal devices execute Pulser sequences rather than gate-model circuits. A sequence specifies a register (the positions of the atoms, in µm) and a series of pulses applied through the device’s channels. For an introduction, see the Pulser documentation. Here, we place two atoms 10 µm apart and drive them with a single constant global pulse:Submit a sequence to an emulator
Let’s run the sequence onEMU_FREE with 100 shots:
job.id is the batch ID—you can use it to look the job up
later, both through qBraid and in the Pasqal Cloud portal. Calling job.result() blocks until the batch reaches
a terminal state, then returns the measurement counts:
AnalogResultData instance, keyed by
measurement bitstrings in register order (q0, q1, …).
Submit a multi-sequence batch
You can submit several sequences in a single batch by passing a list todevice.run(). Each sequence becomes its
own job within the Pasqal Cloud batch, and the results are returned as a list of counts dictionaries in
submission order. Given two sequences sequence_a and sequence_b, built as in the example above:
Submit a sequence to a QPU
Submitting to a QPU follows the exact same pattern—just use a QPU device ID:job.id and retrieve the job later rather than blocking on
job.result().
Manage jobs
Retrieve a job
You can retrieve a previously submitted job from its batch ID:Cancel a job
You can cancel a job (batch) while it’s waiting in the queue:Visualize results
To plot the results of a job, first, install the qBraid visualization extra:plot_histogram, or display the probability distribution
with plot_distribution:
