On Monday, October 21, 2013 9:24:15 PM UTC+2, Aaron Meurer wrote:
>
>
> I don't know. You'll have to try it. Also try using xreplace and 
> sympy.core.rules.Transform. I'm becoming convinced that those two make 
> complex replacement more elegant and readable than any other combination of 
> functions currently in SymPy. 
>
> Aaron Meurer
>

Well, the problem with that is that tensor expressions are somewhat 
complex, for example consider:

pattern: A(m1, m2)*B(-m2)

on the expr: C(d0)*A(d1, d2)*D(d3)*B(-d2)*A(d4, d5)*B(-d4)

supposing that A has no symmetries on its indices, and that only components 
have to be matched exactly, the pattern should match A(d1, d2)*B(-d2) only.

Another problem is that indices are not associated with components anymore 
when they're inside a tensor expression. They are not part of the component 
args tree. I don't know how to match A(d1, d2) with a tree-search, as its 
pattern in the args tree won't be found anymore in a complex tensor 
expression, even if it exists.

I'm more and more convinced that the tensor module needs a pattern matching 
and replacement algorithm just for itself.

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to