# exp of quaternion

I try

Q.<i,j,k> = QuaternionAlgebra(SR, -1, -1)
exp(x+i*x+j*x+k*x)


I get

TypeError: cannot coerce arguments: no canonical coercion from Quaternion Algebra (-1, -1) with base ring Symbolic Ring to Symbolic Ring

what means "-1,-1"? How to expand as demoivre() this?

edit retag close merge delete

Sort by ยป oldest newest most voted

You can construct very general quaternion algebras in Sage, and the command QuaternionAlgebra(QQ, 2, 3) would construct an algebra with base field the rationals, with elements i and j such that i^2=2 and j^2=3. You've constructed a quaternion algebra over the "symbolic ring" SR with elements i and j such that i^2 = j^2 = -1.

Maybe because they are constructible in such generality, exponentials are not implemented for them. You can just use the formula on the wikipedia page (https://en.wikipedia.org/wiki/Quatern...). General quaternion algebras have their own wikipedia page, too: https://en.wikipedia.org/wiki/Quatern....

more

I have used quaternions a few times perhaps here notebooks could provide some guidance.

http://alan.atstafford.co.uk/Penrose/...

http://alan.atstafford.co.uk/Twistor....

more