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
32 stars 13 forks source link

Vectorization error in RBend #171

Closed Hespe closed 3 months ago

Hespe commented 3 months ago

On the current master branch (version 0.7, commit b9f971d) the RBend segment fails to be properly constructed. Likely related to #170.

Minimal example:

import torch
import cheetah

segment = cheetah.Segment(
    elements=[
        cheetah.RBend(length=torch.tensor([1])),
    ]
)

segment.plot_overview()

Crashes with IndexError: too many indices for tensor of dimension 0