kpeeters / cadabra2

A field-theory motivated approach to computer algebra.
https://cadabra.science/
GNU General Public License v3.0
223 stars 37 forks source link

eliminate_kronecker (and possibly others) do not cleanup on all parts of a touched expression #69

Closed kpeeters closed 6 years ago

kpeeters commented 6 years ago

Example:

\delta{#}::KroneckerDelta;
{r,s,t}::Indices(position=fixed);
\partial{#}::PartialDerivative;
ex:=\partial^{r}{a} \partial_{r}{a};
substitute(ex, $\partial^{r}{a} = \delta^{r}_{0} \partial^{0}{a}, \partial_{r}{a} = \delta_{r}^{0} \partial_{0}{a}$);
eliminate_kronecker(ex);

which leaves a \delta_{0}^{0} instead of simplifying that to 1.

kpeeters commented 6 years ago

Fixed in ca8952c7e58873f72fcc7de4e0c5e360533b0e59.