[GiNaC-devel] patch for power::expand_mul

Chris Dams Chris.Dams at mi.infn.it
Fri Sep 9 16:44:49 CEST 2005


Dear developers,

Could you change the line

	if (get_all_dummy_indices(m).size() > 0) {

that occurs in the function power::expand_mul in power.cpp into

	if (get_all_dummy_indices(m).size() > 0 && n.is_positive()) {

Reason: I sometimes use algebraic substitution for expressions involving 
indices. For instance using the pattern

	indexed(UL1inv,wildgen,wildgen2)*indexed(UL1,wildgen2,wildgen3)
		==delta_tensor(wildgen,wildgen3)

to cancel a matrix multiplied with its inverse. Internally, algebraic
subsitution divides by the factors it wants to get rid of but since
Vladimir Kisils patch this goes wrong if these factors contain a
contraction.

Best wishes,
Chris





More information about the GiNaC-devel mailing list