typing module

Define types for better code-completion and linting.

PHASE_SPACES = ('phiw', 'phiw99', 't', 'x', 'x99', 'y', 'y99', 'z', 'zdelta')

List of different phase spaces.

GETTABLE_BEAM_PARAMETERS_PHASE_SPACE = (   'alpha',     'beta',     'beta_kin',     'envelope_energy',     'envelope_pos',     'eps',     'eps_no_normalization',     'eps_normalized',     'gamma',     'gamma_kin',     'sigma',     'twiss',     'z_abs',     'phiw',     'phiw99',     't',     'x',     'x99',     'y',     'y99',     'z',     'zdelta')

Attributes that are stored in InitialPhaseSpaceBeamParameters and PhaseSpaceBeamParameters.

GETTABLE_BEAM_PARAMETERS = (   'alpha_phiw',     'beta_phiw',     'envelope_energy_phiw',     'envelope_pos_phiw',     'eps_phiw',     'eps_no_normalization_phiw',     'eps_normalized_phiw',     'gamma_phiw',     'sigma_phiw',     'twiss_phiw',     'alpha_phiw99',     'beta_phiw99',     'envelope_energy_phiw99',     'envelope_pos_phiw99',     'eps_phiw99',     'eps_no_normalization_phiw99',     'eps_normalized_phiw99',     'gamma_phiw99',     'sigma_phiw99',     'twiss_phiw99',     'alpha_t',     'beta_t',     'envelope_energy_t',     'envelope_pos_t',     'eps_t',     'eps_no_normalization_t',     'eps_normalized_t',     'gamma_t',     'sigma_t',     'twiss_t',     'alpha_x',     'beta_x',     'envelope_energy_x',     'envelope_pos_x',     'eps_x',     'eps_no_normalization_x',     'eps_normalized_x',     'gamma_x',     'sigma_x',     'twiss_x',     'alpha_x99',     'beta_x99',     'envelope_energy_x99',     'envelope_pos_x99',     'eps_x99',     'eps_no_normalization_x99',     'eps_normalized_x99',     'gamma_x99',     'sigma_x99',     'twiss_x99',     'alpha_y',     'beta_y',     'envelope_energy_y',     'envelope_pos_y',     'eps_y',     'eps_no_normalization_y',     'eps_normalized_y',     'gamma_y',     'sigma_y',     'twiss_y',     'alpha_y99',     'beta_y99',     'envelope_energy_y99',     'envelope_pos_y99',     'eps_y99',     'eps_no_normalization_y99',     'eps_normalized_y99',     'gamma_y99',     'sigma_y99',     'twiss_y99',     'alpha_z',     'beta_z',     'envelope_energy_z',     'envelope_pos_z',     'eps_z',     'eps_no_normalization_z',     'eps_normalized_z',     'gamma_z',     'sigma_z',     'twiss_z',     'alpha_zdelta',     'beta_zdelta',     'envelope_energy_zdelta',     'envelope_pos_zdelta',     'eps_zdelta',     'eps_no_normalization_zdelta',     'eps_normalized_zdelta',     'gamma_zdelta',     'sigma_zdelta',     'twiss_zdelta',     'alpha',     'beta',     'beta_kin',     'envelope_energy',     'envelope_pos',     'eps',     'eps_no_normalization',     'eps_normalized',     'gamma',     'gamma_kin',     'sigma',     'twiss',     'z_abs',     'phiw',     'phiw99',     't',     'x',     'x99',     'y',     'y99',     'z',     'zdelta')

Attributes that are stored in InitialBeamParameters and BeamParameters.

BEAM_KEYS = (   'e_mev',     'e_rest_mev',     'f_bunch_mhz',     'i_milli_a',     'q_adim',     'sigma',     'inv_e_rest_mev',     'gamma_init',     'omega_0_bunch',     'lambda_bunch',     'q_over_m',     'm_over_q')

Attributes stored in the ParticleFullTrajectory.beam dictionary.

GETTABLE_PARTICLE = (   'beta',     'gamma',     'phi_abs',     'synchronous',     'w_kin',     'z_in',     'e_mev',     'e_rest_mev',     'f_bunch_mhz',     'i_milli_a',     'q_adim',     'sigma',     'inv_e_rest_mev',     'gamma_init',     'omega_0_bunch',     'lambda_bunch',     'q_over_m',     'm_over_q')

Attributes that can be extracted with ParticleFullTrajectory.get() method.

