at.lattice.elements.abstract_elements#

Abstract Element classes

Classes

LongtMotion()

Abstract Base class for all Element classes whose instances may modify the particle momentum

Radiative()

Mixin class for default radiating elements (Dipole, Quadrupole, Wiggler)

Collective()

Mixin class for elements representing collective effects

class Collective[source]#

Bases: _DictLongtMotion

Mixin class for elements representing collective effects

Derived classes will automatically set the is_collective property when the element is active.

The class must have a default_pass class attribute, a dictionary such that:

  • default_pass[False] is the PassMethod when collective effects are turned OFF,

  • default_pass[True] is the default PassMethod when collective effects are turned ON.

The Collective class must be set as the first base class.

Example

>>> class WakeElement(Collective, Element):
...     default_pass = {False: "IdentityPass", True: "WakeFieldPass"}

Defines a class where the is_collective property is handled

abstractmethod clear_history()[source]#
class LongtMotion[source]#

Bases: ABC

Abstract Base class for all Element classes whose instances may modify the particle momentum

Allows identifying elements potentially inducing longitudinal motion.

Subclasses of LongtMotion must provide two methods for enabling longitudinal motion:

  • _get_longt_motion(self) must return the activation state,

  • set_longt_motion(self, enable, new_pass=None, copy=False, **kwargs) must enable or disable longitudinal motion.

abstractmethod set_longt_motion(enable, new_pass=None, copy=False, **kwargs)[source]#

Enable/Disable longitudinal motion

Parameters:
  • enableTrue: for enabling, False for disabling

  • new_pass

    New PassMethod:

    • None: makes no change,

    • 'auto': Uses the default conversion,

    • Anything else is used as the new PassMethod.

  • copy – If True, returns a modified copy of the element, otherwise modifies the element in-place

class Radiative[source]#

Bases: _Radiative

Mixin class for default radiating elements (Dipole, Quadrupole, Wiggler)

Radiative is a base class for the subset of radiative elements considered as the ones to be turned on by default: Dipole, Quadrupole and Wiggler, excluding the higher order multipoles.

Radiative inherits from _Radiative and does not add any new functionality. Its purpose is to identify the default set of radiating elements.

Example

>>> class Dipole(Radiative, Multipole):

Defines a class belonging to the default radiating elements. It converts the PassMethod according to the “*Pass” or “*RadPass” suffix.