Ask Your Question

Revision history [back]

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

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.

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

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

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

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:

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. useful.