Ah, you found an interesting bug in integrate_by_parts
in the code which compares indices with object patterns (e.g. a??
) or name patterns (e.g. a?
). It's fixed now on github (version 2.3.1.6).
Here's a slight fix of your code, which does the right thing:
{A,B,C,D,E,F,F#}::Indices(full);
{a,b,c,d,e,f,f#}::Indices(space1);
{m,n,o,p,q,r,r#}::Indices(space2);
\partial{#}::PartialDerivative.
\delta{#}::Accent.
F_{A B C}::AntiSymmetric.
F_{a b c}::AntiSymmetric.
F_{m n p}::AntiSymmetric.
F_{#}::Depends(\partial{#}).
ex:=\int{ c_{0} \partial_{a d}{ \delta{F_{a b c}}} F_{d b c}
+ 2 c_{1} \partial_{a c}{ \delta{F_{m a b}}} F_{m c b} }{x};
integrate_by_parts(ex, $\partial_{n?}{\delta{F_{m? a b}}}$)
So to elaborate on those index patterns: There are two ways in which you can write patterns with indices. If you use, in integrate_by_parts
, a pattern
\partial_{a}{\delta{F_{m b c}}}
then this will only match a term in which the index on the derivative comes from the space1
set, and the three indices on the F
tensor come from space2
, space1
and space1
respectively. So in other words, if you write a pattern with indices, then they will match indices from the same set only. As it stands, this pattern would only match your 2nd term (the one multiplying c_{1}
).
If you use name patterns, or object patterns, then these will match name or any object. So if you write
\partial_{a}{\delta{F_{m? b c}}}
then this matches both of your terms, because m?
can match any name (the fact that it is called m
followed by a question mark makes no difference, it does not mean that this object needs to come from the space2
set).
The #
pattern means 'any number of child nodes' and is a very generic pattern. Rarely useful inside a substitute
or integrate_by_parts
because you cannot use it on the right-hand side.
Hope this helps; if not, please ask again.