JP-Ellis / tikz-feynman

Feynman Diagrams with TikZ
http://www.jpellis.me/projects/tikz-feynman
Other
146 stars 20 forks source link

Funky and backward diagrams in TeX Live 2019/2020. #73

Open diaza opened 3 years ago

diaza commented 3 years ago

Apologies if this is not the right area for this issue.

I'm using TikZ-Feynman for a document I'm writing on Overleaf, and when I would copy example code for some diagrams they would end up looking funky. For example, the following code \feynmandiagram [large, vertical=e to f] { a -- [fermion] b -- [photon, momentum=\(k\)] c -- [fermion] d, b -- [fermion, momentum'=\(p_{1}\)] e -- [fermion, momentum'=\(p_{2}\)] c, e -- [gluon] f, h -- [fermion] f -- [fermion] i; }; should produce this:

image

but my document was outputting the following

image.

In addition to the funkiness in the middle, the arrows are pointing in opposite directions, which I was noticing in all the Feynman diagrams I was drawing.

I found that this issue was resolved when I changed the TeX Live version from 2020/2019 to 2018.

I don't know if this is a bug with TikZ-Feynman, with the TeX Live distributions, or with Overleaf.

diaza commented 3 years ago

Another, simpler example: When I draw \feynmandiagram [vertical=a to b] { i1 [particle=\(\nu_{\beta}\)] -- [fermion] a -- [fermion] f1 [particle=\(\beta\)], a -- [boson] b, };

I get the following with TeX Live 2019 & 2020:

image

And the following with TeX Live 2018:

image

The TeX Live 2018 drawing is my expectation.

Scientificaa commented 2 years ago

Hi, has it been solved now? I'm also facing this problem, and it seems that I cant find any solution

JP-Ellis commented 2 years ago

Unfortunately, I do not know the exact reason behind this. I suspect it is due to a different source of randomness and you might have to set the random seed manually to get it to work.

turner-julian commented 1 year ago

I also have run into the same issue trying to run the code used in the documentation of tikz-feynman:

Screen Shot 2023-03-29 at 3 33 39 PM

Has there been any progress made with this specific issue?

JP-Ellis commented 1 year ago

I will be releasing a new version of TikZ-Feynman in the next few weeks, and hope to used a fixed seed to help ensure reproducibility across the different runtime environments; however, the underlying algorithm is stochastic and I don't know in enough details whether the underlying pseudo-random number generator in Lua is deterministic across different environments.

In any case, if you do get the 'wrong' layout, you can tweak the momentum to momentum' to switch the lines; or fermion to anti fermion for arrows. You can also specify a specific seed if need be.