From eed628a7a2fb1b7880b0a048a8e4b70d68bd8780 Mon Sep 17 00:00:00 2001 From: ThomasBreuer Date: Tue, 23 Oct 2018 13:00:19 +0200 Subject: [PATCH] fixed `ImaginaryPart` for quaternion algebras --- lib/algsc.gi | 5 +++-- tst/testinstall/algsc.tst | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/algsc.gi b/lib/algsc.gi index d6b86bee22..94496b44d4 100644 --- a/lib/algsc.gi +++ b/lib/algsc.gi @@ -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 ); diff --git a/tst/testinstall/algsc.tst b/tst/testinstall/algsc.tst index a55ee7d8f8..f2b841e00f 100644 --- a/tst/testinstall/algsc.tst +++ b/tst/testinstall/algsc.tst @@ -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})$