GETTABLE_BEAM_CALC_PARAMETERS = (   'abs_mesh',     'd_z',     'n_steps',     'rel_mesh',     's_in',     's_out',     'transf_mat_function')

Attributes that can be extracted with ElementBeamCalculatorParameters.get() method.

REFERENCE_PHASES = ('phi_0_abs', 'phi_0_rel', 'phi_s')

The three types of reference phase

EXPORT_PHASES = ('as_in_original_dat', 'as_in_settings', 'phi_0_abs', 'phi_0_rel', 'phi_s')

How phases can be saved in the output DAT file.

ALLOWED_STATUS = (   'nominal',     'rephased (in progress)',     'rephased (ok)',     'failed',     'compensate (in progress)',     'compensate (ok)',     'compensate (not ok)')

Different status for cavities

GETTABLE_RF_FIELD = ('e_spat', 'n_cell', 'n_z', 'starting_position', 'section_idx')

Attributes that can be extracted with RfField.get() method.

GETTABLE_CAVITY_SETTINGS = (   'acceptance_energy',     'field',     'freq_cavity_mhz',     'k_e',     'omega_0_rf',     'acceptance_phi',     'phi_ref',     'phi_rf',     'phi_s',     'phi_s_func',     'reference',     'rf_field',     'status',     'v_cav_mv',     'w_kin',     'phi_0_abs',     'phi_0_rel',     'phi_s',     'e_spat',     'n_cell',     'n_z',     'starting_position',     'section_idx')

Attributes that can be extracted with CavitySettings.get() method.

CONCATENABLE_CAVITY_SETTINGS = (   'v_cav_mv',     'phi_0_abs',     'phi_0_rel',     'phi_bunch',     'phi_ref',     'phi_rf',     'phi_s',     'acceptance_phi',     'acceptance_energy')

Attributes from CavitySettings to concatenate into a list when called from ListOfElements.get() (or SimulationOutput.get())

GETTABLE_ELT = (   'dat_idx',     'elt_idx',     'idx',     'idx_in_lattice',     'lattice',     'length_m',     'name',     'nature',     'section',     'abs_mesh',     'd_z',     'n_steps',     'rel_mesh',     's_in',     's_out',     'transf_mat_function')

Attributes that can be extracted with Element.get() method.

GETTABLE_FIELD_MAP = (   'aperture_flag',     'field_map_filename',     'field_map_folder',     'geometry',     'e_spat',     'n_cell',     'n_z',     'starting_position',     'section_idx',     'dat_idx',     'elt_idx',     'idx',     'idx_in_lattice',     'lattice',     'length_m',     'name',     'nature',     'section',     'abs_mesh',     'd_z',     'n_steps',     'rel_mesh',     's_in',     's_out',     'transf_mat_function',     'acceptance_energy',     'field',     'freq_cavity_mhz',     'k_e',     'omega_0_rf',     'acceptance_phi',     'phi_ref',     'phi_rf',     'phi_s',     'phi_s_func',     'reference',     'rf_field',     'status',     'v_cav_mv',     'w_kin',     'phi_0_abs',     'phi_0_rel',     'phi_s',     'e_spat',     'n_cell',     'n_z',     'starting_position',     'section_idx')

Attributes that can be extracted with FieldMap.get() method.

CONCATENABLE_ELTS = (   'aperture_flag',     'field_map_filename',     'field_map_folder',     'geometry',     'e_spat',     'n_cell',     'n_z',     'starting_position',     'section_idx',     'dat_idx',     'elt_idx',     'idx',     'idx_in_lattice',     'lattice',     'length_m',     'name',     'nature',     'section',     'abs_mesh',     'd_z',     'n_steps',     'rel_mesh',     's_in',     's_out',     'transf_mat_function',     'acceptance_energy',     'field',     'freq_cavity_mhz',     'k_e',     'omega_0_rf',     'acceptance_phi',     'phi_ref',     'phi_rf',     'phi_s',     'phi_s_func',     'reference',     'rf_field',     'status',     'v_cav_mv',     'phi_0_abs',     'phi_0_rel',     'phi_s',     'e_spat',     'n_cell',     'n_z',     'starting_position',     'section_idx')

Attributes from Element or FieldMap to concatenate into a list when called from ListOfElements.get() (or SimulationOutput.get(), Accelerator.get())

