As it stands now, for building symbolic systems different from simple
combinations of functions of and operators on mostly commutative
symbols, one needs to subclass Expr and/or add more stuff to Mul, Add,
etc.

Examples: MatrixSymbol and Quantum subclass Expr. Units adds stuff to
Mul and Add.

It seems that this is not sustainable because
1. Adding too much stuff to Mul and Add
https://code.google.com/p/sympy/issues/detail?id=1941
2. Mixing subclasses of Expr can give strange results.

A solution that I like is working on AST trees. See
https://groups.google.com/d/msg/sympy/fCQEdSQybTM/X04kBhbIEGUJ

It is possible that I will need much of this functionality if I
proceed to apply for GSoC with a multi-linear algebra / differential
geometry project.

A first step (that I have requested a few months ago, when I was
working on lambdify) will be to at least have a nice api for
traversing all args. I have asked for that here
https://groups.google.com/d/topic/sympy/Pa3k3WETPC0/discussion

So I plan to add methods that take evaluate=False expressions and
generate the syntax tree (in the form of tuples at first, something
more pythonic later). And also add other methods that work with those
syntax trees (validation, canonicalization).

In one sentence, at the moment Add and Mul and others are both
containers and canonicalizators (if this word exists :). I want to
have them separate, so different canonicalizators can be used on the
same expr (real algebra vs quantum module vs multilinear vs group
theory vs any other system that works on symbols).

This means that at least at the beginning Add, Mul, etc will be used
as they are now - both containers and canonicalizators for the real
algebra that sympy supports, but at the same time they will be used
with evaluate=False as only containers for other symbolic systems.

@Nathan Rice, If I understand correctly, your idea is to have the
entire core of sympy working in that manner. Am I correct? Do you have
some proof of concept code?

@community, Is this an acceptable solution for the possible future
work on Expr and in my case on multi-linear algebra?

@Aaron and community, has this been discussed before? Was there
something about different base algebra systems?

Stefan

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to