qec-code CLI
Use qec-code to construct and inspect codes, export CSS check matrices, and search for logical operators. Circuit generation and sampling belong to rstim.
Inputs and distance results
code css export writes sparse-row JSON matrices. Custom inputs to code css-distance take --hx and --hz files; each row specifies the nonzero column indices. See the CSS experiment for a complete example. Matrix dimensions and commuting X/Z checks determine whether these are valid stabilizers.
The built-in small-code distance command is an exact search. randomized-upper-bound produces a witness and an upper bound; it does not prove the absence of lighter logical operators. exact requires a configured solver for solver-backed inputs. A timeout or an incomplete search is not a certified distance.
Optional solvers
distance-ilp-highs enables the open-source native solver; distance-ilp-gurobi additionally requires an installed licensed Gurobi environment. The installation section centralizes optional builds. Inspect the selected command's help for backend selection and output options.
Output and failures
Use --json where offered for status, bound type, witness, options and provenance. Successful commands exit 0; parse, input or solver errors exit nonzero and print diagnostics to stderr. Do not assume rstim's JSON error-envelope contract applies to this executable.
Command index
qec-codeqec-code codeqec-code code steaneqec-code code cssqec-code code css-distanceqec-code code steane summaryqec-code code steane stabilizersqec-code code steane logicalsqec-code code steane distanceqec-code code css listqec-code code css verify-familiesqec-code code css exportqec-code code css constructqec-code code css quantum-tannerqec-code code css-distance exactqec-code code css-distance randomized-upper-boundqec-code code css-distance random-window-upper-bound
qec-code
Usage: qec-code <COMMAND>
Commands:
code
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print helpqec-code code
Usage: qec-code code <COMMAND>
Commands:
steane
css
css-distance
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print helpqec-code code steane
Usage: qec-code code steane <COMMAND>
Commands:
summary
stabilizers
logicals
distance
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print helpqec-code code css
Usage: qec-code code css <CODE_ID> <MATRIX>
qec-code code css <COMMAND>
Commands:
list
verify-families
export
construct
quantum-tanner
help Print this message or the help of the given subcommand(s)
Arguments:
<CODE_ID>
<MATRIX> [possible values: hx, hz]
Options:
-h, --help Print helpqec-code code css-distance
Usage: qec-code code css-distance <COMMAND>
Commands:
exact
randomized-upper-bound
random-window-upper-bound
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print helpqec-code code steane summary
Usage: qec-code code steane summary
Options:
-h, --help Print helpqec-code code steane stabilizers
Usage: qec-code code steane stabilizers
Options:
-h, --help Print helpqec-code code steane logicals
Usage: qec-code code steane logicals
Options:
-h, --help Print helpqec-code code steane distance
Usage: qec-code code steane distance
Options:
-h, --help Print helpqec-code code css list
Usage: qec-code code css list
Options:
-h, --help Print helpqec-code code css verify-families
Usage: qec-code code css verify-families
Options:
-h, --help Print helpqec-code code css export
Usage: qec-code code css export <CODE_ID> <MATRIX>
Arguments:
<CODE_ID>
<MATRIX> [possible values: hx, hz]
Options:
-h, --help Print helpqec-code code css construct
Usage: qec-code code css construct --spec <SPEC> <OUTPUT>
Arguments:
<OUTPUT> [possible values: hx, hz, metadata]
Options:
--spec <SPEC>
-h, --help Print helpqec-code code css quantum-tanner
Usage: qec-code code css quantum-tanner --spec <SPEC> <MATRIX>
Arguments:
<MATRIX> [possible values: hx, hz]
Options:
--spec <SPEC>
-h, --help Print helpqec-code code css-distance exact
Usage: qec-code code css-distance exact [OPTIONS]
Options:
--code-id <CODE_ID>
--hx <HX>
--hz <HZ>
--quantum-tanner-spec <QUANTUM_TANNER_SPEC>
--backend <BACKEND>
[default: auto] [possible values: auto, highs, gurobi]
--time-limit-seconds <TIME_LIMIT_SECONDS>
--mip-gap <MIP_GAP>
--threads <THREADS>
--verbose-solver
--json
-h, --help
Print helpqec-code code css-distance randomized-upper-bound
Usage: qec-code code css-distance randomized-upper-bound [OPTIONS] --iterations <ITERATIONS> --seed <SEED>
Options:
--code-id <CODE_ID>
--hx <HX>
--hz <HZ>
--quantum-tanner-spec <QUANTUM_TANNER_SPEC>
--iterations <ITERATIONS>
--restarts <RESTARTS> [default: 1]
--seed <SEED>
--target-weight <TARGET_WEIGHT>
--json
-h, --help Print helpqec-code code css-distance random-window-upper-bound
Usage: qec-code code css-distance random-window-upper-bound [OPTIONS] --iterations <ITERATIONS> --seed <SEED>
Options:
--code-id <CODE_ID>
--hx <HX>
--hz <HZ>
--quantum-tanner-spec <QUANTUM_TANNER_SPEC>
--iterations <ITERATIONS>
--restarts <RESTARTS> [default: 1]
--seed <SEED>
--target-weight <TARGET_WEIGHT>
--json
-h, --help Print help