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

Overview

The qbraid.runtime.OriginProvider provides support for OriginQ’s quantum computing systems through the OriginQ QCloud platform. This means you can write quantum programs using PyQPanda3, and run them on OriginQ’s cloud-based simulators and quantum processors, all from within the qBraid Runtime framework.

Getting started

Before you begin, make sure you have:
  1. An OriginQ QCloud account and API key.
  2. Python >= 3.10

Set up the qBraid-SDK

Install qBraid with the origin extra from PyPI using pip:
This installs the required dependency: pyqpanda3.
Note: The qBraid-SDK requires Python 3.10 or greater. You can check your Python version by running python --version from the command line.

Authentication

By default, qBraid will look for an environment variable named ORIGIN_API_KEY. Set it from your command line:
Alternatively, you can pass your API key directly when creating the provider:
In the examples below, we initialize OriginProvider() with no arguments and assume that qBraid will automatically find your API key from the environment.

List available devices

Use the OriginProvider to list all devices to which you have access:
You can also filter to show only hardware (QPU) devices:
Get a specific device by its ID:

Available simulators

OriginQ provides several cloud-based quantum simulators:

Submitting jobs

The OriginProvider accepts quantum programs as PyQPanda3 QProg objects.

Create a program

Run a job

Use device.run() to submit a program:

Batch submission

Submit multiple programs in a single call:
For simulator backends, batch inputs are submitted as individual jobs. For QPU backends, batch inputs are submitted as a single job using the native batch API.

Retrieving results

Depending on the backend, results may be returned as probabilities, measurement counts, or both. Use result.data.get_probabilities() to retrieve probability distributions and result.data.measurement_counts for shot-based counts.

Check job status

Job cancellation is not supported by the OriginQ provider. Calling job.cancel() will raise an error.

Full example

A complete end-to-end workflow targeting the full amplitude simulator: