Why is addition between a symbol and a Clifford algebra element unsupported?

asked 2023-12-15 22:20:13 +0100

scottviteri gravatar image

updated 2023-12-15 23:15:30 +0100

To reproduce error:

from sage.algebras.clifford_algebra import CliffordAlgebra; 
from sage.quadratic_forms.quadratic_form import QuadraticForm; 
from sage.rings.rational_field import QQ

QF = QuadraticForm(QQ, 3, [1, 0, 0, 1, 0, 1]);
Cl.<e1,e2,e3> = CliffordAlgebra(QF);
i = var('i');
print(i*e1)

Error:

File ~/LocalSoftware/sage/src/sage/structure/coerce.pyx:1276, in sage.structure.coerce.CoercionModel.bin_op()
   1274     # We should really include the underlying error.
   1275     # This causes so much headache.
-> 1276     raise bin_op_exception(op, x, y)
   1277 
   1278 cpdef canonical_coercion(self, x, y) noexcept:

TypeError: unsupported operand parent(s) for *: 'Symbolic Ring' and 'The Clifford algebra of the Quadratic form in 3 variables over Rational Field with coefficients: 
[ 1 0 0 ]
[ * 1 0 ]
[ * * 1 ]'

Question: How does symbolic computation work under the hood in sage? Does this problem exist for elements of other algebras as well?

My actual objective: I would like to derive the trigonometric parametrization for the sphere by apply the rotor of e1e2 and the rotor of e2e3 to e1, but to do so I would need to keep the two angles symbolic. Of course I could derive the answer by hand, but I am trying to get feel for where SageMath is useful.

edit retag flag offensive close merge delete

Comments

1

Like this

sage: QF = QuadraticForm(SR, 3, [1, 0, 0, 1, 0, 1]);
....: Cl.<e1,e2,e3> = CliffordAlgebra(QF);
....: i = var('i');
....: print(i*e1)
i*e1
FrédéricC gravatar imageFrédéricC ( 2023-12-16 09:17:47 +0100 )edit

Great, thank you

scottviteri gravatar imagescottviteri ( 2023-12-17 22:26:00 +0100 )edit