"Source: Text/Code/CodeZ4.text";
"Line: 2279";
"Date: Thu Sep 25 14:47:47 2025";
"Main: Fri Sep 26 14:29:19 2025";
// original file: Text/Code/CodeZ4.text, line: 2279
// Example: H169E23 ()
print "Example: H169E23";
ei := GetEchoInput();
SetEchoInput(true);
C := HadamardCodeZ4(3, 6);
C;
t := Floor((MinimumLeeDistance(C) - 1)/2);
t;
I := [17, 1, 2, 5];
p := Sym(32)!(1, 24, 26, 15, 3, 22, 28, 13)(2, 23, 27, 14, 4, 21, 25, 16)
                (5, 11, 32, 20, 7, 9, 30, 18)(6, 10, 29, 19, 8, 12, 31,17);
S := [ p^i : i in [1..8] ];
SetVerbose("IsPDSetFlag", 2);
IsPermutationDecodeSet(C, I, S, 7);
SetVerbose("IsPDSetFlag", 0);
c := C ! [1,2,3,0,0,1,2,3,3,0,1,2,2,3,0,1,3,0,1,2,2,3,0,1,1,2,3,0,0,1,2,3];
c in C;
u := c;
u[1] := c[1] + 2;
u[2] := c[2] + 2;
u[3] := c[3] + 1;
u[16] := c[16] + 3;
u[27] := c[27] + 1;
u in C;
LeeDistance(u, c);
grayMap := GrayMap(UniverseCode(Integers(4), Length(C)));
cbin := grayMap(c);
ubin := grayMap(u);
Distance(ubin, cbin);
isDecoded, uDecoded, ubinDecoded := PermutationDecode(C, I, S, 7, u);
isDecoded;
uDecoded eq c;
ubinDecoded eq cbin;
isDecoded, uDecoded, ubinDecoded := PermutationDecode(C, I, S, 7, ubin);
isDecoded;
uDecoded eq c;
ubinDecoded eq cbin;
SetEchoInput(ei);
