at.physics.rdt#

Resonance Driving Terms

Functions

get_rdts(ring, refpts, rdt_type[, ...])

Get the lattice Resonance Driving Terms

Classes

RDTType(*values)

Enum class for RDT type

class RDTType(*values)[source]#

Bases: Enum

Enum class for RDT type

ALL = 0#

all available RDTs

CHROMATIC = 3#

Chromatic RDTs

COUPLING = 2#

Linear coupling RDTs

FOCUSING = 1#

Normal quadrupole RDTs

GEOMETRIC1 = 4#

Geometric RDTs from sextupoles

GEOMETRIC2 = 5#

Geometric RDTs from octupoles optionally includes the second order contribution of sextupoles

TUNESHIFT = 6#

Amplitude detuning coefficients optionally includes the second order contribution of sextupoles

get_rdts(ring, refpts, rdt_type, second_order=False, use_mp=False, pool_size=None)[source]#

Get the lattice Resonance Driving Terms

get_rdts() computes the ring RDTs based on the original implementation from ELEGANT. For consistency, pyAT keeps the sign convention of the AT MATLAB interface.

Refs [1] and [2] were used to calculate the magnitude of first and second order rdts and Ref. [3] for the focusing rdt, however, different sign conventions are used along the references and in the original implementation. To overcome this issue, first and second order rdts are provided as a total and also separately so the user can redefine these conventions if needed.

The resonance base of GEOMETRIC2 rdts is explained in Eq. (54) of Ref [4].

The periodicity property of the lattice is automatically taken into account in the rdt calculation, however the calculation of the second order contribution of sextupoles to the GEOMETRIC2 and TUNESHIFT RDT types can only be derived for periodicity=1 (i.e. full ring provided).

Parameters:
Keyword Arguments:
  • second_order (bool) – Compute second order terms. Computation is significantly longer using this method,

  • use_mp (bool) – Activate parallel calculation,

  • pool_size (int) – Number of processes used for parallelization.

Returns:
  • rdts (complex) – rdt data at refpts,

  • rdts2 (complex) – contribution from sextupole second order terms Available only for GEOMETRIC2 and TUNESHIFT terms,

  • rdttot (complex) – total rdts.

rdts is a record array with fields:

for FOCUSING:

h20000, h00200

for COUPLING:

h10010, h10100

for CHROMATIC:

h11001, h00111, h20001, h00201, h10002

for GEOMETRIC1:

h21000, h30000, h10110, h10020, h10200

for GEOMETRIC2:

h22000, h11110, h00220, h31000, h40000, h20110 h11200, h20020, h20200, h00310, h00400

for TUNESHIFT:

dnux_dJx, dnux_dJy, dnuy_dJy

Example

>>> get_rdts(ring, reftps, [RDTType.COUPLING, RDTType.CHROMATIC])

References