"Source: Text/Code/CodeZ4.text";
"Line: 112";
"Date: Thu Sep 25 14:47:47 2025";
"Main: Fri Sep 26 14:29:19 2025";
// original file: Text/Code/CodeZ4.text, line: 112
// Example: H169E1 ()
print "Example: H169E1";
ei := GetEchoInput();
SetEchoInput(true);
Z4 := IntegerRing(4);
O8 := LinearCode<Z4, 8 |
    [1,0,0,0,3,1,2,1],
    [0,1,0,0,1,2,3,1],
    [0,0,1,0,3,3,3,2],
    [0,0,0,1,2,3,1,1]>;
HasLinearGrayMapImage(O8);
assert not $1;
NR := GrayMapImage(O8);
#NR;
assert $1 eq 256;
LeeWeightDistribution(O8);
{* Weight(v): v in NR *};
Z4 := IntegerRing(4);
K8 := LinearCode< Z4, 8 |
    [1,1,1,1,1,1,1,1],
    [0,2,0,0,0,0,0,2],
    [0,0,2,0,0,0,0,2],
    [0,0,0,2,0,0,0,2],
    [0,0,0,0,2,0,0,2],
    [0,0,0,0,0,2,0,2],
    [0,0,0,0,0,0,2,2]>;
f := GrayMap(K8);
K8.1;
f(K8.1);
K8.2;
f(K8.2);
l, B, g := HasLinearGrayMapImage(K8);
l;
assert $1;
B;
g(K8.1) in B;
assert $1;
SetEchoInput(ei);
