To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/f0b5dcbe-6a3c-4d36-8e0c-e6f7c9de2d1d%40googlegroups.com.--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
What level of symbolics would you expect from the module? Would you expect to be able to represent something like i*j unevaluated,
Also, consider that we don't have a class for complex numbers, we just define the imaginary unit and then complex numbers are managed by additions and multiplications. Maybe we should proceed by just adding J and K and defining their behavior.
What do you think?
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/cddb5d11-869f-4b7e-aa70-859bf71c3d73%40googlegroups.com.
You can try this, but I foresee problems reusing I=sqrt(-1) the complex number as i the quaternion. Mathematically they aren't the same thing, but even in terms of SymPy, ImaginaryUnit is burdened with things like assumptions, which might cause issues with quaternions.
And maybe even you could do something with the Mul processors to make them auto-simplify, if that's what is desired.
On Friday, 4 August 2017 17:34:25 UTC-4, Aaron Meurer wrote:You can try this, but I foresee problems reusing I=sqrt(-1) the complex number as i the quaternion. Mathematically they aren't the same thing, but even in terms of SymPy, ImaginaryUnit is burdened with things like assumptions, which might cause issues with quaternions.
Implementing quaternions should be simple. Deciding how they interact with the rest of SymPy may be more complicated.
And maybe even you could do something with the Mul processors to make them auto-simplify, if that's what is desired.
I would suggest an immediate evaluation in this case.
Maybe a Quaternion class is the simplest way to implement quaternions.
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/803df12b-57f4-4f3c-a82e-f7cdbf95d9d9%40googlegroups.com.
On Fri, Aug 4, 2017 at 6:19 PM, Francesco Bonazzi <franz....@gmail.com> wrote:
On Friday, 4 August 2017 17:34:25 UTC-4, Aaron Meurer wrote:You can try this, but I foresee problems reusing I=sqrt(-1) the complex number as i the quaternion. Mathematically they aren't the same thing, but even in terms of SymPy, ImaginaryUnit is burdened with things like assumptions, which might cause issues with quaternions.
Implementing quaternions should be simple. Deciding how they interact with the rest of SymPy may be more complicated.If you implement them like Ondrej suggested, as a 4-tuple, they will interact badly. Even just adding a scalar to a quaternion will be difficult to make work, as the scalar x would have to be converted to (x, 0, 0, 0) first.On the other hand, if the quaternions i, j, and k are just special noncommutative expressions, then they will interact just fine, because SymPy already knows how to deal with noncommutative expressions. The only hard thing will be making things like i**2 and i*j auto-simplify (if desired). The former can be done with _eval_power, and the latter with Mul postprocessors.
And maybe even you could do something with the Mul processors to make them auto-simplify, if that's what is desired.
I would suggest an immediate evaluation in this case.
Maybe a Quaternion class is the simplest way to implement quaternions.What do you mean by a Quaternion class? Are you thinking something more like my or Ondrej's suggestion?
Some possible extensions remain:
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscribe@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/306a9ea8-8d59-4535-8f9e-35f7b245d696%40googlegroups.com.