"Source: Text/Group/GrpAb.text";
"Line: 1018";
"Date: Thu Sep 25 14:47:45 2025";
"Main: Fri Sep 26 14:29:19 2025";
// original file: Text/Group/GrpAb.text, line: 1018
// Example: H77E9 ()
print "Example: H77E9";
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);  
_ := AbelianGroup(QF);
GetSeed();
S := [];
for j in [1..2] do
    P := Random(QF);
    Include(~S, P);
end for;
S;
QF1 := sub< QF | S>;
QF1;

SetEchoInput(ei);
