CLI reference¶
The package installs the quport command. The CLI is intended for quick
experiments, reproducible benchmark generation, and artifact export. For complex
custom workflows, use the Python API documented in API reference.
General conventions¶
Command names use hyphens, for example
gen-configandcompile-dist.Strategy values use the Python strategy names, for example
tpccap_sa.Config paths may be JSON or YAML; YAML requires the
yamlextra.Output directories are created when possible by artifact-writing commands.
Commands that operate on one circuit (
map,schedule,split, andcompile-dist) can either generate a random benchmark with--n-logicalor load a user OpenQASM 2/3 circuit with--input-qasm path/to/circuit.qasm. OpenQASM 2 loads with Qiskit’s built-in parser; OpenQASM 3 requires Qiskit’s optionalqiskit_qasm3_importpackage.
quport gen-config¶
quport gen-config
Writes an example config to quport_config.json and prints the resolved
MultiQPUConfig. The format follows the --out extension; .yaml/.yml
requires the yaml extra.
Use this as the safest starting point for editing architecture fields because it
contains all current config keys.
quport topology-info¶
quport topology-info --config quport_config.json
Builds the configured inter-QPU graph and prints structural metrics before any circuit compilation work is performed. Reported values include edge count, degree range, connectivity, component count, reachable-pair diameter, average shortest path over reachable QPU pairs, and unreachable unordered QPU pairs. Use this as a quick sanity check when comparing switch, ring, degree-bounded, Clos, and fat-tree models.
quport map¶
quport map --n-logical 6 --depth 5 --seed 1 --strategy balanced --config quport_config.json --out mapped.qasm
Generates a random circuit, maps/transpiles it on the global architecture, prints SWAP/remote/depth/cost/timing metrics, and optionally writes OpenQASM 3.
Options:
--n-logical: logical qubit count;--depth: random circuit depth;--seed: random circuit and transpiler seed;--strategy:balanced,cluster,tpccap, ortpccap_sa;--config: optional JSON/YAML config path;--input-qasm: optional OpenQASM 2/3 file to map instead of generating a random circuit;--out: optional mapped OpenQASM 3 output.
Use this command when you want to see the globally routed circuit that Qiskit produces for one architecture and one partitioning strategy.
quport bench¶
quport bench --n-logical 8 --depth 20 --trials 10 --strategies baseline,balanced,tpccap --out results.csv
Runs random-circuit benchmarks and writes one CSV row per trial/strategy. The CSV is suitable for pandas, spreadsheets, and plotting tools.
Important columns include:
trialandseedfor reproducibility;methodandstrategyfor grouping;swaps,remote_2q,depth, andsizefor mapped circuit metrics;cost_total,cost_local, andcost_remotefor latency-model costs;mapping_time_sandtranspile_time_sfor runtime comparisons.
quport sweep¶
quport sweep --n-logical 8 --depth 20 --trials 5 --out sweep.csv --plot sweep.png
Sweeps built-in topology and port settings. --plot requires quport[viz]. The
CSV contains aggregate means rather than one row per random circuit. Use bench
when you need raw per-trial rows.
quport schedule¶
quport schedule --n-logical 6 --depth 5 --seed 1 --strategy tpccap
Maps a random or --input-qasm circuit and prints a layered makespan estimate.
This is a fast way to compare whether a mapped circuit’s remote operations are
likely to serialize under communication-port limits.
quport split¶
quport split --n-logical 6 --depth 5 --seed 1 --strategy tpccap --out-dir distributed_out
Maps a random or --input-qasm circuit globally, splits the mapped circuit into
per-QPU local QASM files, and writes remote_ops.json.
This command is useful for inspecting how a globally routed circuit is decomposed,
but it is not the preferred distributed-compilation workflow. Prefer compile-dist
when you want to avoid cross-QPU global routing and keep remote operations explicit
from the compilation flow.
quport compile-dist¶
quport compile-dist --n-logical 6 --depth 5 --seed 1 --strategy tpccap_sa --temporal-decay 0.98 --out-dir compile_out
Runs distributed compilation without cross-QPU SWAP routing. Use --input-qasm
to compile an application circuit from OpenQASM 2/3 instead of generating a random
benchmark. Output artifacts:
qpu_<id>_routed.qasm: locally routed per-QPU programs;remote_ops.json: ordered remote operation manifest;schedule.json: topology-aware schedule summary emitted fromTopologyScheduleSummary.to_dict();schedule_trace.json: detailed per-layer/per-round communication plan emitted fromTopologySchedulePlan.to_dict(), with absolutestart_time/end_timeoffsets for layers and remote rounds.
The schedule JSON writers use allow_nan=False and the schedule serializers
validate timings, counts, QPU pairs, and link-utilization pairs before export.
Recommended checks after running:
python -m json.tool compile_out/remote_ops.json >/dev/null
python -m json.tool compile_out/schedule.json >/dev/null
python -m json.tool compile_out/schedule_trace.json >/dev/null
Choosing between CLI commands¶
If you need… |
Use… |
|---|---|
inter-QPU graph sanity metrics |
|
one globally routed Qiskit circuit |
|
repeated global-routing comparisons |
|
topology/port aggregate summaries |
|
quick makespan estimate |
|
per-QPU split of a globally mapped circuit |
|
explicit distributed compile artifacts |
|