ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 15 Mar 2018 18:57:36 +0100Dual Quaternion Algebrahttps://ask.sagemath.org/question/41571/dual-quaternion-algebra/Hello,
I'm quite new to SAGE.
I need to work with the algebra of dual quaternions. It can be defined in two equivalent ways:
1. The algebra of quaternions over the dual numbers. Dual numbers are elements of the form a+be where a and b are real and e is such that e^2=0.
2. The algebra of polynomials over the quaternions and variable e modulo e^2.
For the first definition I tried to do this:
P.<e>=PolynomialRing(RR)
S.<e>=P.quo(e*e);
F.<I,J,K> = QuaternionAlgebra(S, -1,-1)
For some reason this doesn't work. What is the best way to define this Dual Quaternion Algebra in SAGE ?
Thank you for your help!TdguerreiroThu, 15 Mar 2018 18:57:36 +0100https://ask.sagemath.org/question/41571/Computing in a quaternion algebra over a complex field?https://ask.sagemath.org/question/31808/computing-in-a-quaternion-algebra-over-a-complex-field/ If I enter
Q.<i,j,k> = QuaternionAlgebra(CC,1,1)
there is no problem. I can then type something like
(2+i+j)*(3*i-j)
and get the appropriate answer
2.00000000000000 + 6.00000000000000*i + (-2.00000000000000)*j + (-4.00000000000000)*k
The problem comes when I want to use non-real numbers. If I type
i*sqrt(-1)
then I get
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-1-0b500ba4930f> in <module>()
1 Q = QuaternionAlgebra(CC,Integer(1),Integer(1), names=('i', 'j', 'k',)); (i, j, k,) = Q._first_ngens(3)
----> 2 i*sqrt(-Integer(1))
/home/sc_serv/sage/local/lib/python2.7/site-packages/sage/structure/element.so in sage.structure.element.RingElement.__mul__ (/home/sc_serv/sage/src/build/cythonized/sage/structure/element.c:17265)()
/home/sc_serv/sage/local/lib/python2.7/site-packages/sage/structure/coerce.so in sage.structure.coerce.CoercionModel_cache_maps.bin_op (/home/sc_serv/sage/src/build/cythonized/sage/structure/coerce.c:9721)()
TypeError: unsupported operand parent(s) for '*': 'Quaternion Algebra (1.00000000000000, 1.00000000000000) with base ring Complex Field with 53 bits of precision' and 'Symbolic Ring'
As a matter of fact, something similar happens if I type
i*sqrt(2)
which is not imaginary... I also tried typing
I*i
and got a similar error message. Since I am supposedly working in the quaternion algebra over the complex numbers, how do I specify arbitrary complex coefficients?j0equ1nnWed, 23 Dec 2015 18:15:45 +0100https://ask.sagemath.org/question/31808/