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

Error when using `BPM` with parameter beam #101

Closed jank324 closed 7 months ago

jank324 commented 7 months ago

The following MWE

segment = cheetah.Segment(
    elements=[
        cheetah.Drift(length=torch.tensor(1.0)),
        cheetah.BPM(name="my_bpm"),
        cheetah.Drift(length=torch.tensor(1.0)),
    ],
)
beam = cheetah.ParameterBeam.from_astra("benchmark/cheetah/ACHIP_EA1_2021.1351.001")

segment.my_bpm.is_active = True

_ = segment.track(beam)

throws

AttributeError: 'ParameterBeam' object has no attribute '_mu_x'