solving for the center of the real quaternions
I'm trying out Sage on quaternions, on the problem of finding the center of the real Hamiltonian quaternions $\mathbb{H}$. So what I tried was:
Q.<i,j,k> = QuaternionAlgebra(SR, -1, -1)
a1, b1, c1, d1 = SR.var('a1, b1, c1, d1', domain = RR)
a2, b2, c2, d2 = SR.var('a2, b2, c2, d2', domain = RR)
q1 = a1 + b1*i + c1*j + d1*k
q2 = a2 + b2*i + c2*j + d2*k
solve(q1*q2 - q2*q1, a1, b1, c1, d1)
which rewarded me with:
TypeError Traceback (most recent call last)
<ipython-input-6-8a6c0ff8f7d0> in <module>()
9 q2 = a2 + b2*i + c2*j + d2*k
10
---> 11 solve(q1*q2 - q2*q1, [a1, b1, c1, d1])
/home/sage/sage/local/lib/python3.7/site-packages/sage/symbolic/relation.py in solve(f, *args, **kwds)
1045
1046 if not isinstance(f, (list, tuple)):
-> 1047 raise TypeError("The first argument must be a symbolic expression or a list of symbolic expressions.")
1048
1049 # f is a list of such expressions or equations
TypeError: The first argument must be a symbolic expression or a list of symbolic expressions.
Well, OK, that's not a symbolic expression:
sage: type(q1*q2 - q2*q1)
<class 'sage.algebras.quatalg.quaternion_algebra_element.QuaternionAlgebraElement_generic'>
At least this looks right:
sage: q1*q2 - q2*q1
((c1 - d1)*(c2 + d2) - (c1 + d1)*(c2 - d2))*i + (2*b2*d1 - 2*b1*d2)*j + (-(a2 + b2)*(c1 + d1) + (a2 - b2)*(c1 + d1) + (a1 + b1)*(c2 + d2) - (a1 - b1)*(c2 + d2) + 2*b2*d1 - 2*b1*d2)*k
I can figure out the answer from the last line, but was hoping for something like $b_1 = c_1 = d_1 = 0$. Not sure how this works.
update: Updated to Sage 9.1.
Which version of sage ? Latest develop 9.4.beta1 says
@FrédéricC: Sage 8.6. Looks like I should upgrade by running the Docker image.
OK, yeah, I get that response now with the 9.1 image. Updated the question. 👍