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
35 stars 14 forks source link

Tracking fails with `TransverseDeflectingCavity` if embedded in a segment #290

Closed Hespe closed 5 days ago

Hespe commented 1 month ago

The following example currently fails to track:

import cheetah
import torch

segment = cheetah.Segment(elements=[
    cheetah.TransverseDeflectingCavity(length=torch.tensor(1.0))
])
beam = cheetah.ParticleBeam.from_parameters()

segment.track(beam)

The code raises an NotImplementedError in Element.track().