Dear GAP Forum,
Nicola Sottocornola wrote
let Q be the following quaternions field
Indeterminate(Rationals,"x");;
p:=UnivariatePolynomial(Rationals,[3/4,0,-1],1);;
e:=FieldExtension(Rationals,p);;
Q:=QuaternionAlgebra(e);
b:=BasisVectors(Basis(Q));Is there a function f computing the norm of a quaternion?
I mean f( a b[1] + b b[2] + c b[3] + d b[4] ) = a^2 +b^2 +c^2 + d^2.
There is no GAP library function for that.
However, the following function will do the job.
NormQuat := function( quat ) if not IsQuaternion( quat ) then Error( "<quat> must be a quaternion" ); fi; return Sum( List( ExtRepOfObj( quat ), c -> c^2 ) ); end;
I hope this helps,
Thomas