Maybe a bug for Electric field

Hello,

Thanks for this question, this is indeed a valid point. It is indeed a bug, which we have fixed and which will be solved in the upcoming release.

Without going into technicalities, the tracking algorithm was sometimes going into a different branch of the code that incorrectly calculated the particle energy while traveling in the electric field. As a result, only a fraction of the energy the particle was supposed to gain was actually accounted for.

Worry not, we will fix this issue in the upcoming release. I attach here the plot you would obtain after the next update:

Nice catch! Have a nice day.
Cheers,
Daniele