at.physics.matrix#

transfer matrix related functions

A collection of functions to compute 4x4 and 6x6 transfer matrices

Functions

find_m44(ring[, dp, refpts, dct, df, orbit, ...])

One turn 4x4 transfer matrix

find_m66(ring[, refpts, orbit, keep_lattice])

One-turn 6x6 transfer matrix

find_elem_m66(elem[, orbit])

Single element 6x6 transfer matrix

gen_m66_elem(ring[, o6b, o6e, ringrad, ...])

Converts a ring to a linear 6x6 matrix.

find_elem_m66(elem, orbit=None, **kwargs)[source]#

Single element 6x6 transfer matrix

Numerically finds the 6x6 transfer matrix of a single element

Parameters:
  • elem (Element) – AT element

  • orbit (ndarray) – Closed orbit at the entrance of the element, default: 0.0

Keyword Arguments:
  • XYStep (float) – Step size. Default: DConstant.XYStep

  • particle (Particle) – circulating particle. Default: lattice.particle if existing, otherwise Particle('relativistic')

  • energy (float) – lattice energy. Default 0.

Returns:

m66 – 6x6 transfer matrix

find_m44(ring, dp=None, refpts=None, dct=None, df=None, orbit=None, keep_lattice=False, **kwargs)[source]#

One turn 4x4 transfer matrix

find_m44() finds the 4x4 transfer matrix of an accelerator lattice by differentiation of trajectories near the closed orbit.

Important

find_m44() assumes constant momentum deviation. The PassMethod used for any element SHOULD NOT:

  1. change the longitudinal momentum dP (cavities , magnets with radiation, …)

  2. have any time dependence (localized impedance, fast kickers, …)

Unless an input orbit is introduced, find_m44() assumes that the lattice is a ring and first finds the closed orbit.

Parameters:
Keyword Arguments:
  • full (bool) – If True, matrices are full 1-turn matrices at the entrance of each element indexed by refpts. If False (Default), matrices are between the entrance of the first element and the entrance of the selected element

  • XYStep (float) – Step size. Default: DConstant.XYStep

Returns:
  • m44 – full one-turn matrix at the entrance of the first element

  • ms – 4x4 transfer matrices between the entrance of the first element and each element indexed by refpts: (Nrefs, 4, 4) array

find_m66(ring, refpts=None, orbit=None, keep_lattice=False, **kwargs)[source]#

One-turn 6x6 transfer matrix

find_m66() finds the 6x6 transfer matrix of an accelerator lattice by differentiation of trajectories near the closed orbit.

Parameters:
Keyword Arguments:
Returns:
  • m66 – full one-turn matrix at the entrance of the first element

  • ms – 6x6 transfer matrices between the entrance of the first element and each element indexed by refpts: (Nrefs, 6, 6) array

gen_m66_elem(ring, o6b=None, o6e=None, ringrad=None, o6brad=None, o6erad=None, **kwargs)[source]#

Converts a ring to a linear 6x6 matrix. This element handles 2 passmethods Matrix66Pass and Matrix66RadPass, that can be activated within a lattice using enable_6() or disable_6d(). This provides flexibility to turn ON and OFF the 6D motion or simply the radiation damping, depending on the configuration of the rings provided as input.

Parameters:
  • ring (Lattice) – Lattice description. Is used by Matrix66Pass

  • ringrad (Lattice) – Optional lattice with radiations. Is used by Matrix66RadPass

  • o6b (ndarray) – entrace orbit without radiations, use by Matrix66Pass

  • o6e (ndarray) – exit orbit without radiations, use by Matrix66Pass

  • o6b – entrace orbit with radiations, use by Matrix66RadPass

  • o6e – exit orbit with radiations, use by Matrix66RadPass

Returns:

m66M66 object