Overview
A platform-agnostic quantum runtime framework.
The qBraid-SDK is a platform-agnostic quantum runtime framework designed for both quantum software and hardware providers. This Python-based tool streamlines the full lifecycle management of quantum jobs—from defining program specifications to job submission, and through to the post-processing and visualization of results.
Distinguishing itself through a streamlined and
highly-configurable approach to cross-platform integration, the qBraid-SDK does not assume a fixed target software framework.
Instead, it allows providers to dynamically register any desired run input program type as the target, depending on their specific needs.
These program types are interconnected via a graph-based transpiler, where each program type is represented as a node and supported
conversions as edges. The breadth, depth, and connectivity of this ConversionGraph
can be customized by the provider.
The framework also facilitates the insertion of additional program validations, circuit transformations, and transpiler/compiler steps
into its modular pipeline through a comprehensive TargetProfile
. This profile encapsulates both device properties (such as number of
qubits, maximum shots, native gate set) and the software requirements (ProgramSpec
) needed to submit a job, vastly reducing the overhead
and redundancy typically associated with cross-platform integrations in quantum computing.
Key Features
1. Quantum Program Integration
Offers native support for 10 major quantum programming libraries including 20+ inter-library conversions with the ability to dynamically register new program types and conversions on the fly. This enables flexible program submissions to cater to the unique capabilities and constraints of your preferred framework, facilitated by a unique conversion map that automatically adapts quantum programs during runtime according to the given specifications.
2. Modular Design
qbraid.programs
: Extracts and manages metadata from supported quantum program types, with the flexibility to introduce new types.qbraid.transpiler
: Bridges different quantum programming IRs through native and customizable circuit conversions.qbraid.passes
: Ensures quantum programs conform to hardware specifications through essential runtime transformations.qbraid.runtime
: Defines essential abstractions for providers, devices, jobs, and results, integrated through a coherent runtime profile.qbraid.visualization
: Provides tools for visualizing quantum circuits and experimental data, enhancing data interpretation.
3. Extensibility and Customization
The framework encourages community contributions and extensions, supporting an evolving ecosystem of program types and conversions, adaptable to specific provider needs. By providing a comprehensive runtime solution, the qBraid-SDK offers significant advantages to both hardware and software providers:
- Reduces Overhead: Minimizes the effort required to develop client-side applications for securely submitting and managing quantum experiments remotely.
- Enhances Integration: Facilitates seamless integration and interoperability of quantum software tools across all layers of the stack.
- Broad Compatibility: Supports a diverse range of API complexities, catering to both established players like IBM and AWS as well as emerging providers.
Installation & Setup
For the best experience, install the qBraid SDK on lab.qbraid.com. Login (or create an account) on account.qbraid.com and then follow the steps to install an environment.
Using the SDK on qBraid Lab means direct, pre-configured access to QPUs from IonQ, Oxford Quantum Circuits, QuEra, Rigetti,
and IQM, as well as on-demand simulators from qBraid and AWS. Use access key EHNU6626
for
1000 free credits to get started. See qBraid Quantum Jobs for more.
Local Installation
The qBraid-SDK, and all of its dependencies, can be installed using pip:
You can also install from source by cloning the GitHub repository and running a pip install command in the root directory:
To use qBraid runtime locally, you must also install the necessary extras and configure your account credentials according to the device(s) that you are targeting. Follow the linked, provider-specific, instructions for the QbraidProvider, BraketProvider, QiskitRuntimeProvider, IonQProvider, and OQCProvider, as applicable.
Quickstart
Transpiler
Construct a quantum program of any supported program type:
Below, QPROGRAM_REGISTRY
maps shorthand identifiers for supported quantum programs, each corresponding to a type in the typed
QPROGRAM
Union. For example, ‘qiskit’ maps to qiskit.QuantumCircuit
in QPROGRAM
. Notably, ‘qasm2’ and ‘qasm3’ both represent
raw OpenQASM strings. This arrangement simplifies targeting and transpiling between different quantum programming frameworks.
Pass any registered quantum program along with a target package from
QPROGRAM_REGISTRY
to “transpile” your circuit to a new program type:
Conversions
Behind the scenes, the qBraid-SDK uses rustworkx to create a directional graph that maps all possible conversions between supported program types:
You can use the native conversions supported by qBraid, or define your own custom nodes and/or edges. For example:
QbraidProvider
Run experiments using on-demand simulators provided by qBraid using the qbraid.runtime.QbraidProvider
. You can get a
Python list of device objects using:
Or, instantiate a known device by ID via the QbraidProvider.get_device()
method,
and submit quantum jobs from any supported program type: