Skip to content

Qubitra Python SDK

The Python client for Qubitra. Submit a circuit to a backend, wait for it to finish, and read the measured counts.
from qubitra import QubitraClient
BELL = (
'OPENQASM 3.0; include "stdgates.inc"; qubit[2] q; bit[2] c; '
"h q[0]; cx q[0], q[1]; c = measure q;"
)
with QubitraClient() as client:
job = client.jobs.submit(
backend_id="sim-statevector-26q",
circuit=BELL,
shots=1024,
name="bell-pair",
)
client.jobs.wait(job.id)
print(client.jobs.result(job.id).counts) # {"00": 512, "11": 512}

One interface across backends

Backends carry stable, capability-based Qubitra identifiers. An identifier keeps working when the hardware behind it changes, and your code contains no vendor-specific fields.

Asynchronous execution

Submitting returns a Job immediately. The platform runs it to completion, and you check its status on your own schedule instead of holding a connection open.

Sampler and estimator

A job carries a list of PUBs. Add an observable to get an expectation value instead of counts, and parameter rows to sweep a circuit — the shape variational workloads need.

Normalized results

A completed Job returns results in the same shape on every backend, so results can be compared across backends without translation.

Typed throughout

Immutable pydantic models, inline type information for editors and type checkers, and a single exception base class. Python 3.11 and newer.