Skip to main content

FlagQuantum Compiler QSteed

flagquantum-compiler-qsteed is an independently installed circuit compiler plugin for FlagQuantum. It translates FlagQuantum CircuitIR to a PyQuafu QuantumCircuit, invokes the vendored QSteed compiler core, and translates the compiled circuit back to CircuitIR.

The first release deliberately supports one closed, testable slice:

  • static h, x, rx, ry, rz, and cx instructions with numeric angles;
  • basis lowering to a selected subset of those gates, with topology routing on the fixed six-gate basis;
  • an optional undirected coupling map over the circuit's existing wires;
  • deterministic QSteed basis lowering and SABRE routing;
  • restoration of QSteed's final physical layout to FlagQuantum's logical wire order.
  • Quafu calibration targets with automatic or explicitly ordered physical subgraph selection and a target_qubits result; physical identifiers never replace logical QASM wires.

Measurements, observables, symbolic parameters, custom matrices, dynamic operations, additional target fields, and larger physical topologies are rejected. There is no compiler substitution or fallback. Omitting coupling_map explicitly requests basis compilation without topology routing. For a Quafu chip_info target, omitting target_qubits lets QSteed choose the subgraph. Supplying it locks the logical-to-physical order after existence, uniqueness, and connectivity validation; the plugin never substitutes another mapping.

Installation

Install the plugin directly; pip resolves FlagQuantum and the compiler's small runtime dependency set automatically:

python -m pip install flagquantum-compiler-qsteed==0.2.0

The plugin requires FlagQuantum >=0.2. It privately vendors the verified compiler-only closure of QSteed 0.2.3+quafu.sqc; users do not install QSteed, QuarkCircuit, QuarkStudio, a database, or a web service. The copied source, upstream commit, license, and local namespace changes are recorded in THIRD_PARTY_NOTICES.md and the packaged provenance file.

Python 3.10–3.12 are the supported release range and are checked in CI against the oldest supported FlagQuantum release and current FlagQuantum main.

For development from this repository, install FlagQuantum as above, then run:

python -m pip install -e ".[test]"
python -m pytest -q

Version 0.2.0 removes the external QSteed installation step while retaining the same compiler behavior and provenance.

Compile a circuit

This offline example needs no provider credentials and submits no hardware job:

import flagquantum as fq

circuit = fq.Circuit(3).h(0).cx(0, 2)
compiled = fq.compile(
    circuit,
    compiler="qsteed",
    target={
        "basis_gates": ("h", "x", "rx", "ry", "rz", "cx"),
        "coupling_map": ((0, 1), (1, 2)),
    },
)
print(compiled.instructions)

See release preparation for publication prerequisites and artifact checks.

Advanced extension lifecycle

from flagquantum.ecosystem.extensions import (
    CapabilityRequest,
    ExtensionConfig,
    discover_extensions,
)

import flagquantum as fq

source_ir = fq.Circuit(3).h(0).cx(0, 2).to_ir()
registry = discover_extensions("compiler")
handle = registry.negotiate(
    "compiler",
    "qsteed",
    CapabilityRequest(required=frozenset({"circuit_ir"})),
)
handle.start(ExtensionConfig())
try:
    compiled = handle.invoke(
        "compile",
        source_ir,
        target={
            "basis_gates": ("h", "x", "rx", "ry", "rz", "cx"),
            "coupling_map": ((0, 1), (1, 2)),
        },
    )
finally:
    handle.close()

QSteed treats the coupling graph as bidirectional in this compiler path. The plugin therefore validates two-wire instructions against undirected edges.

Metadata

Release files for flagquantum-compiler-qsteed 0.2.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 flagquantum-compiler-qsteed 0.2.0
File Size Uploaded
flagquantum_compiler_qsteed-0.2.0.tar.gz 69.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flagquantum-compiler-qsteed 0.2.0
File Interpreter ABI Platform
flagquantum_compiler_qsteed-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 212.8 kB

Release files / flagquantum_compiler_qsteed-0.2.0.tar.gz

Download URL flagquantum_compiler_qsteed-0.2.0.tar.gz
Size 69.0 kB
Tags Source
SHA-256 checksum
How to use checksums
77e35cf8d4265a2afdca86fb372964bdf7c2aea82e0b014c245a4706777ea237
BLAKE2b-256 checksum
How to use checksums
95b722f10c9644e32f0c27e52b30a21c295ff5a8a8097ff0c8fc79babb7a1b04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / flagquantum_compiler_qsteed-0.2.0-py3-none-any.whl

Download URL flagquantum_compiler_qsteed-0.2.0-py3-none-any.whl
Size 143.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f079b489f46d4b72a579f39e00dc5e09c538e204e10a84e3235b2acf64b46152
BLAKE2b-256 checksum
How to use checksums
326b3dbf9da4745c505222714b591242cb79b6b318f8cfb6bed97043b00e62cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release 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