[GiNaC-devel] Index renaming in Ginac 1.6.0

Gerhard Hejc gerhard.hejc at googlemail.com
Wed Jul 20 22:32:28 CEST 2011


Hi,

 in my application I do a substitution .j by .i in the expression
-2*P.j.i*P.n.m*delta.m.i*delta.n.i. With Ginac 1.6.0 the result is
-2*P.n.m*P.symbol15.symbol15*delta.m.i*delta.n.i instead of
-2*P.n.m*P.i.i*delta.m.i*delta.n.i.  Using the subs option
"subs_options::no_index_renaming" does not change the behaviour.

The reason is that in the function "ex expairseq::subs(const exmap & m,
unsigned options) const" the third argument "do_index_renaming" is always
true

        return ex_to<basic>(thisexpairseq(vp, overall_coeff, true);

Changing this line to

        return ex_to<basic>(thisexpairseq(vp, overall_coeff, (options &
subs_options::no_index_renaming) == 0));

fixes the problem in my application, but I am not absolutely sure that this
does not have any side effects. What do you think?

with best regards

 Gerhard Hejc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cebix.net/pipermail/ginac-devel/attachments/20110720/3a135194/attachment.html>


More information about the GiNaC-devel mailing list