at.collective.ibs#

Intra-beam scattering (IBS).

Analytical IBS growth rates, equilibrium emittances with radiation damping, and a collective element applying the corresponding random momentum kicks during tracking.

The growth rates follow the Bjorken-Mtingwa model, J.D. Bjorken, S.K. Mtingwa, Part. Accel. 13, 115 (1983), as modified in MAD-X to include the vertical dispersion: F. Antoniou, F. Zimmermann, CERN-ATS-2012-066. The Coulomb logarithm is computed as in MAD-X (twclog). They are computed in C, by the same code as the IBSPass pass method.

The local momentum distribution entering the Bjorken-Mtingwa integrals is built from the 6D mode matrices of linopt6(), so that betatron and synchro-betatron coupling are taken into account, as in K. Kubo, K. Oide, PRSTAB 4, 124401 (2001). The emittances are the mode emittances. For an uncoupled lattice this reduces to the MAD-X formulas.

The kick model follows R. Bruce et al., PRSTAB 13, 091001 (2010), as also implemented in mbtrack2, xfields and elegant.

Functions

ibs_equilibrium(ring[, bunch_current, ...])

Equilibrium emittances with IBS and synchrotron radiation.

ibs_rates(ring, emitx, emity, sigma_e, ...)

IBS emittance growth rates.

Classes

IBSConstraint(*values)

Evolution of the vertical emittance in ibs_equilibrium().

IBSElement(family_name, ring, *[, ...])

Element applying IBS momentum kicks during tracking.

class IBSConstraint(*values)[source]#

Bases: Enum

Evolution of the vertical emittance in ibs_equilibrium().

COUPLED = 2#

\(\epsilon_x + \epsilon_y\) is shared with a constant ratio \(\kappa=\epsilon_y/\epsilon_x\). The radiation equilibrium \(\epsilon_{x0}\) is reduced so that \(\epsilon_{x0} + \frac{J_y}{J_x}\,\epsilon_{y0}\) is the natural emittance, and \(\kappa=\epsilon_{y0}/\epsilon_{x0}\)

Type:

Betatron coupling

FIXED_RATIO = 3#

\(\epsilon_y = \kappa\,\epsilon_x\) with \(\kappa=\epsilon_{y0}/\epsilon_{x0}\)

Type:

Vertical excitation

UNCOUPLED = 1#

Independent vertical emittance, with its own damping and IBS rate

class IBSElement(family_name, ring, *, update_turns=1, nslice=51, step=0.5, refpt=0, **kwargs)[source]#

Bases: Collective, Element

Element applying IBS momentum kicks during tracking.

Every turn, each particle receives a random 6D kick. The kick amplitudes are computed from analytical growth rates (see ibs_rates()) evaluated with the transverse mode emittances, momentum spread and bunch length of the tracked bunch. They are weighted by the local longitudinal line density.

The transverse emittances are the projections \(\frac{1}{2}\mathrm{Tr}(J^TR_kJ\Sigma)\) of the sigma matrix of the bunch on the modes \(R_k\) of the lattice at the element: for a matched bunch they are the eigen emittances, for a mismatched one the emittances it filaments to. The element must therefore be created with the lattice in which it is tracked. IBS is not defined for a bunch with zero emittance or spread in a plane: such a bunch receives no kick and its growth rates are set to NaN. The kick of each mode has the shape \(R_k\) of the mode at the element, so that each mode grows at its own rate without exciting the others or mismatching the bunch.

Warning

ring must have the 6D configuration (cavities, radiation, etc.) of the tracked lattice. A lattice with the cavities on and radiation off (ring.enable_6d(at.RFCavity)) has a different longitudinal mode shape than the full 6D lattice. Tracked in a radiating lattice, the longitudinal growth is then wrong by several percent.

The kicks are computed by the IBSPass C pass method, with random numbers from the AT C generators, seeded with reset_rng(). The number of particles of each bunch is computed from the bunch currents of the tracked lattice.

