FeynCalc / feyncalc

Mathematica package for algebraic calculations in elementary particle physics.
https://feyncalc.github.io
GNU General Public License v3.0
309 stars 87 forks source link

FCGetFreeIndices obtain a wrong result when the amplititude contains DiracTrace #269

Closed Zhongyuan-Liu closed 3 months ago

Zhongyuan-Liu commented 3 months ago

It seems to have no problem. The information is include in the following attachment.

The examples are included in the following attachment. I cannot upload a *.nb file, so I change the file name into .md. Untitled-2.md

vsht commented 3 months ago

Thanks for the bug report. I think this should be now fixed. Could you please test the dev version to make sure it covers all relevant cases?

Zhongyuan-Liu commented 3 months ago

I have downloaded the master branch and tested. The bug doesn't seem to have been completely resolved. The following code DiracTrace[Dot[GSD[p3 + p4] + m, GAD[mu], GAD[nu]]] FCGetFreeIndices[FullForm[FCI[%[[1]]]], {LorentzIndex}] still gives a wrong result, although other examples are correct now. If I get rid of the FullForm[] or the mass m, it gives correct result.

Moreover, I wonder why the output become plain text image rather than previous easy reading image. Does it a bug? Or just I should use some function to set the format of my output result?

vsht commented 3 months ago

If I get rid of the FullForm[] or the mass m, it gives correct result.

You answered your question yourself. Never wrap FullForm over expressions to be further processed in Mathematica. It's only for displaying something. The same goes for TraditionalForm, StandardForm, MatrixForm etc.

This works as expected

DiracTrace[Dot[GSD[p3 + p4] + m, GAD[mu], GAD[nu]]]
FCGetFreeIndices[FCI[%], {LorentzIndex}]
Zhongyuan-Liu commented 3 months ago

OK! Thank you for your help!