Skip to content

Commit f8f940c

Browse files
committed
fix bug in weight reduction LP tutorial
1 parent 43cbac3 commit f8f940c

File tree

1 file changed

+14
-29
lines changed

1 file changed

+14
-29
lines changed

docs/src/Tutorials/Weight Reduction.md

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -678,42 +678,27 @@ Dict(78 => 28, 56 => 2894, 16 => 13428, 20 => 24654, 58 => 15616, 52 => 7728, 60
678678
## Lifted Products
679679
Classical weight reduction also applies to other types of inputs, although with the current function, the row and column indices must be specified explicitly either as a vector or a range.
680680
```
681-
julia> F = GF(2);
682-
683-
julia> S, x = PolynomialRing(F, "x");
681+
julia> S, x = polynomial_ring(Oscar.Nemo.Native.GF(2), "x");
684682
685683
julia> l = 63;
686684
687-
julia> R = ResidueRing(S, x^l - 1);
685+
julia> R, = residue_ring(S, x^l - 1);
688686
689687
julia> A = matrix(R, 7, 7,
690-
[x^27, 0, 0, 1, x^18, x^27, 1,
691-
1, x^27, 0, 0, 1, x^18, x^27,
692-
x^27, 1, x^27, 0, 0, 1, x^18,
693-
x^18, x^27, 1, x^27, 0, 0, 1,
694-
1, x^18, x^27, 1, x^27, 0, 0,
695-
0, 1, x^18, x^27, 1, x^27, 0,
696-
0, 0, 1, x^18, x^27, 1, x^27])
697-
[x^27 0 0 1 x^18 x^27 1]
698-
[ 1 x^27 0 0 1 x^18 x^27]
699-
[x^27 1 x^27 0 0 1 x^18]
700-
[x^18 x^27 1 x^27 0 0 1]
701-
[ 1 x^18 x^27 1 x^27 0 0]
702-
[ 0 1 x^18 x^27 1 x^27 0]
703-
[ 0 0 1 x^18 x^27 1 x^27]
704-
705-
julia> b = R(1 + x + x^6)
706-
x^6 + x + 1
707-
708-
julia> LiftedProductCode(A, b)
709-
┌ Warning: Commutativity of A and b required but not yet enforced.
710-
└ @ CodingTheory ~/Documents/GitHub/CodingTheory/src/Quantum/product_codes.jl:354
711-
[[882, 48]]_2 CSS stabilizer code
688+
[x^27, 0 , 0 , 1 , x^18, x^27, 1 ,
689+
1 , x^27, 0 , 0 , 1 , x^18, x^27,
690+
x^27, 1 , x^27, 0 , 0 , 1 , x^18,
691+
x^18, x^27, 1 , x^27, 0 , 0 , 1 ,
692+
1 , x^18, x^27, 1 , x^27, 0 , 0 ,
693+
0 , 1 , x^18, x^27, 1 , x^27, 0 ,
694+
0 , 0 , 1 , x^18, x^27, 1 , x^27]);
712695
713-
julia> A_wtred = weight_reduction(A, row_indices = 1:4, column_indices = 1:4, permute_rows = false, permute_columns = false);
696+
julia> b = R(1 + x + x^6);
714697
715-
julia> LiftedProductCode(A_wtred, b)
698+
julia> code = LiftedProductCode(A, b);
716699
┌ Warning: Commutativity of A and b required but not yet enforced.
717700
└ @ CodingTheory ~/Documents/GitHub/CodingTheory/src/Quantum/product_codes.jl:354
718-
[[4914, 48]]_2 CSS stabilizer code
701+
702+
julia> length(code), dimension(code)
703+
(882, 48)
719704
```

0 commit comments

Comments
 (0)