Parameters:
  • family_name (str) – Element name

  • ring (Lattice) – Lattice in which the element will be inserted. Must have the same 6D configuration as the tracked lattice (see the warning above)

  • update_turns (int) – Number of turns between updates of the growth rates. Between updates, the kicks are rescaled with the current beam parameters at constant rates: the interval must be much shorter than the IBS growth time, otherwise the emittances grow exponentially. Default: 1, the update costs little compared with the tracking

  • nslice (int) – Number of bins of the longitudinal line density. Use 1 for uniform kicks

  • step (float) – Maximum distance between optics sampling points [m]

  • refpt (int) – Index in ring where the element will be inserted. Default: 0, entrance (or end) of ring.

rates#

Emittance growth rates [1/s] of each bunch, shape (nbunch, 3), computed at the last update

clear_history(ring=None)[source]#

Reset the growth rates: they are recomputed at the next pass.

Parameters:

ring (Lattice | None) – If given, the rates are resized for the bunches of ring

default_pass = {False: 'IdentityPass', True: 'IBSPass'}#
property rates: ndarray#

Emittance growth rates [1/s] of each bunch, shape (nbunch, 3).

ibs_equilibrium(ring, bunch_current=None, *, emity=None, constraint=IBSConstraint.UNCOUPLED, rtol=1e-06, max_steps=100000, step=0.5, history=False)[source]#

Equilibrium emittances with IBS and synchrotron radiation.

Solves for the steady state of \(\frac{d\epsilon}{dt} = -\frac{2}{\tau}(\epsilon - \epsilon_0) + r_{IBS}\,\epsilon\) in the 3 planes, where \(\epsilon\) are the mode emittances and \(\epsilon_0\) the radiation equilibrium. The momentum spread and bunch length scale as \(\sqrt{\epsilon_z/\epsilon_{z0}}\).

The steady state is found with a root solver. If it fails, or if history is True, the equations are instead integrated in time from \(\epsilon_0\) with adaptive time steps, until \(|\frac{d\epsilon}{dt}| / (\frac{2}{\tau}\epsilon)\) is below rtol in all planes, the same criterion as for the root solver.

Parameters:
  • ring (Lattice) – Lattice description, must be 6D. Radiation parameters are computed with envelope_parameters()

  • bunch_current (float | None) – Bunch current [A]. Default: current of the 1st bunch of ring

  • emity (float | None) – Vertical equilibrium emittance without IBS [m]. Default: vertical equilibrium emittance of ring

  • constraint (IBSConstraint) – How the vertical emittance evolves with IBS, see IBSConstraint. Default: IBSConstraint.UNCOUPLED

  • rtol (float) – Relative tolerance for convergence

  • max_steps (int) – Maximum number of time steps

  • step (float) – Maximum distance between optics sampling points [m]

  • history (bool) – Integrate in time and return the evolution of the emittances

Returns:

result – dictionary with keys:

  • emittances: equilibrium mode emittances [m], horizontal, vertical and longitudinal,

  • sigma_e: equilibrium momentum spread,

  • bunch_length: equilibrium bunch length [m],

  • rates: IBS emittance growth rates at equilibrium [1/s],

  • time: (nsteps,) time [s], only with time integration,

  • history: (nsteps, 3) evolution of the emittances [m], only with time integration.

ibs_rates(ring, emitx, emity, sigma_e, bunch_length, bunch_current=None, *, step=0.5)[source]#

IBS emittance growth rates.

Parameters:
  • ring (Lattice) – Lattice description, must be 6D

  • emitx (float) – Horizontal (mode 1) emittance [m]

  • emity (float) – Vertical (mode 2) emittance [m]

  • sigma_e (float) – Relative momentum spread

  • bunch_length (float) – RMS bunch length [m]

  • bunch_current (float | None) – Bunch current [A]. Default: current of the 1st bunch of ring

  • step (float) – Maximum distance between optics sampling points [m]

Returns:

rates – Emittance growth rates \(\frac{1}{\epsilon} \frac{d\epsilon}{dt}\) [1/s] of the horizontal, vertical and longitudinal modes. The longitudinal emittance is scaled to \(\sigma_\delta^2\). Amplitude growth rates, as returned by xsuite, are half of these values.