apace.tracking_matrix

Module Contents

Classes

TrackingMatrix

Particle tracking using the transfer matrix method.

class apace.tracking_matrix.TrackingMatrix(lattice, initial_distribution, turns=1, watch_points=None, start_point=0, **kwargs)

Inherits: apace.matrixmethod.MatrixMethod

Particle tracking using the transfer matrix method.

Parameters
  • lattice (Lattice) – Lattice which particles will be tracked through.

  • initial_distribution (np.ndarray) – Initial particle distribution.

  • turns (int) – Number of turns.

  • watch_points (array-like, optional) – List of watch points. If unset all particle trajectory will be saved for all positions. Indices correspont to orbit_positions.

  • start_point (int) – Point at which the particle tracking begins.

Attributes

watch_points
initial_distribution
Return type

numpy.ndarray

particle_trajectories

Contains the 6D particle trajectories.

Return type

numpy.ndarray

orbit_position
Return type

numpy.ndarray

x
Return type

numpy.ndarray

x_dds
Return type

numpy.ndarray

y
Return type

numpy.ndarray

y_dds
Return type

numpy.ndarray

lon
Return type

numpy.ndarray

delta
Return type

numpy.ndarray

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

update_particle_trajectories()

Manually update the 6D particle trajectories

_on_particle_trajectories_changed()
_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()