cadabra2
cadabra2 copied to clipboard
Numerical substitution in powers does not canonicalise
n::Integer;
bpzrl := {
\alpha_{n}^{\mu} -> - (-1)**{n} \alpha_{- n}^{\mu}
};
def bpz(ex):
distribute(ex)
substitute(ex, bpzrl)
sort_product(ex)
return ex
XX := \alpha_{1}^{\mu}.
bpz(XX);
This produces a weird left-over factor (-1)^1 in the product, which should be simplified automatically.