First time here? Check out the FAQ!
answered 12 years ago
You should define Q as a QuaternionAlgebra over the symbolic ring SR instead of over the rationals:
Q
SR
sage: Q.<i,j,k> = QuaternionAlgebra(SR, -1, -1) sage: q = a*i + b*j + c*k sage: q a*i + b*j + c*k sage: q^2 -a^2 - b^2 - c^2