"Source: Text/Group/GrpAb.text";
"Line: 789";
"Date: Thu Sep 25 14:47:45 2025";
"Main: Fri Sep 26 14:29:19 2025";
// original file: Text/Group/GrpAb.text, line: 789
// Example: H77E7 ()
print "Example: H77E7";
ei := GetEchoInput();
SetEchoInput(true);
n := 6;
Dk := -4*(10^n + 1);
Q := QuadraticForms(Dk);   

p := 2;
S := {};
while #S lt 10 do 
   if KroneckerSymbol(Dk,p) eq 1 then
      I := Reduction(PrimeForm(Q,p));
      Include(~S, I);
   end if; 
   p := NextPrime(p);
end while;

QF := GenericAbelianGroup(Q : UserGenerators := S,
                                 ComputeStructure := true,
                                 UseUserGenerators := true);  
dummy := AbelianGroup(QF);
Generators(QF);
g := QF ! [5, 6];
g;
Representation(g);

g := Random(QF);
Representation(g);

UserRepresentation(g);
S := [];
for i in [1..3] do
    d := Random(QF);
    Include(~S, d);
end for;
seq, coeff := Representation(S, g);
seq; coeff;
SetEchoInput(ei);
