Skip to main content
API Reference: qbraid.runtime.pasqal

Overview

The qbraid.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 the pasqal extra from PyPI using pip:
This installs the pasqal-cloud client and pulser-core alongside qBraid.
Note: The qBraid-SDK requires Python 3.10 or greater. You can check your Python version by running python --version from the command line.
We encourage doing this inside an environment management system, such as virtualenv or conda. Alternatively, you can bypass this step by using a pre-configured qBraid Lab environment. See qBraid-SDK installation and setup for more.

Set up your environment

By default, qBraid will look in your local environment for variables named PASQAL_USERNAME, PASQAL_PASSWORD, and PASQAL_PROJECT_ID:
Alternatively, you can pass your credentials explicitly when creating the provider object:
If you provide a 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 the PasqalProvider to list the available Pasqal devices:
Running this script should print something like this:
If this works correctly, then your qBraid-SDK installation is correct and your Pasqal credentials are valid! Device IDs starting with 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:
Remember to end your sequence with a measure() call. Measurement in the "ground-rydberg" basis maps each atom to a classical bit: 1 if the atom was excited to the Rydberg state, 0 otherwise.

Submit a sequence to an emulator

Let’s run the sequence on EMU_FREE with 100 shots:
Each submission creates a Pasqal Cloud batch, and 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:
This returns a dictionary of bitstring counts, for example:
Since this is an analog experiment, the result data is a qBraid 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 to device.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:
Build your sequence against a Pulser device specification that matches the target QPU’s constraints (register geometry, channels, pulse limits), and test it on an emulator first—EMU_FRESNEL mirrors the FRESNEL QPU’s constraints. QPU access is subject to your Pasqal Cloud project’s permissions and quota.
QPU jobs may wait in the queue, so record 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:
You can then visualize the measurement counts using plot_histogram, or display the probability distribution with plot_distribution:
The “counts” input may be either a single dictionary or a list of dictionaries for multi-sequence batches. See Plot Experimental Results for more.

Additional resources

Great work! You successfully ran your first analog quantum program - what next? Explore more resources for using qBraid: And for going deeper with Pasqal and Pulser: