Skip to main content

q8s.runtime

q8s.runtime provides common runtime, provenance, and experiment-tracking capabilities for quantum software.

The library provides a QDK-independent representation of quantum programs and their execution metadata, together with integrations for quantum development kits such as Qiskit and Qrisp. This makes it possible to collect and analyse execution and compilation information consistently across different quantum software stacks.

Installation

Install the core package using:

pip install q8s.runtime

Support for individual quantum development kits can be installed using the corresponding optional dependencies:

pip install "q8s.runtime[qiskit]"
pip install "q8s.runtime[qrisp]"

Multiple integrations can be installed together:

pip install "q8s.runtime[qiskit,qrisp]"

Integrations

Qiskit

The Qiskit integration provides adapters for Qiskit objects and automatic experiment tracking through MLflow.

MLflow autologging

Qiskit transpilation and execution can be automatically captured by enabling autologging:

import mlflow
from mqt.bench import BenchmarkLevel, get_benchmark
from q8s.runtime.mlflow.qiskit import autolog

autolog()

from iqm.qiskit_iqm.fake_backends.fake_aphrodite import IQMFakeAphrodite
from qiskit.transpiler import generate_preset_pass_manager

mlflow.set_experiment("qiskit-transpilation")


with mlflow.start_run():
    qc = get_benchmark(
        benchmark="qft",
        level=BenchmarkLevel.ALG,
        circuit_size=30,
    )

    backend = IQMFakeAphrodite()

    manager = generate_preset_pass_manager(
        optimization_level=3, backend=backend, seed_transpiler=42
    )

    tqc = manager.run(qc)

    job = backend.run(tqc, shots=1024, memory=True)

    result = job.result()

    result.get_counts()

The integration can capture information about the transpilation process, including individual transpiler passes and their associated metadata.

Qrisp

The Qrisp integration converts Qrisp programs into the common q8s.runtime representation, allowing provenance and experiment information produced by Qrisp workflows to be handled using the same model as Qiskit workflows.

import mlflow

from q8s.runtime.mlflow.qrisp import autolog

autolog()

from qrisp import (
    PassManager,
    QuantumCircuit,
    combine_single_qubit_gates,
    commute_swaps,
    fuse_adjacents,
)

from q8s.runtime.mlflow.qrisp.autologging import get_context
from q8s.runtime.qprov.graphs import plot_transpilation_timeline

mlflow.set_experiment("qrisp-transpilation")

with mlflow.start_run():

    qc = QuantumCircuit(2)
    qc.cx(0, 1)
    qc.cx(0, 1)  # Self-inverse — will be cancelled
    qc.h(0)
    qc.h(0)  # Another self-inverse pair

    pm = PassManager()
    pm += fuse_adjacents
    pm += commute_swaps
    pm += combine_single_qubit_gates

    optimized_qc = pm.run(qc)

Capabilities

Provenance

q8s.runtime uses the QProv provenance model to describe the information associated with the lifecycle of a quantum program.

QProv organizes provenance information into four main categories:

QProv category Description Qiskit Qrisp
Quantum Circuit Structure and characteristics of the quantum circuit
Quantum Computer Characteristics of the quantum computer or execution backend - -
Compilation Transformation of a quantum circuit for a target quantum computer
Execution Information associated with executing the compiled circuit - -

The availability of individual provenance attributes depends on the QDK, backend, provider, and application.

Quantum Circuit

Quantum Circuit provenance describes the structure and characteristics of the quantum circuit being executed.

QProv Provenance attribute Qiskit Qrisp
Q1 Gates
Q2 Measurements
Q3 Execution order - -
Q4 Circuit width
Q5 Circuit depth
Q6 Circuit size
Q7 Encoding - -

Circuit width represents the number of qubits used by the circuit, circuit depth describes the number of sequential operations required by the circuit, and circuit size describes its number of operations.

Compilation

Compilation provenance describes how an abstract quantum circuit is transformed into a circuit that can be executed by a particular quantum computer.

QProv Provenance attribute Qiskit Qrisp
C1 Qubit assignments
C2 Gate mappings
C3 Optimisation goal -
C4 Random seed -
C5 Compilation time

In addition to the QProv compilation attributes, q8s.runtime toolkit collects fine-grained compiler provenance.

For each transpiler pass, the following information can be recorded:

Compiler provenance Description Qiskit Qrisp
Pass index Position of the pass in the transpilation process
Pass name Transpiler pass name
Stage Stage of the staged pass manager -
Duration Execution time of the pass
Circuit depth Circuit depth after the pass
Circuit size Circuit size after the pass

This extends QProv's compilation provenance with information about the internal compilation process and enables reconstruction and visualization of a transpilation timeline.

Legend: ✓ supported · ◐ dependent on QDK/backend/application · — not currently collected

References

The provenance model implemented by q8s.runtime is based on:

Weder, B., Breitenbücher, U., Leymann, F., and Wild, K. Integrating quantum computing into workflow modeling and execution. IET Quantum Communication.

See the QProv publication for the complete provenance model and definitions.

License

q8s.runtime is licensed under the Apache License 2.0.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

q8s_runtime-0.2.1.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

q8s_runtime-0.2.1-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file q8s_runtime-0.2.1.tar.gz.

File metadata

  • Download URL: q8s_runtime-0.2.1.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for q8s_runtime-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a1e6ffcc441d8e123784f084c7f9f104323b4c293e8d8e56796529582e64b540
MD5 a1638d61fe9c96d9e85e99c9261c065d
BLAKE2b-256 02489cb48422f97f9143b883a1464d2913849bd9355c92bd49ec6c478b7da8a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for q8s_runtime-0.2.1.tar.gz:

Publisher: publish.yaml on qubernetes-dev/runtime

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file q8s_runtime-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: q8s_runtime-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for q8s_runtime-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e24357cac45e400cbe3fdbb546d4172f9005bf486c716add6f6640459d991b59
MD5 42d82deafcbd823ba93875a5e8d50768
BLAKE2b-256 14b1290c832eac83b8784aff08fad1a1983591d1e5fe5459dbf1400cd30d0513

See more details on using hashes here.

Provenance

The following attestation bundles were made for q8s_runtime-0.2.1-py3-none-any.whl:

Publisher: publish.yaml on qubernetes-dev/runtime

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 files

0.1.0

2 files

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