ActivePlasmaLens#
- class wake_t.beamline_elements.ActivePlasmaLens(length, foc_strength, wakefields=False, density=None, wakefield_model='quasistatic_2d', bunch_pusher='boris', dt_bunch='auto', push_bunches_before_diags=True, n_out=1, name='Active plasma lens', **model_params)[source]#
Class defining an active plasma lens.
This elements is a subclass of
PlasmaStage, where a linear azimuthal magnetic field is added externally. It also includes convenient methods to specify the field gradient and whether the plasma wakefields should be taken into account.- Parameters:
- lengthfloat
Length of the plasma lens in \(m\).
- foc_strengthfloat
Focusing strength of the plasma lens in \(T/m\). Defined so that a positive value is focusing for electrons.
- wakefieldsbool
If
True, the beam-induced wakefields in the plasma lens will be computed using the model specified in'wakefield_model'and taken into account for the beam evolution.- wakefield_modelstr
Name of the model which should be used for computing the beam-induced wakefields. Recommended models are
'cold_fluid_1d'or'quasistatic_2d'. SeePlasmaStagedocumentation for other possibilities.- densityfloat or callable
Optional. Required only if
wakefields=True. Plasma density of the APL in units of \(m^{-3}\). SeePlasmaStagedocumentation for more details.- bunch_pusherstr
The pusher used to evolve the particle bunches in time within the specified fields. Possible values are
'rk4'(Runge-Kutta method of 4th order) or'boris'(Boris method).- dt_bunchfloat
The time step for evolving the particle bunches. If
None, it will be automatically set to \(dt = T/(10*2*pi)\), where T is the smallest expected betatron period of the bunch along the plasma lens (T is calculated from foc_strength if wakefields=False, otherwise the focusing strength of a blowout is used). A list of values can also be provided. In this case, the list should have the same order as the list of bunches given to thetrackmethod.- push_bunches_before_diagsbool, optional
Whether to push the bunches before saving them to the diagnostics. Since the time step of the diagnostics can be different from that of the bunches, it could happen that the bunches appear in the diagnostics as they were at the last push, but not at the actual time of the diagnostics. Setting this parameter to
True(default) ensures that an additional push is given to all bunches to evolve them to the diagnostics time before saving. This additional push will always have a time step smaller than the the time step of the bunch, so it has no detrimental impact on the accuracy of the simulation. However, it could make convergence studies more difficult to interpret, since the number of pushes will depend on n_diags. Therefore, it is exposed as an option so that it can be disabled if needed.- n_outint
Number of times along the lens in which the particle distribution should be returned (A list with all output bunches is returned after tracking).
- namestr
Name of the plasma lens. This is only used for displaying the progress bar during tracking. By default,
'Active plasma lens'.- **model_params
Optional. Required only if
wakefields=True. Keyword arguments which will be given to the wakefield model. SeePlasmaStagedocumentation for more details.
See also
Methods
track([bunches, opmd_diag, diag_dir, ...])Track bunch through element.