Skip to main content

QCI Connect SDK   API Client Documentation

API Client

This python package is used to interact with the QCI Connect platform of the German Aerospace Center (DLR). It is a component of the full QCI Connect SDK.

Documentation

You can find the documentations here.

The documentation files are also included in the source and can be built with the script dev_tools/build_docs.

Quick Start (Pip Installation)

Qiskit

The Qiskit provider runs Qiskit circuits on the QCI Connect QPUs and simulators. It needs the qiskit extra: pip install 'qciconnect-client[qiskit]'.

from qiskit import QuantumCircuit, transpile
from qciconnect.client.qiskit_provider import QciConnectProvider

provider = QciConnectProvider("<your token>")  # Client's arguments, except platform
backend = provider.get_backend("statevector_simulator")  # provider.backends() lists them

bell = QuantumCircuit(2, 2)
bell.h(0)
bell.cx(0, 1)
bell.measure([0, 1], [0, 1])
print(backend.run(transpile(bell, backend), shots=100).result().get_counts())

Unlike Client, the provider adds no log handler by default. Pass logger="interactive" to print its warnings, e.g. about dropped shots or a QPU's usage hint, to stdout, or pass your own logging.Logger.

provider.backends() lists the QPUs and simulators that accept jobs right now. Narrow it with min_num_qubits= or filters=, a function that receives each QPU's info, e.g. filters=lambda qpu: qpu.technology == "digital_twin".

Each circuit becomes one QCI Connect job. run() returns without waiting, and result() waits for all jobs. The job counts as running until every circuit has finished. Besides shots, run() takes name (the job name, instead of the circuit's), comment, hpc_cost_bearer and project_cost_bearer (instead of the provider's), and session_id (submit into a session booked in the QCI Connect web UI). To use a session for every run, set it once with backend.set_options(session_id=...).

Some QPUs return ambiguous shots, in which a measured qubit reads None. Such shots can't be counted, so by default they are dropped with a warning. run(..., on_partial_shot="raise") raises an error instead. The drops can be large: on qsea_i each qubit read None in roughly 15-20% of the shots, so a circuit measuring 4 qubits kept only about a third of its shots (37 of 100). Every experiment result records what happened: result.results[i].requested_shots, returned_shots, discarded_shots and discarded_samples (the dropped shots as returned, Nones included). Its shots is the number of shots kept.

Qiskit's BackendSamplerV2 crashes when shots are missing. Use QciConnectSampler(backend=backend) instead. Within a pub, it keeps the same number of shots for every parameter binding, and records requested_shots, discarded_shots and trimmed_shots in the pub's metadata.

BackendEstimatorV2 works as is, but after drops its standard errors are too small by a factor of √(requested / kept shots), because it divides by the requested number of shots.

xq2i is not supported yet: it returns per-qubit populations rather than shots. Nor is xq1i, whose two-qubit gates are its own and unknown to Qiskit.

Working on Source Code (Dev Mode)

Clone the repository (or download the .tar.gz file), initialize the git submodules, then install dependencies.

We recommend using ultraviolet (installation guide).

git submodule update --init
uv sync
git submodule foreach "uv pip install -e ."

This installs API Client, its runtime dependencies, the dev/test dependencies, and the QCIConnect submodules as editable local dependencies. Recursive submodule initialization is not required.

You can now activate the .venv in the source directory or use uv to run commands in the .venv, e.g.,
uv run python my_script.py. Any time uv sync is necessary, script is available within the environment to perform this action and, at the same time, reinstall the submodules. The script can be executed as

update-venv

If you want to recreate the OpenAPI Wrapper from openapi.yml, run

npx @openapitools/openapi-generator-cli@2.23.4 generate

Metadata

Release files for qciconnect-client 1.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 qciconnect-client 1.6.0
File Size Uploaded Provenance Actions
qciconnect_client-1.6.0.tar.gz 265.4 kB Without provenance Details for qciconnect_client-1.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qciconnect-client 1.6.0
File Interpreter ABI Platform Actions
qciconnect_client-1.6.0-py3-none-any.whl Python 3 none any Details for qciconnect_client-1.6.0-py3-none-any.whl

Total release size: 852.3 kB

Release files / qciconnect_client-1.6.0.tar.gz

Download URL qciconnect_client-1.6.0.tar.gz
Size 265.4 kB
Tags Source
SHA-256 checksum
How to use checksums
68cd1a01637f82f55e48fb2bbb79fe17fbba0a5a745e5433b9026efd465148b8
BLAKE2b-256 checksum
How to use checksums
4c81ff10c908c76de827b1278c9da3176eb1b8140c2b9ba177eb9382035e3920
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / qciconnect_client-1.6.0-py3-none-any.whl

Download URL qciconnect_client-1.6.0-py3-none-any.whl
Size 586.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f312a6c8caf39f50313c658aceb3fbe9e67c063af3ec14efc1978f5c914d67ac
BLAKE2b-256 checksum
How to use checksums
d5e44928ffc67b235f080963c5490e2f0264896b9aaa7ab457df7a83a73a5e09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for qciconnect-client 1.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.

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