at.collective.beam_loading#

Functions

add_beamloading(ring, qfactor, rshunt[, ...])

Function to add beam loading to a cavity element, the cavity element is changed to a beam loading element that combines the energy kick from both the cavity and the resonator

remove_beamloading(ring[, cavpts, copy])

Function to remove beam loading from a cavity element, the beam loading element is changed to a beam loading element that combines the energy kick from both the cavity and the resonator

Classes

BLMode(value)

An enumeration.

BeamLoadingElement(family_name, length, ...)

Class to generate a beamloading element, inherits from Element additional argument are ring, cavity, qfactor, rshunt

CavityMode(value)

An enumeration.

class BLMode(value)[source]#

Bases: IntEnum

An enumeration.

PHASOR = 2#
WAKE = 1#
class BeamLoadingElement(family_name, length, voltage, frequency, ring, qfactor, rshunt, blmode=BLMode.PHASOR, cavitymode=CavityMode.ACTIVE, buffersize=0, **kwargs)[source]#

Bases: RFCavity, Collective

Class to generate a beamloading element, inherits from Element additional argument are ring, cavity, qfactor, rshunt

Parameters:
  • ring (Lattice) – Lattice object

  • length (float) – Length of the cavity

  • voltage (float) – Cavity voltage [V]

  • frequency (float) – Cavity frequency [Hz]

  • qfactor (float) – Q factor

  • rshunt (float) – Shunt impedance, [\(\Omega\)]

Keyword Arguments:
  • Nslice (int) – Number of slices per bunch. Default: 101

  • Nturns (int) – Number of turn for the wake field. Default: 1

  • ZCuts – Limits for fixed slicing, default is adaptive

  • NormFact (float) – Normalization factor

  • blmode (BLMode) – method for beam loading calculation BLMode.PHASOR (default) uses the phasor method, BLMode.WAKE uses the wake function. For high Q resonator, the phasor method should be used

  • cavitymode (CavityMode) – Is cavity ACTIVE (default) or PASSIVE

  • buffersize (int) – Size of the history buffer for vbeam, vgen, vbunch (default 0)

Returns:

bl_elem (Element) – beam loading element

static build_from_cav(cav, ring, qfactor, rshunt, blmode=BLMode.PHASOR, cavitymode=CavityMode.ACTIVE, buffersize=0, **kwargs)[source]#

Function to build the BeamLoadingElement from a cavity the FamName, Length, Voltage, Frequency and HarmNumber are taken from the cavity element

Parameters:
  • ring (Sequence) – Lattice object

  • qfactor (float) – Q factor

  • rshunt (float) – Shunt impedance, [\(\Omega\)]

Keyword Arguments:
  • Nslice (int) – Number of slices per bunch. Default: 101

  • Nturns (int) – Number of turn for the wake field. Default: 1

  • ZCuts – Limits for fixed slicing, default is adaptive

  • NormFact (float) – Normalization factor

  • blmode (BLMode) – method for beam loading calculation BLMode.PHASOR (default) uses the phasor method, BLMode.WAKE uses the wake function. For high Q resonator, the phasor method should be used

  • cavitymode (CavityMode) – type of beam loaded cavity ACTIVE (default) for a cavity with active compensation, or PASSIVE to only include the beam induced voltage

  • buffersize (int) – Size of the history buffer for vbeam, vgen, vbunch (default 0)

Returns:

bl_elem (Element) – beam loading element

clear_history(ring=None)[source]#
is_compatible(other)[source]#

Checks if another Element can be merged

property Buffersize#
property Nslice#

Number of slices per bunch

property Nturns#

Number of turn for the wake field

property ResFrequency#

Resonator frequency

property TurnHistory#

Turn history of the slices center of mass

property Vbeam#

Beam phasor (amplitude, phase)

property Vbeam_buffer#

Stored beam induced voltage data

property Vbunch#

Bunch phasor (amplitude, phase)

property Vbunch_buffer#

Stored bunch induced voltage data

property Vcav#

Cavity phasor (amplitude, phase)

property Vgen#

Generator phasor (amplitude, phase)

property Vgen_buffer#

Stored generator voltage data

default_pass = {False: 'DriftPass', True: 'BeamLoadingCavityPass'}#
class CavityMode(value)[source]#

Bases: IntEnum

An enumeration.

ACTIVE = 1#
PASSIVE = 2#
add_beamloading(ring, qfactor, rshunt, cavpts=None, copy=False, **kwargs)[source]#

Function to add beam loading to a cavity element, the cavity element is changed to a beam loading element that combines the energy kick from both the cavity and the resonator

Parameters:
  • ring (Lattice) – Lattice object

  • qfactor (float | Sequence[float]) – Q factor. Scalar or array of float are accepted

  • rshunt (float | Sequence[float]) – Shunt impedance, [\(\Omega\)] for longitudinal Scalar or array of float are accepted

Keyword Arguments:
  • cavpts (Refpts) – refpts of the cavity. If None (default) apply to all cavity in the ring

  • Nslice (int) – Number of slices per bunch. Default: 101

  • Nturns (int) – Number of turn for the wake field. Default: 1

  • ZCuts – Limits for fixed slicing, default is adaptive

  • NormFact (float) – Normalization factor

  • blmode (BLMode) – method for beam loading calculation BLMode.PHASOR (default) uses the phasor method, BLMode.WAKE uses the wake function. For high Q resonator, the phasor method should be used

  • copy – If True, returns a shallow copy of ring with new beam loading elements. Otherwise, modify ring in-place

  • cavitymode (CavityMode) – Define PASSIVE or ACTIVE cavity

  • buffersize (int) – Size of the history buffer for vbeam, vgen, vbunch (default 0)

remove_beamloading(ring, cavpts=None, copy=False)[source]#

Function to remove beam loading from a cavity element, the beam loading element is changed to a beam loading element that combines the energy kick from both the cavity and the resonator

Parameters:

ring – Lattice object

Keyword Arguments:
  • cavpts (Refpts) – refpts of the beam loading Elements. If None (default) apply to all elements

  • copy – If True, returns a shallow copy of ring with new cavity elements. Otherwise, modify ring in-place