GETTABLE_ELTS = (   'accelerator_path',     'dat_file',     'dat_filecontent',     'elts_n_cmds',     'files',     'input_beam',     'input_particle',     'tm_cumul_in',     'aperture_flag',     'field_map_filename',     'field_map_folder',     'geometry',     'e_spat',     'n_cell',     'n_z',     'starting_position',     'section_idx',     'dat_idx',     'elt_idx',     'idx',     'idx_in_lattice',     'lattice',     'length_m',     'name',     'nature',     'section',     'abs_mesh',     'd_z',     'n_steps',     'rel_mesh',     's_in',     's_out',     'transf_mat_function',     'acceptance_energy',     'field',     'freq_cavity_mhz',     'k_e',     'omega_0_rf',     'acceptance_phi',     'phi_ref',     'phi_rf',     'phi_s',     'phi_s_func',     'reference',     'rf_field',     'status',     'v_cav_mv',     'w_kin',     'phi_0_abs',     'phi_0_rel',     'phi_s',     'e_spat',     'n_cell',     'n_z',     'starting_position',     'section_idx',     'beta',     'gamma',     'phi_abs',     'synchronous',     'w_kin',     'z_in',     'e_mev',     'e_rest_mev',     'f_bunch_mhz',     'i_milli_a',     'q_adim',     'sigma',     'inv_e_rest_mev',     'gamma_init',     'omega_0_bunch',     'lambda_bunch',     'q_over_m',     'm_over_q',     'alpha_phiw',     'beta_phiw',     'envelope_energy_phiw',     'envelope_pos_phiw',     'eps_phiw',     'eps_no_normalization_phiw',     'eps_normalized_phiw',     'gamma_phiw',     'sigma_phiw',     'twiss_phiw',     'alpha_phiw99',     'beta_phiw99',     'envelope_energy_phiw99',     'envelope_pos_phiw99',     'eps_phiw99',     'eps_no_normalization_phiw99',     'eps_normalized_phiw99',     'gamma_phiw99',     'sigma_phiw99',     'twiss_phiw99',     'alpha_t',     'beta_t',     'envelope_energy_t',     'envelope_pos_t',     'eps_t',     'eps_no_normalization_t',     'eps_normalized_t',     'gamma_t',     'sigma_t',     'twiss_t',     'alpha_x',     'beta_x',     'envelope_energy_x',     'envelope_pos_x',     'eps_x',     'eps_no_normalization_x',     'eps_normalized_x',     'gamma_x',     'sigma_x',     'twiss_x',     'alpha_x99',     'beta_x99',     'envelope_energy_x99',     'envelope_pos_x99',     'eps_x99',     'eps_no_normalization_x99',     'eps_normalized_x99',     'gamma_x99',     'sigma_x99',     'twiss_x99',     'alpha_y',     'beta_y',     'envelope_energy_y',     'envelope_pos_y',     'eps_y',     'eps_no_normalization_y',     'eps_normalized_y',     'gamma_y',     'sigma_y',     'twiss_y',     'alpha_y99',     'beta_y99',     'envelope_energy_y99',     'envelope_pos_y99',     'eps_y99',     'eps_no_normalization_y99',     'eps_normalized_y99',     'gamma_y99',     'sigma_y99',     'twiss_y99',     'alpha_z',     'beta_z',     'envelope_energy_z',     'envelope_pos_z',     'eps_z',     'eps_no_normalization_z',     'eps_normalized_z',     'gamma_z',     'sigma_z',     'twiss_z',     'alpha_zdelta',     'beta_zdelta',     'envelope_energy_zdelta',     'envelope_pos_zdelta',     'eps_zdelta',     'eps_no_normalization_zdelta',     'eps_normalized_zdelta',     'gamma_zdelta',     'sigma_zdelta',     'twiss_zdelta',     'alpha',     'beta',     'beta_kin',     'envelope_energy',     'envelope_pos',     'eps',     'eps_no_normalization',     'eps_normalized',     'gamma',     'gamma_kin',     'sigma',     'twiss',     'z_abs',     'phiw',     'phiw99',     't',     'x',     'x99',     'y',     'y99',     'z',     'zdelta')

Attributes that can be extracted with ListOfElements.get() method.

GETTABLE_STRUCTURE_DEPENDENT = (   'dat_idx',     'elt_idx',     'idx',     'idx_in_lattice',     'lattice',     'length_m',     'name',     'nature',     'section',     'abs_mesh',     'd_z',     'n_steps',     'rel_mesh',     's_in',     's_out',     'transf_mat_function',     'e_spat',     'n_cell',     'n_z',     'starting_position',     'section_idx',     'aperture_flag',     'field_map_filename',     'field_map_folder',     'geometry',     'field',     'freq_cavity_mhz',     'omega_0_rf')

