Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to find the norm of a quaternion?

︠ N.<a1,a2,a3,a4,b1,b2,b3,b4,a,b> = QQ[] H.<i,j,k> = QuaternionAlgebra(Frac(N),-1,-1) p = a1 + a2 * i + a3 * j + a4 * k q = b1 + b2 * i + b3 * j + b4 * k r=(1-a-2b)(1-pq+ap) r.norm()

click to hide/show revision 2
None

How to find the norm of a quaternion?

EDIT︠ED: (never start with the code, always put the wanted question also in the posted question, not only in the title.)

N.<a1,a2,a3,a4,b1,b2,b3,b4,a,b> = QQ[]
 H.<i,j,k> = QuaternionAlgebra(Frac(N),-1,-1)
 p = a1 + a2 * i + a3 * j + a4 * k
 q = b1 + b2 * i + b3 * j + b4 * k
    r=(1-a-2b)(1-pq+ap)
    r.norm()

r=(1-a-2*b)*(1-p*q+a*p) r.norm()