Given the matrix F of a bilinear or sesquilinear form, the functions described in the previous section can be used to construct classical groups which preserve F or preserve F up to a scalar.
Similar code can be used to construct the orthogonal group and the conformal orthogonal group preserving a quadratic form or the unitary group and conformal unitary group preserving an hermitian form.
However, to construct a group strictly between the isometry group and the similarity group of a form some more work is needed. The following example illustrates how this may be carried out for an hermitian form.
> F := Matrix(GF(5),4,4,[0,-1,-1,1, 1,0,1,-1, 1,-1,0,1, -1,1,-1,0]); > V := SymplecticSpace(F); > G := IsometryGroup(V); > C := SimilarityGroup(V); > f1, _ := IsIsomorphic(G,Sp(4,5)); > f2, _ := IsIsomorphic(C,CSp(4,5)); > f1, f2; true trueIf only the symplectic group is needed this can be obtained on one line
> G := IsometryGroup(SymplecticSpace(F));
> specialUnitaryGrp := function(F) > K := BaseRing(F); n := NumberOfRows(F); > J, sigma := StandardHermitianForm(n,K); > V := UnitarySpace(F,sigma); > S := UnitarySpace(J,sigma); > flag, phi := IsIsometric(S,V); > assert flag; > T := Matrix(K,n,n,[phi(S.i) : i in [1..n]]); > H := SpecialUnitaryGroup(n,K); > return sub<IsometryGroup(V) | [T^-1*H.i*T : i in [1..NumberOfGenerators(H)]]>; > end function;
To complete the example we define an hermitian form F and then use the above function to find the special unitary group that preserves F.
> K<z> := GF(9); > F := Matrix(K,4,4,[1,z^7,z^6,2, z^5,2,z^6,z^6, z^2,z^2,1,z^3, 2,z^2,z,0]); > G := specialUnitaryGrp(F); > flag where flag is IsIsomorphic(G,SU(4,3)); true