Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug when multiplying the metric by a sum of derivatives #3

Open
ahamaline opened this issue Dec 10, 2024 · 5 comments
Open

Bug when multiplying the metric by a sum of derivatives #3

ahamaline opened this issue Dec 10, 2024 · 5 comments

Comments

@ahamaline
Copy link

Hi, I know this is not the official repo for FeynRules, but I don't see any other place to report bugs. So I'll report this here in the hope that someone relevant will get the information.

The metric ME[a,b] is contracted automatically with partial derivatives: del[phi,a] ME[a,b] becomes del[phi,b]. However, if we instead try to multiply the metric by a sum of different derivative terms, like (del[phi1,a] + del[phi2,a]) ME[a,b], this is treated wrongly: the metric is only contracted with the first summand, yielding del[phi1,b] + del[phi2,a] which is not valid.

@misho104
Copy link
Contributor

misho104 commented Dec 11, 2024

Thank you. I guess the bug originates in these two lines, where ff_ matches Plus.

It should be corrected to, for example,

ME[mu_,nu_] ff_[indx___,del[f_,mu_],indy___]/; FreeQ[{indx, indy}, mu] ^:=ff[indx,del[f,nu],indy];
ME[nu_,mu_] ff_[indx___,del[f_,mu_],indy___]/; FreeQ[{indx, indy}, mu] ^:=ff[indx,del[f,nu],indy];

or more likely

ME[mu_,nu_] exp:(ff_[indx___,del[f_,mu_],indy___]) ^:= (exp /. mu->nu)
ME[nu_,mu_] exp:(ff_[indx___,del[f_,mu_],indy___]) ^:= (exp /. mu->nu)

I am not sure the intention of this code, but for ff_ = Plus the latter option and for Times the former option seems better, respectively.

I've sent an email to the author.

@BFuks
Copy link

BFuks commented Dec 11, 2024

Hi,

Thanks for pointing this out. I have fixed it here: FeynRules/FeynRules@97b0798

Cheers,

Benjamin

@ahamaline
Copy link
Author

It should be corrected to, for example,

ME[mu_,nu_] ff_[indx___,del[f_,mu_],indy___]/; FreeQ[{indx, indy}, mu] ^:=ff[indx,del[f,nu],indy];
ME[nu_,mu_] ff_[indx___,del[f_,mu_],indy___]/; FreeQ[{indx, indy}, mu] ^:=ff[indx,del[f,nu],indy];

IIUC, the effect of the condition /; FreeQ[{indx, indy}, mu] is that the replacement will not be done at all if there is more than one occurrence of mu. Is that what we want? Shouldn't we do the replacement for each summand?

I am not sure the intention of this code, but for ff_ = Plus the latter option and for Times the former option seems better, respectively.
I don't think the Times case is relevant: if the same Lorentz index appears in two factors then they should be contracted with each other. If the same index also appears in ME, then there's already some error.

Hi,

Thanks for pointing this out. I have fixed it here: FeynRules/FeynRules@97b0798

Cheers,

Benjamin

Thanks for taking care of this!
I think you forgot to comment out the second line:
ME[nu_,mu_] ff_[indx___,del[f_,mu_],indy___]^:=ff[indx,del[f,nu],indy];
which gives the bug when contracting with the second index.
Also, as above, I'm not sure that FreeQ gives the desired behavior.

@BFuks
Copy link

BFuks commented Dec 11, 2024 via email

@ahamaline
Copy link
Author

Ah ok, I get it now. Since we are always working with a Lagrangian that will eventually be expanded into monomials, we can just let the ME hang around uncontracted until that happens.

And I see I was also mistaken about commenting out the second line. I apologize for the annoyance.

A big thank you to you and your co-authors for creating this highly useful tool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants