|
13 | 13 | v = [matrix(F, 1, 4, [1, 0, 1, 1]), matrix(F, 1, 4, [0, 0, 0, 1]), matrix(F, 1, 4, [1, 1, 1, 1]), matrix(F, 1, 4, [0, 0, 0, 0])] |
14 | 14 | C2 = QuasiCyclicCode(v, 2, true) |
15 | 15 | @test are_equivalent(C, C2) |
| 16 | + |
| 17 | + # Quantum LDPC Codes with Almost Linear Minimum Distance |
| 18 | + # Example 1 |
| 19 | + F = Oscar.Nemo.Native.GF(2) |
| 20 | + S, x = polynomial_ring(F, :x) |
| 21 | + l = 31 |
| 22 | + R = ResidueRing(S, x^l - 1) |
| 23 | + A = matrix(R, 3, 5, |
| 24 | + [x, x^2, x^4, x^8, x^16, |
| 25 | + x^5, x^10, x^20, x^9, x^18, |
| 26 | + x^25, x^19, x^7, x^14, x^28]) |
| 27 | + C = QuasiCyclicCode(A, true) |
| 28 | + @test length(C) == 155 |
| 29 | + @test dimension(C) == 64 |
| 30 | + @test index(C) == 5 |
| 31 | + |
| 32 | + # TODO I have the following code for something, check the papers and make tests out of them |
| 33 | + # A_tr = CodingTheory._CT_adjoint(A) |
| 34 | + # LiftedProductCode(A, A_tr) |
| 35 | + |
| 36 | + |
| 37 | + # Bias-Tailored Quantum LDPC Codes |
| 38 | + # Example 2.2 |
| 39 | + # l = 3 |
| 40 | + # R = ResidueRing(S, x^l - 1) |
| 41 | + # A = matrix(R, 2, 3, [x + x^2, 1, 0, 0, 1 + x^2, x^2]) |
| 42 | + # lift(A) |
| 43 | + # weightmatrix(A) |
| 44 | + |
| 45 | + # # julia> lift(A) |
| 46 | + # # [0 1 1 1 0 0 0 0 0] |
| 47 | + # # [1 0 1 0 1 0 0 0 0] |
| 48 | + # # [1 1 0 0 0 1 0 0 0] |
| 49 | + # # [0 0 0 1 1 0 0 1 0] |
| 50 | + # # [0 0 0 0 1 1 0 0 1] |
| 51 | + # # [0 0 0 1 0 1 1 0 0] |
| 52 | + # # |
| 53 | + # # julia> weightmatrix(A) |
| 54 | + # # 2×3 Matrix{Int64}: |
| 55 | + # # 2 1 0 |
| 56 | + # # 0 2 1 |
| 57 | + |
| 58 | + # # Example 3.3 |
| 59 | + # l = 13 |
| 60 | + # R = ResidueRing(S, x^l - 1) |
| 61 | + # A = matrix(R, 4, 4, |
| 62 | + # [1, x^2, x^6, x, |
| 63 | + # x^12, x^5, x^12, x^5, |
| 64 | + # x^2, 1, x^9, x^5, |
| 65 | + # x^7, x^11, x^9, x]) |
| 66 | + # A_tr = CodingTheory._CT_adjoint(A) |
| 67 | + # code = LiftedQuasiCyclicLiftedProductCode(A, A_tr) |
| 68 | + |
| 69 | + # # TODO should remove from classical but put where? |
| 70 | + # # TODO this example was never finished because of the original paper? or is wrong? |
| 71 | + # # Quasi-cyclic constructions of quantum codes |
| 72 | + # # Example 1 |
| 73 | + # n = 151 |
| 74 | + # q = 2 |
| 75 | + # deg = ord(n, q) |
| 76 | + # E = GF(2, 15, :α) |
| 77 | + # S, x = polynomial_ring(E, :x) |
| 78 | + # β = α^(div(q^deg - 1, n)) |
| 79 | + # def_set_f = cyclotomic_coset(2, q, n) |
| 80 | + # f = CodingTheory._generator_polynomial(S, β, def_set_f) |
| 81 | + # def_set_g = [def_set_f; cyclotomic_coset(10, q, n)] |
| 82 | + # g = CodingTheory._generator_polynomial(S, β, def_set_g) |
| 83 | + # h = x + 1 |
| 84 | + # R, _ = residue_ring(S, x^n - 1) |
| 85 | + # G1 = CodingTheory._generator_matrix(E, n, n - length(def_set_f), f); |
| 86 | + # G3 = CodingTheory._generator_matrix(E, n, n - length(def_set_f) - 1, f * h); |
| 87 | + # G2 = CodingTheory._generator_matrix(E, n, n - length(def_set_g), g); |
| 88 | + # # G1 = polytocircmatrix(R(f)); |
| 89 | + # # G3 = polytocircmatrix(R(f * h)); |
| 90 | + # # G2 = polytocircmatrix(R(g)); |
| 91 | + # # cannot concatenate G1 and G3, although in the paper G1 and G2 are defined |
| 92 | + # # but G3 is never actually specified |
| 93 | + # stabs = vcat(hcat(G1, G3), hcat(zero(G2), G2)) |
| 94 | + # Q = QuantumCode(change_base_ring(F, stabs), true) |
| 95 | + # # @test length(Q) == |
| 96 | + # # @test dimension(Q) == |
16 | 97 | end |
17 | 98 | end |
0 commit comments