cadabra2 icon indicating copy to clipboard operation
cadabra2 copied to clipboard

Numerical substitution in powers does not canonicalise

Open kpeeters opened this issue 3 years ago • 0 comments

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.

kpeeters avatar Jan 23 '22 21:01 kpeeters