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
25 stars 12 forks source link

Refactor `gamma` #180

Closed jank324 closed 2 weeks ago

jank324 commented 2 weeks ago

We compute gamma in quite a few places (e.g. track_methods.py -> base_r_matrix. The Beam class already has a relativistic_gamma property which we should use instead.

Hespe commented 2 weeks ago

This requires access to the specific beam, right? Seems like that would be a breaking change for the signature of the element.transfer_map or track_methods.base_r_matrix functions. Or is there a way to get access to the beam that I am currently missing?

jank324 commented 2 weeks ago

Ah ... good point. There is not ... so the computation can just stay as is. I'm also not finding any other location where the proposed refactoring actually makes sense, so I think we can just close this issue.