qec-code
qec-code provides Rust data structures and algorithms for constructing and
analyzing quantum error-correcting codes. Its dependency-facing APIs include:
- CSS matrix validation and construction;
- exact distance through optional HiGHS or Gurobi ILP backends;
- randomized CSS distance upper bounds; and
- packed GF(2) row operations, reduced row spaces, and reusable kernel
workspaces under
qec_code::packed_gf2.
Installation
Add the library from crates.io:
[]
= "0.3.0"
Enable the open-source exact ILP backend only when it is needed:
= { = "0.3.0", = ["distance-ilp-highs"] }
The default build is a library-only build with no command-line parser or native solver dependency. Available opt-in features are:
cliexposesqec_code::cliand builds theqec-codebinary;distance-ilp-highsenables exact distance with HiGHS; anddistance-ilp-gurobienables exact distance with Gurobi without also pulling in HiGHS.
Applications that previously invoked the package binary or imported
qec_code::cli must add features = ["cli"]. Features compose, so a CLI using
HiGHS can enable both cli and distance-ilp-highs.
This crate is covered by the repository-wide Apache-2.0 license, which is also declared in the workspace package metadata. Enable the distance features above only when needed.
Deterministic regular matrices
qec_code::regular_classical provides the versioned pure-Rust generator for
regular binary parity-check matrices used by random code families. The exact
version-1 stream, bounded-index rule, retry behavior, and seed-7 fixture are
documented in doc/regular_classical.md.
Packed GF(2) example
use ;
let generators = vec!;
let space = from_dense_rows?;
let target = from_dense?;
assert!;
# Ok::
The public wrappers intentionally hide the packed storage layout so internal elimination code can evolve without breaking downstream crates.