API Reference:
qbraid.runtime.rigetti
Prerequisites
Before getting started, ensure you have:- A Rigetti QCS account with an active refresh token (contact Rigetti to obtain access).
- The Forest SDK installed locally — specifically the
quilccompiler. Theqvmsimulator is optional. - Python > 3.10 and < 3.13
Install the Forest SDK
Thequilc compiler is required to compile Quil programs into the native gate set of the target QPU. Install it for your platform:
- macOS / Linux: Download from qcs.rigetti.com/sdk-downloads
- Docker:
docker run --rm -p 5555:5555 rigetti/quilc -S
Installation & Setup
Install therigetti extra:
pyquil and qcs-sdk-python.
Authentication
TheRigettiProvider authenticates with Rigetti QCS using an OAuth refresh token. Set it as an environment variable (required):
Optional Environment Variables
Provider Setup
After initializing the provider, callsetup() to manage the local quilc compiler process. This ensures quilc is running and ready to compile programs:
setup() method accepts the following keyword arguments:
Getting Available Devices
List all quantum processors available through your QCS account:Submitting Jobs
TheRigettiProvider accepts programs written in Quil using the pyquil library. Programs are compiled via quilc before submission to the QPU.
Create a Program
Run a Job
Usedevice.run() to compile and submit in one step:
Batch Submission
Submit multiple programs in a single call:Retrieving Results
Check Job Status
Cancel a Job
Cancellation is best-effort. Jobs already in a terminal state (
COMPLETED,
FAILED, CANCELLED) cannot be cancelled.Runtime Options
Thedevice.run() method accepts an optional runtime_options dict to control compilation
and translation behavior:
