Open jp-ga opened 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:
bmadx
module? This means that code is suddenly in a very different place than the other tracking code.Quadrupole
class that has something like a tracking_method: Literal["linear", "bmadx"]
argument?Maybe slightly unrelated but I saw it in this PR:
C = scipy.constants.speed_of_light
at the top of a file. Ideally, one would just from scripy.constants import speed_of_light
and use that. I think this might cause issues sometimes, when a torch.Tensor
is strictly needed, but I cannot produce an example right now. Maybe we should add a cheetah.constants
module that takes scripy.constnts
and always returns torch.Tensor
s. But again, I'm not sure we actually need that ... just something to think about.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.
@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, 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.
Description
DRAFT PR add
BmadQuadrupole
element by interfacing with Bmad-X tracking routines.Motivation and Context
closes #139
Types of changes
Checklist
flake8
(required).pytest
tests pass (required).pytest
on a machine with a CUDA GPU and made sure all tests pass (required).Note: We are using a maximum length of 88 characters per line