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:
ElementEnvelope1DParametersHold the parameters to compute beam propagation in an Element.
hasandgetmethod inherited fromElementBeamCalculatorParametersparent class.- Parameters:
- __init__(length_m, n_steps, beam_kwargs, transf_mat_function=None, **kwargs)[source]
Set the actually useful parameters.
- _proper_transfer_matrix_func(element_nature, method=None)[source]
Get the proper transfer matrix function.
- _abc_impl = <_abc._abc_data object at 0x70e2543dc580>
- class DriftCyEnvelope1DParameters(elt, beam_kwargs, n_steps=1, **kwargs)[source]
Bases:
DriftEnvelope1DParameters,ElementCyEnvelope1DParametersHold the properties to compute transfer matrix of a
Drift.As this is 1D, it is also used for
Solenoid,Quad, brokenFieldMap.- Parameters:
elt (
Element)beam_kwargs (
BeamKwargs)n_steps (
int, default:1)
- _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,ElementCyEnvelope1DParametersHold the properties to compute transfer matrix of a
FieldMap.Non-accelerating cavities will use
DriftEnvelope1DParametersinstead.- 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:
- _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:
- class SuperposedFieldMapCyEnvelope1DParameters(*args, **kwargs)[source]
Bases:
SuperposedFieldMapEnvelope1DParameters,ElementCyEnvelope1DParametersHold properties to compute transfer matrix of
SuperposedFieldMap.- _abc_impl = <_abc._abc_data object at 0x70e25385b800>
- class BendCyEnvelope1DParameters(elt, beam_kwargs, n_steps=1, **kwargs)[source]
Bases:
BendEnvelope1DParameters,ElementCyEnvelope1DParametersHold the specific parameters to compute
Bendtransfer matrix.In particular, we define
factor_1,factor_2andfactor_3to speed-up calculations.- Parameters:
elt (
Bend)beam_kwargs (
BeamKwargs)n_steps (
int, default:1)
- _abc_impl = <_abc._abc_data object at 0x70e2538585c0>