# quaternion-valued differential forms

I'm trying to define quaternion-valued differential forms in Sage. For example, take $e_0$, $e_1$, $e_2$, $e_3$ to be the quaternion generators and $d x^0$, $d x^1$, $d x^2$, $d x^3$ be the generators of the exterior algebra. So for example I'd like to be able to compute $d X \wedge d X^\dagger$, where $d X = e_0 d x^0 + e_1 d x^1 + e_2 d x^2 + e_3 d x^3$, $d X^\dagger = e_0 d x^0 - e_1 d x^1 - e_2 d x^2 - e_3 d x^3$.

Edit: I tried taking a tensor product between an exterior algebra and a quaternion algebra

sage: ext_alg.<x0,x1,x2,x3> = ExteriorAlgebra(QQ)
sage: ext_alg in Algebras(QQ)
True
sage: quat_alg = QuaternionAlgebra(QQ,-1,-1)
sage: quat_alg in Algebras(QQ)
True
sage: tensor((ext_alg, quat_alg))  # this doesn't work!
edit retag close merge delete

Sort by » oldest newest most voted

This seems to work fine:

sage: quat_alg = QuaternionAlgebra(QQ,-1,-1)
sage: ext_alg.<x0,x1,x2,x3> = ExteriorAlgebra(quat_alg)
sage: x = x0+x1*i+x2*j+x3*k
sage: x_dag = x0-x1*i-x2*j-x3*k
# now some computations
sage: x*x_dag
-2*i*x0^x1 - 2*j*x0^x2 - 2*k*x0^x3 - 2*k*x1^x2 + 2*j*x1^x3 - 2*i*x2^x3
sage: x*x_dag*x
-6*k*x0^x1^x2 + 6*j*x0^x1^x3 - 6*i*x0^x2^x3 + 6*x1^x2^x3
sage: x*x_dag*x*x_dag
-24*x0^x1^x2^x3
more