"Source: Text/Lat/QuadBin.text";
"Line: 646";
"Date: Fri Sep 26 12:10:10 2025";
"Main: Fri Sep 26 14:29:19 2025";
// original file: Text/Lat/QuadBin.text, line: 646
// Example: H35E1 ()
print "Example: H35E1";
ei := GetEchoInput();
SetEchoInput(true);
Q<z> := QuadraticField(7537543);                        // arbitrary choice
Q := QuadraticForms(Discriminant(Q));
C, m := ClassGroup(Q);
C;
                                   // get the generators as quadratic forms:
f := m(C.1);
g := m(C.2);
h := g^2;
g, h;
c := [];                     // create the cycle of forms equivalent to g^2:
repeat 
    h := ReductionStep(h);
    Append(~c, h);
until h eq g^2;
P := Parent(g);
Identity(P) in c;
for d in Divisors(76) do
    c := [];
    h := f^d;
    repeat h := ReductionStep(h); Append(~c, h);
    until h eq f^d;
    d, Identity(P) in c, #c;
end for;
SetEchoInput(ei);
