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

add `BmadQuadrupole` element #153

Open jp-ga opened 1 month ago

jp-ga commented 1 month ago

Description

DRAFT PR add BmadQuadrupole element by interfacing with Bmad-X tracking routines.

Motivation and Context

closes #139

Types of changes

Checklist

Note: We are using a maximum length of 88 characters per line

jank324 commented 1 month ago

As a general comment. I'm not sure I like this quick-and-dirty drop-in way of integrating Bmad-X elements. However, I think it makes sense to test them this way. In the long-term we should think about how this can be clean up better.

Some questions we should ask ourselves:

Maybe slightly unrelated but I saw it in this PR:

jp-ga commented 2 weeks ago

One small thing to keep in mind, bmadx tracking agrees to single precision with bmadx. I was expecting it to agree to double precision, but it is good enough for now.

jank324 commented 1 week ago

@jp-ga, the question came up with @roussel-ryan, if this or #163 should be merged first. I think a main question in that was if the changes in #163 might make conversions in this PR redundant. Do you have an opinion on this?

jp-ga commented 1 week ago

@jp-ga, the question came up with @roussel-ryan, if this or #163 should be merged first. I think a main question in that was if the changes in #163 might make conversions in this PR redundant. Do you have an opinion on this?

The transformations in this PR already assume the new canonical coordinates described in #163, so you can merge #163 first if needed.