New Quantum Codes From Old
These operations include quantum direct sums, puncturing, shortening, augmentation and expurgation, local Fourier transformations, exchanging the $X$ and $Z$ sectors, and conversions between stabilizer and subsystem presentations.
Modifying a quantum code is more delicate than modifying a classical one, because the result must still be a valid code: the checks have to remain mutually commuting, and the number of logical qubits changes with the number of independent checks. The constructors here validate that and recompute the dependent data rather than copying stale values, so the returned code carries no distance information it cannot justify.
CodingTheory.augment — Method
augment(
S::AbstractSubsystemCode,
row::Union{Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC};
verbose
) -> AbstractSubsystemCode
Return the code obtained by imposing a Pauli generator as a new stabilizer constraint. Existing generator combinations that anticommute with row are removed by an additive kernel calculation before row is added. This implements stabilizer measurement and subsystem gauge fixing without assuming adjacent row pairs.
CodingTheory.direct_sum — Method
direct_sum(
A::AbstractSubsystemCode,
B::AbstractSubsystemCode
) -> Union{StabilizerCode, StabilizerCodeCSS, SubsystemCode, SubsystemCodeCSS}
Return the independent direct sum of A and B, preserving additive generators and sparse storage. This is an alias for quantum_direct_sum.
CodingTheory.expurgate — Method
expurgate(
S::AbstractSubsystemCode,
rows::Vector{<:Integer};
verbose
) -> AbstractSubsystemCode
Return the code obtained by removing the selected stabilizer presentation rows and reconstructing it from the remaining stabilizers and existing gauge pairs. Additive dimensions, logicals, and caches are recomputed.
CodingTheory.gauge_code — Method
gauge_code(
S::AbstractStabilizerCode,
additional_generators::Union{Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC}
) -> Union{StabilizerCode, StabilizerCodeCSS, SubsystemCode, SubsystemCodeCSS}
Return the subsystem code obtained by promoting additional Pauli generators into the gauge group of S. The subsystem constructor recomputes the center and all protected/gauge dimensions additively.
CodingTheory.local_fourier — Method
local_fourier(
S::AbstractSubsystemCode,
qudits
) -> AbstractSubsystemCode
Apply the single-qudit Fourier Clifford (x,z) -> (-z,x) on the selected coordinates. For binary codes this is the Hadamard X/Z swap. Pauli weight and cached exact distances are preserved.
CodingTheory.puncture — Method
puncture(
S::AbstractSubsystemCode,
qudits
) -> AbstractSubsystemCode
Return the code obtained by deleting physical coordinates from every generator. A punctured stabilizer code may become a subsystem code when the projected generators no longer commute. Character-vector phases are intentionally rejected until phase transport is implemented.
CodingTheory.quantum_direct_sum — Method
quantum_direct_sum(
A::AbstractSubsystemCode,
B::AbstractSubsystemCode
) -> Union{StabilizerCode, StabilizerCodeCSS, SubsystemCode, SubsystemCodeCSS}
Return the independent direct sum of two stabilizer/subsystem codes. Additive generators and sparse storage are preserved; parameters are derived by the normal constructors rather than assumed to be integral.
CodingTheory.shorten — Method
shorten(
S::AbstractSubsystemCode,
qudits
) -> AbstractSubsystemCode
Return the code obtained by restricting to additive generator combinations acting trivially on qudits, then delete those coordinates. Unlike puncture, shortening a stabilizer code always remains a stabilizer code.
CodingTheory.swap_X_Z — Method
swap_X_Z(
S::AbstractSubsystemCode,
qudits
) -> AbstractSubsystemCode
Return a new code obtained by applying the single-qudit Fourier Clifford $(x,z) \mapsto (-z,x)$ on qudits, leaving S unchanged. For binary codes this swaps X and Z by a Hadamard operation. This is an alias for local_fourier.