"Source: Text/Lat/LatNF.text";
"Line: 491";
"Date: Fri Sep 26 12:10:10 2025";
"Main: Fri Sep 26 14:29:19 2025";
// original file: Text/Lat/LatNF.text, line: 491
// Example: H32E1 ()
print "Example: H32E1";
ei := GetEchoInput();
SetEchoInput(true);
K<s5> := NumberField(Polynomial([-5,0,1])); // Q(sqrt(5))
L1 := NumberFieldLattice(K,3);
G := Matrix(3,3,[K | 1,2,3, 2,s5,-1, 3,-1,0]);
L2 := NumberFieldLattice(K,3 : Gram:=G); // with Gram matrix
v1 := L1![1,2,3];
v2 := L1![K.1,-1,2];
L3 := NumberFieldLattice([Vector(v1),Vector(v2)]); // on vectors
L4 := sub<L1|[v1,v2]>; // on LatNFElt's, same as L3
M := Module(L3); // create the Dedekind module
L5 := NumberFieldLattice(M); // and back to the NF lattice
D := Dual(L3);
L6 := D+L3;
S := L3/K.1; // scaling
L7 := S meet D; L7;
T3 := Matrix(3,3,[K | 1,2,3, 4,5,6, K.1,-1,-2]);
L8 := L7*T3; // transform is same degree, operate on right
T2 := Matrix(2,2,[K | 1,2, K.1,-1]);
L9 := T2*L7; // lattice is 2-dim, operate on left (pseudobasis)
assert Dimension(L9) eq 2 and Degree(L9) eq 3;
DS := DirectSum(L2,L9); // 5-dimensional
assert Dimension(DS) eq 3+2;
O1 := OrthogonalComplement(L1,L3);
O2 := OrthogonalComplement(L1,v1);
O1;
O2;
SetEchoInput(ei);
