<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">We have a self defined function “LMT” by </div><div class=""><br class=""></div><div class="">DECLARE_FUNCTION_2P( LMT );</div><div class="">REGISTER_FUNCTION( LMT, set_symmetry(sy_symm(0,1)) );</div><div class=""><br class=""></div><div class="">Its two arguments are symmetric to each other. And we want to make the substitution in the expressions, LMT(mu1,mu2)*LMT(mu2,mu3) -> LMT(mu1,mu3). Therefore we made an exmap by</div><div class=""><br class=""></div><div class="">exmap replacement;<br class="">replacement.insert(ex2( LMT(wild(1),wild(2))*LMT(wild(2),wild(3)), LMT(wild(1),wild(3)) ));<br class=""><br class=""></div><div class="">However, it sometimes does not work for</div><div class=""><br class=""></div><div class="">ex testexpr = LMT(rho1,rho2)*LMT(rho2,rho3);<br class="">cout << “before subs, testexpr = “ << testexpr << endl;<br class="">testexpr = testexpr.subs( replacement, subs_options::algebraic );<br class="">cout << “after subs, testexpr = “ << testexpr << endl;<br class=""><br class=""></div><div class="">The subs here mostly fails. Then we realised GiNaC will change to the canonical form for LMT, so we insert all cases of combinations by</div><div class=""><br class=""></div><div class="">exmap replacement;<br class="">replacement.insert(ex2( LMT(wild(1),wild(2))*LMT(wild(2),wild(3)), LMT(wild(1),wild(3)) ));<br class="">replacement.insert(ex2( LMT(wild(2),wild(1))*LMT(wild(2),wild(3)), LMT(wild(1),wild(3)) ));<br class="">replacement.insert(ex2( LMT(wild(1),wild(2))*LMT(wild(3),wild(2)), LMT(wild(1),wild(3)) ));<br class="">replacement.insert(ex2( LMT(wild(2),wild(1))*LMT(wild(3),wild(2)), LMT(wild(1),wild(3)) ));<br class=""><br class=""></div><div class="">But this still does not work sometimes. Then we got that GiNaC may also change the form of matching expression of LMT(wild(1),wild(2)).</div><div class=""><br class=""></div><div class="">What we can have now is only turn off symmetry property for LMT function, but we worry it may generate difficulty in the future. </div><div class=""><br class=""></div><div class="">So is there some option or algorithm for the symmetric function matching?</div><div class=""><br class=""></div><div class="">Thanks.</div><div class=""><br class=""></div><div class=""><br class=""></div><div apple-content-edited="true" class="">
<div style="color: rgb(0, 0, 0); font-family: Menlo;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class=""><div style="color: rgb(0, 0, 0); font-family: Menlo;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class=""><div style="color: rgb(0, 0, 0); font-family: Menlo;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">Best Regards,<br class="">Zhao<br class=""><br class=""></div></div></div></div></body></html>