Linear

4D linear transformation element

(qx, px, qy, py) -> M @ (qx, px, qy, py) + (cqx, cpx, cqy, cpy)

class model.library.linear.Linear(name: str, v: list[float] = [0.0, 0.0, 0.0, 0.0], m: list[list[float]] = [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]], dp: float = 0.0, *, alignment: bool = True, dx: float = 0.0, dy: float = 0.0, dz: float = 0.0, wx: float = 0.0, wy: float = 0.0, wz: float = 0.0, output: bool = False, matrix: bool = False)[source]

Linear matrix element

Zero lenght element, can’t be used in insertion mode

rtype:

Linear

property m: torch.Tensor

Get matrix

Parameters:

None

Return type:

Tensor

make_matrix() tuple[torch.Tensor, torch.Tensor][source]

Generate transformation matrices (error element)

Parameters:

None

Return type:

tuple[Tensor, Tensor]

make_step() Mapping[source]

Generate integration step

Parameters:

None

Return type:

Mapping

property serialize: dict[str, str | int | float | bool]

Serialize element

Parameters:

None

Return type:

dict[str, str|int|float|bool]

property v: torch.Tensor

Get vector

Parameters:

None

Return type:

Tensor