"Source: Text/Ring/RngOrd.text";
"Line: 1900";
"Date: Fri Sep 26 14:51:59 2025";
"Main: Fri Sep 26 14:29:19 2025";
// original file: Text/Ring/RngOrd.text, line: 1900
// Example: H39E9 ()
print "Example: H39E9";
ei := GetEchoInput();
SetEchoInput(true);
R<x> := PolynomialRing(Integers());
M := MaximalOrder(x^4-14*x^3+14*x^2-14*x+14);
L, T := LLL(M);
L;
T;
Basis(M);
Basis(L, M);
L eq M;
assert $1;
pMaximalOverOrder := function(ord, p)
   ovr := MultiplicatorRing(pRadical(ord, p));
   print "index is", Index(ovr, ord);
   return (Index(ovr, ord) eq 1) select ovr else $$(ovr, p);
end function;
Round2 := function(E, K)
   // E should be the equation order of a number field K
   d := Discriminant(E);
   fact := Factorization(Abs(d));
   print fact;
   M := E;
   for x in fact do
M := M+pMaximalOverOrder(E, x[1]);
   end for;
   print "index of equation order in maximal order is:", Index(M, E);
   return M;
end function;
R<x> := PolynomialRing(Integers());
K := NumberField(x^4-420*x^2+40000);
E := EquationOrder(K);
O := Round2(E, K);
L := LLL(O);
O;
O:Maximal;
L;
L:Maximal;
Simplify(L):Maximal;
Simplify(L);
SetEchoInput(ei);
