desy-ml / cheetah

Fast and differentiable particle accelerator optics simulation for reinforcement learning and optimisation applications.
https://cheetah-accelerator.readthedocs.io
GNU General Public License v3.0
27 stars 12 forks source link

Negative emittance due to numerical errors #83

Open jank324 opened 9 months ago

jank324 commented 9 months ago

Under certain conditions, numerical errors in the subtraction inside the sqrt used to compute the emittance can lead to negative values, which are (a) physically impossible and (b) can lead to Nans as a result of sqrt.