Skip to content

Commit c09f0af

Browse files
committed
Avoid BaseChangeHomomorphism
It induces unnecessary overhead
1 parent 386c895 commit c09f0af

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

gap/Forms.gi

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ end);
2626
# appropriate field.
2727
InstallGlobalFunction("ConjugateToSesquilinearForm",
2828
function(group, type, gramMatrix)
29-
local gapForm, newForm, gapToCanonical, canonicalToNew, field, formMatrix,
29+
local gapForm, newForm, baseChangeMatrix, field, formMatrix,
3030
result, d, q, broadType;
3131
if not type in ["S", "O-B", "O-Q", "U"] then
3232
ErrorNoReturn("<type> must be one of 'S', 'U', 'O-B', 'O-Q'");
@@ -82,12 +82,9 @@ function(group, type, gramMatrix)
8282
ErrorNoReturn("The form preserved by <group> must be similar to the form ",
8383
"described by the Gram matrix <gramMatrix>.");
8484
fi;
85-
gapToCanonical := BaseChangeHomomorphism(BaseChangeToCanonical(gapForm),
86-
field);
87-
canonicalToNew := BaseChangeHomomorphism(BaseChangeToCanonical(newForm) ^ (-1),
88-
field);
89-
result := MatrixGroup(field, canonicalToNew(gapToCanonical(GeneratorsOfGroup(group))));
90-
85+
baseChangeMatrix := BaseChangeToCanonical(gapForm)^-1 * BaseChangeToCanonical(newForm);
86+
result := MatrixGroup(field, List(GeneratorsOfGroup(group), g -> g ^ baseChangeMatrix));
87+
9188
# Set useful attributes
9289
UseIsomorphismRelation(group, result);
9390
else

0 commit comments

Comments
 (0)