minimize_mismatch module
Hold mismatch related functions.
It has its own module as this quantity is pretty specific.
- class MinimizeMismatch(name, weight, get_key, get_kwargs, reference, descriptor=None)[source]
Bases:
ObjectiveMinimize a mismatch factor.
- Parameters:
- __init__(name, weight, get_key, get_kwargs, reference, descriptor=None)[source]
Set complementary
SimulationOutput.get()flags, reference value.- Parameters:
get_key (str) – Must contain ‘twiss’ plus the name of a phase-space, or simply ‘twiss’ and the phase-space is defined in
get_kwargs.get_kwargs (dict[str, Element | str | bool]) – Keyword arguments for the
SimulationOutput.get()method. We do not check its validity, but in general you will want to define the keyseltandpos. You should also define thephase_space_namekey if it is not defined in theget_key.reference (SimulationOutput) – The reference simulation output from which the Twiss parameters will be taken.
name (
str)weight (
float)
- _twiss_getter(simulation_output)[source]
Get desired value using
SimulationOutput.get()method.- Parameters:
simulation_output (
SimulationOutput)- Return type:
- evaluate(simulation_output)[source]
Compute residue of this objective.
- Parameters:
simulation_output (SimulationOutput | float) – Object containing simulation results of the broken linac.
- Returns:
residue – Difference between current evaluation and ideal_value value for
self.name, scaled byself.weight.- Return type:
- _abc_impl = <_abc._abc_data object at 0x73dca705f800>