element_parameters module

Define a class to hold solver parameters for CyEnvelope1D.

Almost everything is inherited from the python version of the module. The main difference is that with the Cython version, we give the transfer matrix function the name of the field map.

class ElementCyEnvelope1DParameters(length_m, n_steps, beam_kwargs, transf_mat_function=None, **kwargs)[source]

Bases: ElementEnvelope1DParameters

Hold the parameters to compute beam propagation in an Element.

has and get method inherited from ElementBeamCalculatorParameters parent class.

Parameters:
__init__(length_m, n_steps, beam_kwargs, transf_mat_function=None, **kwargs)[source]

Set the actually useful parameters.

Parameters:
_proper_transfer_matrix_func(element_nature, method=None)[source]

Get the proper transfer matrix function.

Parameters:
  • element_nature (str)

  • method (Literal['RK4', 'leapfrog'] | None, default: None)

Return type:

Callable

_abc_impl = <_abc._abc_data object at 0x70e2543dc580>
class DriftCyEnvelope1DParameters(elt, beam_kwargs, n_steps=1, **kwargs)[source]

Bases: DriftEnvelope1DParameters, ElementCyEnvelope1DParameters

Hold the properties to compute transfer matrix of a Drift.

As this is 1D, it is also used for Solenoid, Quad, broken FieldMap.

Parameters:
_abc_impl = <_abc._abc_data object at 0x70e253d25680>
class FieldMapCyEnvelope1DParameters(elt, method, n_steps_per_cell, solver_id, beam_kwargs, phi_s_model='historical', **kwargs)[source]

Bases: FieldMapEnvelope1DParameters, ElementCyEnvelope1DParameters

Hold the properties to compute transfer matrix of a FieldMap.

Non-accelerating cavities will use DriftEnvelope1DParameters instead.

Parameters:
transfer_matrix_kw(w_kin, cavity_settings, *args, phi_0_rel=None, **kwargs)[source]

Give the element parameters necessary to compute transfer matrix.

Parameters:
  • w_kin (float) – Kinetic energy at the entrance of cavity in \(\mathrm{MeV}\).

  • cavity_settings (CavitySettings) – Object holding the cavity parameters that can be changed.

  • phi_0_rel (float | None, default: None) – Relative entry phase of the cavity. When provided, it means that we are trying to find the \(\phi_{0,\,\mathrm{rel}}\) matching a given \(\phi_s\). The default is None.

Returns:

Keyword arguments that will be passed to the 1D transfer matrix function defined in cy_envelope_1d.transfer_matrices.

Return type:

dict[str, Any]

_abc_impl = <_abc._abc_data object at 0x70e253858f40>
_get_phi_0_rel(cavity_settings)[source]

Get the phase from the object.

Parameters:

cavity_settings (CavitySettings)

Return type:

float

class SuperposedFieldMapCyEnvelope1DParameters(*args, **kwargs)[source]

Bases: SuperposedFieldMapEnvelope1DParameters, ElementCyEnvelope1DParameters

Hold properties to compute transfer matrix of SuperposedFieldMap.

__init__(*args, **kwargs)[source]

Create the specific parameters for a superposed field map.

_abc_impl = <_abc._abc_data object at 0x70e25385b800>
class BendCyEnvelope1DParameters(elt, beam_kwargs, n_steps=1, **kwargs)[source]

Bases: BendEnvelope1DParameters, ElementCyEnvelope1DParameters

Hold the specific parameters to compute Bend transfer matrix.

In particular, we define factor_1, factor_2 and factor_3 to speed-up calculations.

Parameters:
_abc_impl = <_abc._abc_data object at 0x70e2538585c0>