asc-community / AngouriMath

New open-source cross-platform symbolic algebra library for C# and F#. Can be used for both production and research purposes.
https://am.angouri.org
MIT License
782 stars 74 forks source link

Support cross and dot on arbitrary entities #105

Open Happypig375 opened 4 years ago

Happypig375 commented 4 years ago

They should special-case tensors on simplification while treating other entities as normal multiplication.

WhiteBlackGoose commented 4 years ago

What's the point of doing that? Why is it needed at all?

Happypig375 commented 4 years ago

When parsing an expression involving matrices and vectors, an entity tree is built. Vector addition will be transformed to an OperatorEntity with the operation being Add. However, currently, the CrossProduct and DotProduct methods do not accept anything other than a Tensor directly. This makes it impossible to transform an expression first involving addition then a cross product. The difference between Cross and Mutiply is that Cross is non-commutative so simplifications involving commutativity will not apply.

WhiteBlackGoose commented 4 years ago

We will add them as separate nodes. Probably, later than 1.2.3