FlagQuantum Compiler QSteed
flagquantum-compiler-qsteed is an independently installed circuit compiler
plugin for FlagQuantum. It translates FlagQuantum CircuitIR to a PyQuafu
QuantumCircuit, invokes QSteed's real transpiler, and translates the compiled
circuit back to CircuitIR.
The first release deliberately supports one closed, testable slice:
- static
h,x,rx,ry,rz, andcxinstructions 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_qubitsresult; 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
This release candidate requires FlagQuantum >=0.2,<0.3 and the verified
QSteed build 0.2.3+quafu.sqc. It is not yet a one-command PyPI installation:
FlagQuantum 0.2 and this QSteed build must be installed first. PyPI QSteed 0.2.2
is not a supported substitute. Python 3.12 was used for the release checks;
the declared Python 3.10–3.12 range still needs a full compatibility matrix.
From this repository, after installing a compatible FlagQuantum checkout:
python -m pip install -r requirements-qsteed.txt
python -m pip install -e ".[test]"
python -m pytest -q
The dependency file pins the verified upstream commit. The wheel declares its
exact package version without embedding a Git URL. Once the plugin is published,
users with both prerequisites already installed can use
python -m pip install flagquantum-compiler-qsteed==0.1.0.
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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flagquantum_compiler_qsteed-0.1.0.tar.gz.
File metadata
- Download URL: flagquantum_compiler_qsteed-0.1.0.tar.gz
- Upload date:
- Size: 16.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d24089cfcd5e1356f072ccf1a2a00c53ecfba093dcde5cf40ed4afe9242a5000
|
|
| MD5 |
de1d6344fcbaeab8696ed6885bba622a
|
|
| BLAKE2b-256 |
516b42bcf43ec84e1c4493eaf7f6b11a55e7ab262c044308f96054657db85df4
|
File details
Details for the file flagquantum_compiler_qsteed-0.1.0-py3-none-any.whl.
File metadata
- Download URL: flagquantum_compiler_qsteed-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
129ca10b7e1fa9924aaa37040d138518ed5c82ae71cef1f4e8ecacb8f4dc15a1
|
|
| MD5 |
2f9e6245098b2cdf8ccf6ef5bf84f85b
|
|
| BLAKE2b-256 |
f42439e672c612858462f9fab4fd21b1ac4a35f802087ef8953bc2a2371edec0
|