load "QuatRefCode.m";

"Checking qDC(m,ell,r) for m in [1..12]";
time for m := 1 to 12 do
  for ell in Divisors(2*m) do
    for r in qValidParametersDC(m,ell) do
      assert #qDC(m,ell,r) eq 8*m*ell;
end for; end for; end for;

"Checking qDD(m,ell) for m in [2..12]";
time for m := 2 to 12 do
  assert #qDD(m,m) eq 32*m^2;
  assert #qDD(2*m,m) eq 64*m^2;
end for;

gpsT := [qTT,qTD2d,qTC2d,qTC1d];
ordT := [1152,384,96,48];
gpsO := [qOO,qOT,qOD2,qOC2,qOC1b,qOC1d];
ordO := [4608,2304,768,192,96,96];
gpsI := [qII,qIC2,qIC2t,qIC1t,qIC1j];
ordI := [28800,480,480,240,240];

"Checking binary tetrahedral types";
time for n -> gp in gpsT do assert #gp() eq ordT[n]; end for;

"Checking binary octahedral types";
time for n -> gp in gpsO do assert #gp() eq ordO[n]; end for;

"Checking binary icosahedral types";
time for n -> gp in gpsI do assert #gp() eq ordI[n]; end for;

"Checking qmuT";
time for d in [6,12,18,24] do assert #qmuT(d) eq 24*d; end for;

"Checking qmuO";
time for d in [4..24 by 4] do assert #qmuO(d) eq 48*d; end for;

"Checking qmu2O";
time for d in [4,8,12,20,24] do assert #qmu2O(d) eq 24*d; end for;

"Checking qmuI";
time for d in [4,6,8,10,12] do assert #qmuI(d) eq 120*d; end for;

"Checking G_n(T,T) for n in [2..8]";
T := qT();
time for n := 2 to 8 do #qImprimitive(T,T,n) eq #T^n*Factorial(n); end for;

"Checking G_n(O,T) for n in [2..8]";
O := qT(); T := sub< O | O.1, O.2^2 >;
time for n := 2 to 8 do #qImprimitive(O,T,n) eq #O^(n-1)*#T*Factorial(n); end for;

"Group  order #reflections";
gpsPrim := [qqO1,qqO2,qqO3,qqP1,qqP2,qqP3,qqQ,qqR,qqS1,qqS2,qqS3,qqT,qqU];
gpName := ["W(O1)","W(O2)","W(O3)","W(P1)","W(P2)","W(P3)",
   "W(Q) ","W(R) ","W(S1) ","W(S2)","W(S3)","W(T) ","W(U) "];
time for n -> gp in gpsPrim do
  G := gp();
  rr := reflections(G);
  n, gpName[n], #G, #rr;
end for;

