Recently, I always stuck on an issue as the following: (In Cadabra2)
{a, b, c}::Indices.
D{#}::Derivative.
ex:= D^{a}{A} D_{a}{B} + D^{a}{B} D_{a}{A};
sort_product(_);
canonicalise(_);
collect_terms(_);
The correct answer should be 2D^{a}{A} D_{a}{B}. But, I always can't get it.
Thus, I am not quite sure what the problem is.
sort_product : ex should be sorted by indices? or the objects(i.e.
A or B)?
canonicalize : which seems only care about the indices.
By the way, I wish there can be a feature like sort_sum as in the old Cadabra1.