// Attach the library containing the new version
Attach("local_square_classes.m");

// Define the number field 
// LMFDB 30.0.53154657266426257642795590413722745409780564057387056395976704.1
Qx<x> := PolynomialRing(Rationals());
K<t> := NumberField(x^30 + 98*x^28 + 3977*x^26 + 88668*x^24 + 1211568*x^22 + 10707886*x^20 + 62933870*x^18 + 248692167*x^16 + 659045418*x^14 + 1153231620*x^12 +     1294105343*x^10 + 889400042*x^8 + 347294458*x^6 + 66308517*x^4 + 4169007*x^2 + 44521);
p :=  PrimeFactorization(K, 2)[1][1];

print "Use the built-in method...";
time G, mG := LocalMultiplicativeGroupModSquares(p);
print "Use the new method...";
time H, mH := LocalGroupOfSquaresClasses(p);

// Construct the two change-of-basis matrices
// and verify that they are inverses of each other.
// This proves that the two groups are equal.
printf "Verify the correctness... ";
M := Matrix([ h @ mH @@ mG : h in Basis(H) ]);
N := Matrix([ g @ mG @@ mH : g in Basis(G) ]);
printf IsOne(M*N) select "done" else "FAILED!";
quit;