Attributes that are structure-dependent and should not vary from simulation to simulation

GETTABLE_TRANSFER_MATRIX = (   'cumulated',     'individual',     'n_points',     'r_xx',     'r_yy',     'r_zdelta',     'r_zdelta_11',     'r_zdelta_12',     'r_zdelta_21',     'r_zdelta_22',     'r_zz')

Attributes that can be extracted with TransferMatrix.get() method.

GETTABLE_SIMULATION_OUTPUT = (   'beam_parameters',     'element_to_index',     'elt_idx',     'phi_s',     'set_of_cavity_settings',     'synch_trajectory',     'v_cav_mv',     'z_abs',     'alpha_phiw',     'beta_phiw',     'envelope_energy_phiw',     'envelope_pos_phiw',     'eps_phiw',     'eps_no_normalization_phiw',     'eps_normalized_phiw',     'gamma_phiw',     'sigma_phiw',     'twiss_phiw',     'alpha_phiw99',     'beta_phiw99',     'envelope_energy_phiw99',     'envelope_pos_phiw99',     'eps_phiw99',     'eps_no_normalization_phiw99',     'eps_normalized_phiw99',     'gamma_phiw99',     'sigma_phiw99',     'twiss_phiw99',     'alpha_t',     'beta_t',     'envelope_energy_t',     'envelope_pos_t',     'eps_t',     'eps_no_normalization_t',     'eps_normalized_t',     'gamma_t',     'sigma_t',     'twiss_t',     'alpha_x',     'beta_x',     'envelope_energy_x',     'envelope_pos_x',     'eps_x',     'eps_no_normalization_x',     'eps_normalized_x',     'gamma_x',     'sigma_x',     'twiss_x',     'alpha_x99',     'beta_x99',     'envelope_energy_x99',     'envelope_pos_x99',     'eps_x99',     'eps_no_normalization_x99',     'eps_normalized_x99',     'gamma_x99',     'sigma_x99',     'twiss_x99',     'alpha_y',     'beta_y',     'envelope_energy_y',     'envelope_pos_y',     'eps_y',     'eps_no_normalization_y',     'eps_normalized_y',     'gamma_y',     'sigma_y',     'twiss_y',     'alpha_y99',     'beta_y99',     'envelope_energy_y99',     'envelope_pos_y99',     'eps_y99',     'eps_no_normalization_y99',     'eps_normalized_y99',     'gamma_y99',     'sigma_y99',     'twiss_y99',     'alpha_z',     'beta_z',     'envelope_energy_z',     'envelope_pos_z',     'eps_z',     'eps_no_normalization_z',     'eps_normalized_z',     'gamma_z',     'sigma_z',     'twiss_z',     'alpha_zdelta',     'beta_zdelta',     'envelope_energy_zdelta',     'envelope_pos_zdelta',     'eps_zdelta',     'eps_no_normalization_zdelta',     'eps_normalized_zdelta',     'gamma_zdelta',     'sigma_zdelta',     'twiss_zdelta',     'alpha',     'beta',     'beta_kin',     'envelope_energy',     'envelope_pos',     'eps',     'eps_no_normalization',     'eps_normalized',     'gamma',     'gamma_kin',     'sigma',     'twiss',     'z_abs',     'phiw',     'phiw99',     't',     'x',     'x99',     'y',     'y99',     'z',     'zdelta',     'beta',     'gamma',     'phi_abs',     'synchronous',     'w_kin',     'z_in',     'e_mev',     'e_rest_mev',     'f_bunch_mhz',     'i_milli_a',     'q_adim',     'sigma',     'inv_e_rest_mev',     'gamma_init',     'omega_0_bunch',     'lambda_bunch',     'q_over_m',     'm_over_q',     'cumulated',     'individual',     'n_points',     'r_xx',     'r_yy',     'r_zdelta',     'r_zdelta_11',     'r_zdelta_12',     'r_zdelta_21',     'r_zdelta_22',     'r_zz')

Attributes that can be extracted with SimulationOutput.get() method.

