API Reference:
qbraid.runtime.native
QbraidProvider — from single
one-off submissions, to batching multiple circuits in a single job, to grouped workflows
that span multiple devices and providers.
For provider setup and authentication, see QbraidProvider - Usage.
Single Job Submission
Submit a quantum program to any qBraid-supported device and retrieve results:async_result() to await job completion without blocking the event loop:
Group Jobs
Why Group?
When running related quantum experiments — parameter sweeps, algorithm comparisons, cross-device benchmarks — you often end up with many independent jobs that are logically part of the same workflow. Without grouping, these jobs are scattered across your job history with no way to track or retrieve them together.GroupJobSession solves this by grouping any number of jobs under a single group ID.
Key benefits:
- Cross-device, cross-provider: submit jobs to different backends (AWS SV1, IonQ, qBraid simulators) within the same group
- Unified tracking: all jobs share a group QRN visible in the qBraid dashboard
- Aggregated results: retrieve all results at once with
group.results() - Lifecycle management: auto-close with TTL, cancellation, completion callbacks
Context Manager
The simplest way to use group jobs. All jobs submitted inside thewith block are
automatically tagged with the group ID. The group closes when the block exits.
Manual Open / Close
For interactive workflows like Jupyter notebooks, you can open and close the group manually across multiple cells.Auto-Close with TTL
Set a time-to-live so the group automatically closes after a duration, even if you forget to callclose() or your kernel crashes. Defaults to 1 hour (3600s) if not specified.
Retrieving Results
After closing a group, retrieve all job results at once.group.results() blocks until
every job reaches a terminal state (completed, failed, or cancelled).
Completion Callback
Register a callback that fires automatically when all jobs complete. The callback runs at context exit, after the group is closed.Cancellation
Cancel a group and all its non-terminal jobs:Batch Jobs
Submit multiple circuits as a single job to a device that supports batched execution. Unlike group jobs, which coordinate independent jobs across devices, batch jobs send all circuits in one request and return a unified result.Submitting a Batch
Pass a list of programs withas_batch=True to submit them as a single job:
QbraidJob, not a list. All circuits share the same
job ID, device, and shot count.
as_batch=True requires a device that supports batch execution. You can check
this via the device profile’s batch_job_support flag. Passing
as_batch=True to an unsupported device raises a ValueError.Retrieving Batch Results
Callingjob.result() on a batch job returns a BatchResult object:
BatchResult provides two ways to access measurement data:
Aggregate access — indexed by circuit position:
Result is a full object with its own status and metadata:
