Skip to content

Commit

Permalink
Merge pull request #2938 from ThomasBreuer/TB_RealPart
Browse files Browse the repository at this point in the history
fixed `ImaginaryPart` for quaternion algebras
  • Loading branch information
ThomasBreuer authored Oct 24, 2018
2 parents 1fe546e + eed628a commit 26b88ca
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/algsc.gi
Original file line number Diff line number Diff line change
Expand Up @@ -884,11 +884,12 @@ InstallMethod( ImaginaryPart,
"for a quaternion",
[ IsQuaternion and IsSCAlgebraObj ],
function( quat )
local v, z;
local v, z, a;

v:= ExtRepOfObj( quat );
z:= Zero( v[1] );
return ObjByExtRep( FamilyObj( quat ), [ v[2], z, v[4], -v[3] ] );
a:= FamilyObj( quat )!.sctable[2][2][2][1]; # the first parameter
return ObjByExtRep( FamilyObj( quat ), [ v[2], z, -v[4], -v[3]/a ] );
end );


Expand Down
16 changes: 16 additions & 0 deletions tst/testinstall/algsc.tst
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,22 @@ gap> v:= Subspace( a, [ v, 0*v, v^0, w ] );
gap> Dimension( v );
3

#
gap> a:= QuaternionAlgebra( Rationals, -2, -3 );;
gap> gens:= GeneratorsOfAlgebra( a );
[ e, i, j, k ]
gap> List( gens, RealPart );
[ e, 0*e, 0*e, 0*e ]
gap> List( gens, ImaginaryPart ) * gens[2];
[ 0*e, i, j, k ]
gap> vecs := Concatenation( gens, [ Sum( gens ) ] );
[ e, i, j, k, e+i+j+k ]
gap> ForAll( vecs, v -> (v + ComplexConjugate( v )) / 2 = RealPart( v ) );
true
gap> ForAll( vecs, v -> (v - ComplexConjugate( v )) / (2*gens[2])
> = ImaginaryPart( v ) );
true

#############################################################################
##
## Expl. 1: $2.A6$, gen. by 20 quaternionic reflections over $H(\sqrt{3})$
Expand Down

0 comments on commit 26b88ca

Please sign in to comment.