apace.matrixmethod

Module Contents

Classes

MatrixMethod

The transfer matrix method.

Attributes

MATRIX_SIZE

IDENTITY

C

C_SQUARED

CONST_MEV

CONST_ME

apace.matrixmethod.MATRIX_SIZE = 6
apace.matrixmethod.IDENTITY
apace.matrixmethod.C = 299792458
apace.matrixmethod.C_SQUARED
apace.matrixmethod.CONST_MEV = 1.602176634e-13
apace.matrixmethod.CONST_ME = 9.1093837015e-31
class apace.matrixmethod.MatrixMethod(lattice, steps_per_element=10, steps_per_meter=None, start_index=None, start_position=None, energy=None)

The transfer matrix method.

Parameters
  • lattice – Lattice which transfer matrices gets calculated for.

  • steps_per_element (int) – Fixed number of steps per element. (ignored if steps_per_meter is passed)

  • steps_per_meter (number) – Fixed number of steps per meter.

  • start_index (int) – Start index for the one-turn matrix and for the accumulated transfer matrices.

  • start_position (number) – Same as start_index but uses position instead of index of the position. Is ignored if start_index is set.

  • energy (number) – Total energy per particle in MeV.

Attributes

energy
Return type

float

gamma
Return type

float

velocity
Return type

float

n_steps

Total number of steps.

Return type

int

element_indices

Contains the indices of each element within the transfer_matrices.

Return type

Dict[apace.classes.Element, List[int]]

step_size

Contains the step_size for each point. Has length of n_kicks

Return type

numpy.ndarray

s

Contains the orbit position s for each point. Has length of n_kicks + 1.

Return type

numpy.ndarray

matrices

Array of transfer matrices with shape (6, 6, n_kicks)

Return type

numpy.ndarray

k0

Array of deflections angles with shape (n_kicks).

Return type

numpy.ndarray

k1

Array of geometric quadruole strenghts with shape (n_kicks).

Return type

numpy.ndarray

start_index

Start index of the one-turn matrix and the accumulated transfer matrices.

Return type

int

start_position

Same as start_index, but position in meter instead of index.

Return type

float

matrices_acc

The accumulated transfer matrices starting from start_index.

Return type

numpy.ndarray

Methods

_on_element_changed(element, attribute)
update_n_steps()

Manually update the total number of kicks.

_on_n_steps_changed()
update_element_indices()

Manually update the indices of each element.

_on_element_indices_changed()
update_step_size()

Manually update the step_size array.

_on_step_size_changed()
update_s()

Manually update the orbit position array s.

_on_s_changed()
update_matrices()

Manually update the transfer_matrices.

update_matrices_acc()
_on_matrices_accumulated_changed()