The weight distribution of a quantum code Q consists of three separate distributions:
For a quantum code to be considered pure, its minimum weight must be less than or equal to the weight of its stabilizer code.
Given a quantum code Q with stabiliser code S, return its weight distribution. Recall that the quantum weight distribution comprises the weight distributions of S, Sperp and Sperp \ S. The function returns each distribution as a separate value. Each weight distribution is returned in the form of a sequence of tuples consisting of a weight and the number of code words of that weight.
> F<w> := GF(4); > Q := QECC(GF(4),6,3); > Q; [[6, 3, 2]] Quantum code over GF(2^2), stabilised by: [ 1 0 1 1 1 0] [ w w w w w w] [ 0 1 0 0 0 1] > WD_S, WD_N, WD := WeightDistribution(Q); > WD_S eq WeightDistribution(StabiliserCode(Q)); true > WD_N eq WeightDistribution(NormaliserCode(Q)); true > WD; [ <2, 28>, <3, 56>, <4, 154>, <5, 168>, <6, 98> ]
Method: MonStgElt Default: "Auto"
RankLowerBound: RngIntElt Default: 0
MaximumTime: RngReSubElt Default: ∞
For the quantum code Q with stabilizer code S, return the minimum weight of Q, which is the minimum weight of the codewords in Sperp \ S. For self-dual quantum codes (those of dimension 0), the minimum weight is defined to be the minimum weight of S. The default algorithm is based on the minimum weight algorithm for classical linear codes which is described in detail in section The Minimum Weight. For a description of the algorithm and its variable argument parameters please consult the full description provided there. The minimum weight may alternatively be calculated by finding the complete weight distribution. This algorithm may be selected by setting the value of the variable argument Method to "Distribution".
> F<w> := GF(4); > V5 := VectorSpace(F, 5); > gens := [V5| [0,0,1,w,w], [0,1,1,w,1], [0,0,1,0,w^2], > [0,0,1,w,1], [0,0,1,0,1], [1,w,1,w,w^2], > [1,1,1,w^2,w], [0,1,w,1,w^2] ]; > Q := QuantumQuasiCyclicCode(gens : LinearSpan := true); > Q:Minimal; [[40, 30]] Quantum code over GF(2^2) > SetVerbose("Code",true); > MinimumWeight(Q); Quantum GF(2)-Additive code over GF(4) of length 40 with 70 generators. Lower Bound: 1, Upper Bound: 40 Constructed 2 distinct generator matrices Total Ranks: 35 35 Relative Ranks: 35 5 Time Taken: 0.14 Starting search for low weight codewords... (reset timings) Enumerating using 1 generator at a time: New codeword identified of weight 6, time 0.00 New codeword identified of weight 4, time 0.00 Discarding non-contributing rank 5 matrix New Total Ranks: 35 New Relative Ranks: 35 Completed Matrix 1: lower = 2, upper = 4. Elapsed: 0.00s Termination predicted with 3 generators at matrix 1 Enumerating using 2 generators at a time: Completed Matrix 1: lower = 3, upper = 4. Elapsed: 0.00s Termination predicted with 3 generators at matrix 1 predicting enumerating (1820) 60725 vectors (0.000000 Enumerating using 3 generators at a time: Completed Matrix 1: lower = 4, upper = 4. Elapsed: 0.03s Final Results: lower = 4, upper = 4, Total time: 0.03 4
Return true if Q is a pure quantum code. That is, if the minimum weight of Q is less than or equal to the minimum weight of its stabiliser code.
> F<w> := GF(4); > n := 15; > time {* IsPure(QECC(F, n, k)) : k in [1..n] *}; {* false^^10, true^^5 *} Time: 0.410