GETTABLE_ACCELERATOR = (   'accelerator_path',     'elts',     'name',     'simulation_outputs',     'accelerator_path',     'dat_file',     'dat_filecontent',     'elts_n_cmds',     'files',     'input_beam',     'input_particle',     'tm_cumul_in',     'aperture_flag',     'field_map_filename',     'field_map_folder',     'geometry',     'e_spat',     'n_cell',     'n_z',     'starting_position',     'section_idx',     'dat_idx',     'elt_idx',     'idx',     'idx_in_lattice',     'lattice',     'length_m',     'name',     'nature',     'section',     'abs_mesh',     'd_z',     'n_steps',     'rel_mesh',     's_in',     's_out',     'transf_mat_function',     'acceptance_energy',     'field',     'freq_cavity_mhz',     'k_e',     'omega_0_rf',     'acceptance_phi',     'phi_ref',     'phi_rf',     'phi_s',     'phi_s_func',     'reference',     'rf_field',     'status',     'v_cav_mv',     'w_kin',     'phi_0_abs',     'phi_0_rel',     'phi_s',     'e_spat',     'n_cell',     'n_z',     'starting_position',     'section_idx',     'beta',     'gamma',     'phi_abs',     'synchronous',     'w_kin',     'z_in',     'e_mev',     'e_rest_mev',     'f_bunch_mhz',     'i_milli_a',     'q_adim',     'sigma',     'inv_e_rest_mev',     'gamma_init',     'omega_0_bunch',     'lambda_bunch',     'q_over_m',     'm_over_q',     'alpha_phiw',     'beta_phiw',     'envelope_energy_phiw',     'envelope_pos_phiw',     'eps_phiw',     'eps_no_normalization_phiw',     'eps_normalized_phiw',     'gamma_phiw',     'sigma_phiw',     'twiss_phiw',     'alpha_phiw99',     'beta_phiw99',     'envelope_energy_phiw99',     'envelope_pos_phiw99',     'eps_phiw99',     'eps_no_normalization_phiw99',     'eps_normalized_phiw99',     'gamma_phiw99',     'sigma_phiw99',     'twiss_phiw99',     'alpha_t',     'beta_t',     'envelope_energy_t',     'envelope_pos_t',     'eps_t',     'eps_no_normalization_t',     'eps_normalized_t',     'gamma_t',     'sigma_t',     'twiss_t',     'alpha_x',     'beta_x',     'envelope_energy_x',     'envelope_pos_x',     'eps_x',     'eps_no_normalization_x',     'eps_normalized_x',     'gamma_x',     'sigma_x',     'twiss_x',     'alpha_x99',     'beta_x99',     'envelope_energy_x99',     'envelope_pos_x99',     'eps_x99',     'eps_no_normalization_x99',     'eps_normalized_x99',     'gamma_x99',     'sigma_x99',     'twiss_x99',     'alpha_y',     'beta_y',     'envelope_energy_y',     'envelope_pos_y',     'eps_y',     'eps_no_normalization_y',     'eps_normalized_y',     'gamma_y',     'sigma_y',     'twiss_y',     'alpha_y99',     'beta_y99',     'envelope_energy_y99',     'envelope_pos_y99',     'eps_y99',     'eps_no_normalization_y99',     'eps_normalized_y99',     'gamma_y99',     'sigma_y99',     'twiss_y99',     'alpha_z',     'beta_z',     'envelope_energy_z',     'envelope_pos_z',     'eps_z',     'eps_no_normalization_z',     'eps_normalized_z',     'gamma_z',     'sigma_z',     'twiss_z',     'alpha_zdelta',     'beta_zdelta',     'envelope_energy_zdelta',     'envelope_pos_zdelta',     'eps_zdelta',     'eps_no_normalization_zdelta',     'eps_normalized_zdelta',     'gamma_zdelta',     'sigma_zdelta',     'twiss_zdelta',     'alpha',     'beta',     'beta_kin',     'envelope_energy',     'envelope_pos',     'eps',     'eps_no_normalization',     'eps_normalized',     'gamma',     'gamma_kin',     'sigma',     'twiss',     'z_abs',     'phiw',     'phiw99',     't',     'x',     'x99',     'y',     'y99',     'z',     'zdelta')

Attributes that can be extracted with Accelerator.get() method.

POS_T

Allowed values for the pos keyword argument in get methods.

alias of Literal[‘in’, ‘out’]

VARIABLES = ('k_e', 'phi_0_abs', 'phi_0_rel', 'phi_s')

Implemented optimization variables

class BeamKwargs[source]

Bases: TypedDict

Holds all beam properties.

e_mev: float
e_rest_mev: float
f_bunch_mhz: float
i_milli_a: float
q_adim: float
sigma: ndarray[tuple[Any, ...], dtype[TypeVar(_ScalarT, bound= generic)]]
inv_e_rest_mev: float
gamma_init: float
omega_0_bunch: float
lambda_bunch: float
q_over_m: float
m_over_q: float