qldpc.external.codes

Module for loading error-correcting codes from the GAP computer algebra system.

Functions

get_classical_code(→ tuple[list[list[int]], int])

Retrieve a classical code from GAP.

get_distance_bound(→ int)

Estimate the distance of a quantum code using GAP's QDistRnd package.

get_quantum_code(→ tuple[list[str], int | None, bool])

Retrieve a quantum code from qecdb.org.

Module Contents

qldpc.external.codes.get_classical_code(code: str) → tuple[list[list[int]], int][source]

Retrieve a classical code from GAP.

Requires the GAP GUAVA package (https://www.gap-system.org/Packages/guava.html).

qldpc.external.codes.get_distance_bound(code: qldpc.codes.QuditCode, num_trials: int = 1, *, cutoff: int | None = None, maxav: str = 'fail') → int[source]

Estimate the distance of a quantum code using GAP’s QDistRnd package.

The estimate is a randomized upper bound (QDistRnd samples random codewords). Requires the GAP GUAVA and QDistRnd packages.

If given a CSSCode, estimate the Z-distance (minimum weight of a Z-type logical operator). See https://qec-pages.github.io/QDistRnd/doc/chap4.html.

Note that QDistRnd does not support subsystem codes. In the case of a CSS code, however, we can still compute the Z-distance by promoting all Z-type gauge group generators to stabilizers. maxav is passed through to QDistRnd as a raw GAP value (default “fail”); see its docs above.

qldpc.external.codes.get_quantum_code(code_id: str) → tuple[list[str], int | None, bool][source]

Retrieve a quantum code from qecdb.org.

This function fetches and scrapes the code’s HTML page at https://qecdb.org, so it requires network access and is sensitive to that page’s layout.

Return the stabilizers of the code, its distance, and whether it’s CSS.