Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify tests for quadratic field sizes #42

Merged
merged 1 commit into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/correlations.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1648,7 +1648,7 @@
if Rank(matrix) <> NrRows(matrix) then
Error("<matrix> must not be singular");
fi;
if not IsInt(Sqrt(Size(field))) then
if IsOddInt(DegreeOverPrimeField(field)) then

Check warning on line 1651 in lib/correlations.gi

View check run for this annotation

Codecov / codecov/patch

lib/correlations.gi#L1651

Added line #L1651 was not covered by tests
Error("Size of <field> must be a square" );
fi;
form := HermitianFormByMatrix(matrix,field);
Expand Down
6 changes: 3 additions & 3 deletions lib/enumerators.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1580,7 +1580,7 @@ InstallGlobalFunction( HermElementNumber,
a2 := a - 1;
v := ListWithIdenticalEntries(d+1,Z(q)^0);
n := Int((d+1) / 2);
FG_herm_Sbar_unrank(RootInt(q,2),v,1,d+1,a2);
FG_herm_Sbar_unrank(Sqrt(q),v,1,d+1,a2);
return v;
end );

Expand All @@ -1594,11 +1594,11 @@ InstallGlobalFunction( HermNumberElement,
v := StructuralCopy(var!.obj);
y := v[PositionNonZeroFromRight(v)];
if IsOddInt(q) then
y := y/(Z(q)^((RootInt(q,2)-1)/2)); #Strange Anton normalization...
y := y/(Z(q)^((Sqrt(q)-1)/2)); #Strange Anton normalization...
fi;
v := v/y;
#wittindex := (d+1)/2;
a := FG_herm_Sbar_rank(RootInt(q,2), v, 1, d+1);
a := FG_herm_Sbar_rank(Sqrt(q), v, 1, d+1);
return a + 1; ## adjustment for lists beginning at 1
end );

Expand Down
2 changes: 1 addition & 1 deletion lib/gpolygons.gi
Original file line number Diff line number Diff line change
Expand Up @@ -3577,7 +3577,7 @@
nonsquares := Difference(AsList(GF(q)),squares);;
n := First(nonsquares, t -> t-1 in squares);

zeta := PrimitiveRoot(GF(q^2));
zeta := Z(q^2);

Check warning on line 3580 in lib/gpolygons.gi

View check run for this annotation

Codecov / codecov/patch

lib/gpolygons.gi#L3580

Added line #L3580 was not covered by tests
omega := zeta^(q+1);
i := zeta^((q+1)/2);
z := zeta^(q-1);
Expand Down
2 changes: 1 addition & 1 deletion lib/group.gi
Original file line number Diff line number Diff line change
Expand Up @@ -2379,7 +2379,7 @@ InstallMethod( CanonicalGramMatrix,

# Unitary Gram matrix
elif type = "hermitian" then
if IsOddInt(PrimePowersInt(Size(f))[2]) then
if IsOddInt(DegreeOverPrimeField(f)) then
Error("field order must be a square");
fi;
m := IdentityMat(d, f);
Expand Down
2 changes: 1 addition & 1 deletion lib/polaritiesps.gi
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ InstallMethod(HermitianPolarityOfProjectiveSpace,
if Rank(matrix) <> NrRows(matrix) then
Error("<matrix> must not be singular");
fi;
if not IsInt(Sqrt(Size(field))) then
if IsOddInt(DegreeOverPrimeField(field)) then
Error("Size of <field> must be a square" );
fi;
form := HermitianFormByMatrix(matrix,field);
Expand Down
6 changes: 3 additions & 3 deletions lib/polarspace.gi
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ InstallMethod( HermitianPolarSpace,
[ IsPosInt, IsField ],
function( d, f )
local h,m,types,max,reps,q,creps,degree;
if PrimePowersInt(Size(f))[2] mod 2 <> 0 then
if IsOddInt(DegreeOverPrimeField(f)) then
Error("field order must be a square");
return;
fi;
Expand Down Expand Up @@ -2141,9 +2141,9 @@ InstallMethod( NumberOfTotallySingularSubspaces,
elif type = "hyperbolic" then e:= 0; qe := q^e;
elif type = "parabolic" or type = "symplectic" then e:=1; qe := q^e;
elif type = "hermitian" and IsEvenInt(ps!.dimension) then e:=3;
qe := RootInt(q,2)^e;
qe := Sqrt(q)^e;
elif type = "hermitian" and IsOddInt(ps!.dimension) then e:=1;
qe := RootInt(q,2)^e;
qe := Sqrt(q)^e;
else Error("Polar space doesn't know its type!");
fi;

Expand Down
2 changes: 1 addition & 1 deletion lib/projectivespace.gi
Original file line number Diff line number Diff line change
Expand Up @@ -2225,7 +2225,7 @@
fi;
geo := AmbientSpace(x);
gfq2 := geo!.basefield;
if RootInt(Size(gfq2),2)^2 <> Size(gfq2) then
if IsOddInt(DegreeOverPrimeField(gfq2)) then

Check warning on line 2228 in lib/projectivespace.gi

View check run for this annotation

Codecov / codecov/patch

lib/projectivespace.gi#L2228

Added line #L2228 was not covered by tests
Error( "the order of the basefield must be a square" );
fi;
gfq := GF(Sqrt(Size(gfq2)));
Expand Down