Skip to main content

Qrisp-Open Quantum Plugin

Beta. This plugin is in beta; its API and defaults may still change. Feedback is welcome in the Quantum Rings community.

A backend for the Qrisp quantum programming framework that submits circuits to the Open Quantum platform. Write high-level Qrisp programs and run them on real quantum hardware.

How it works

Qrisp already depends on Qiskit and can convert any circuit to a Qiskit circuit (QuantumCircuit.to_qiskit()). This backend uses that bridge to reuse the Open Quantum Qiskit plugin:

  • OpenQuantumService handles authentication and backend discovery.
  • The capability-aware OpenQuantumBackend (a Qiskit BackendV2) validates each circuit against the target device (gate set, coupling map, shot and qubit limits).
  • export_circuit_to_qasm serialises to OpenQASM.

Submission runs through the framework-agnostic SchedulerClient in the core SDK. No separate QASM serializer or auth code is reimplemented here.

Installation

# Plugin (and core SDK + Qiskit plugin)
pip install openquantum-sdk-qrisp

# or via extras:
pip install "openquantum-sdk[qrisp]"

This pulls in qrisp, openquantum-sdk, and openquantum-sdk-qiskit.

Quick Start

from qrisp import QuantumVariable, h, cx
from qrisp_openquantum import OpenQuantumBackend

oq = OpenQuantumBackend(
    backend="ionq:aria-1",
    shots=1024,
    client_id="your_client_id",
    client_secret="your_client_secret",
)

qv = QuantumVariable(2)
h(qv[0])
cx(qv[0], qv[1])

print(qv.get_measurement(backend=oq, shots=1024))
# {'00': 0.5, '11': 0.5}

get_measurement returns Qrisp's decoded outcomes as probabilities (its own normalization, applied for every backend). To get integer shot counts, run a raw QuantumCircuit directly:

from qrisp import QuantumCircuit

qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
qc.measure([0, 1])

counts = qc.run(backend=oq, shots=1024)
print(counts)
# e.g. {'00': 518, '11': 506}

Authentication

Resolved in this order:

  1. Pre-built service — pass service=OpenQuantumService(...) for full control (saved accounts, custom URLs, keyring).
  2. Bearer token — pass token= or set OPENQUANTUM_TOKEN.
  3. Client credentials — pass client_id= + client_secret= or set OPENQUANTUM_CLIENT_ID + OPENQUANTUM_CLIENT_SECRET.
Parameter Environment Variable Description
token OPENQUANTUM_TOKEN Bearer token
client_id OPENQUANTUM_CLIENT_ID OAuth2 client ID
client_secret OPENQUANTUM_CLIENT_SECRET OAuth2 client secret
OPENQUANTUM_SDK_KEY Path to an SDK-key JSON file ({client_id, client_secret})
organization_id OPENQUANTUM_ORGANIZATION_ID Organization UUID (optional if single org)
scheduler_url OPENQUANTUM_SCHEDULER_URL Scheduler API base, when the argument is omitted
management_url OPENQUANTUM_MANAGEMENT_URL Management API base, when the argument is omitted
keycloak_base OPENQUANTUM_KEYCLOAK_BASE Keycloak base, when the argument is omitted
realm OPENQUANTUM_KEYCLOAK_REALM Keycloak realm, when the argument is omitted

OpenQuantumService.from_env() raises AuthenticationError when no credential resolves. Circuits are serialized with the public export_circuit_to_qasm helper from openquantum_sdk_qiskit. The older OPENQUANTUM_*_BASE URL names are not read here; those remain an MCP-only fallback.

Configuration

Parameter Default Description
backend required Backend class ID or short_code (e.g. "ionq:aria-1")
shots 1024 Default shots when a Qrisp call omits them
job_subcategory_id "oth:oth" Workload subcategory (set the most specific match)
execution_plan "auto" "auto", "public", "private", an enum, or a plan UUID. "auto" picks the cheapest plan
queue_priority "auto" "auto", "standard", "priority", "instant", an enum, or a priority UUID. "auto" picks the cheapest priority
export_format "qasm3" "qasm2" or "qasm3"
configuration_data {} Backend-specific config passthrough (e.g. {"engine": "SCARLET_CPU", "precision": "DOUBLE", "performance": "AUTOMATIC"} for qr:sim)
reverse_bits False Reverse returned bitstring order if a backend needs it
verbose False Print submission progress and credit cost to stdout
job_timeout_seconds 86400 Max wait for job completion (1 day)

Backend-specific configuration

qr:sim requires an engine. It defaults to Scarlet, double precision, and automatic performance. The engine is SCARLET_CPU.

oq = OpenQuantumBackend(
    backend="qr:sim",
    shots=1024,
    configuration_data={
        "engine": "SCARLET_CPU",
        "precision": "DOUBLE",
        "performance": "AUTOMATIC",
    },
)

Bit ordering

Qrisp reads the leftmost character of a bitstring as the most-significant bit. The platform's counts are passed through unchanged by default. If a specific backend returns counts in the opposite order, construct the backend with reverse_bits=True.

License

Apache License 2.0

Metadata

Release files for openquantum-sdk-qrisp 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openquantum-sdk-qrisp 0.6.0
File Size Uploaded Provenance Actions
openquantum_sdk_qrisp-0.6.0.tar.gz 12.7 kB Without provenance Details for openquantum_sdk_qrisp-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openquantum-sdk-qrisp 0.6.0
File Interpreter ABI Platform Actions
openquantum_sdk_qrisp-0.6.0-py3-none-any.whl Python 3 none any Details for openquantum_sdk_qrisp-0.6.0-py3-none-any.whl

Total release size: 22.3 kB

Release files / openquantum_sdk_qrisp-0.6.0.tar.gz

Download URL openquantum_sdk_qrisp-0.6.0.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
52479ad5e9e026fe8090bf5811055fa52c9e16b0662386e54ed4f01d1b2d6842
BLAKE2b-256 checksum
How to use checksums
165ad4c39d8a077734d347502f56b6e127d47edb4a5af9a45d334b22c06a14d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / openquantum_sdk_qrisp-0.6.0-py3-none-any.whl

Download URL openquantum_sdk_qrisp-0.6.0-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
594da71ee9a0744bc697377f4eefaee4a08f4e4b94873569343f94291e0e5092
BLAKE2b-256 checksum
How to use checksums
f0e7e869d787799dfe03502b6f0eca6766ba5b949e7fd15a2c90ae8f040be78e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for openquantum-sdk-qrisp 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page