downhill_simplex module

Define the Downhill simplex (or Nelder-Mead) algorihm.

class DownhillSimplex(*, compensating_elements: Collection[Element], elts: ListOfElements, objectives: Collection[Objective], variables: Collection[Variable], compute_beam_propagation: Callable[[SetOfCavitySettings], SimulationOutput], compute_residuals: Callable[[SimulationOutput], Any], cavity_settings_factory: CavitySettingsFactory, reference_simulation_output: SimulationOutput, constraints: Collection[Constraint] | None = None, compute_constraints: Callable[[SimulationOutput], ndarray] | None = None, optimisation_algorithm_kwargs: dict[str, Any] | None = None, history_kwargs: dict[str, Any] | None = None, **kwargs)

Bases: OptimisationAlgorithm

Downhill simplex method, which does not use derivatives.

All the attributes but solution are inherited from the Abstract Base Class OptimisationAlgorithm.

supports_constraints: bool = False
optimize() OptiSol

Set up the optimization and solve the problem.

Returns:

opti_sol – Gives list of solutions, corresponding objective, convergence violation if applicable, etc.

Return type:

OptiSol

property _default_kwargs: dict[str, Any]

Create the kwargs for the optimisation.

_generate_opti_sol(result: OptimizeResult) OptiSol

Store the optimization results.

_format_variables() tuple[ndarray, Bounds]

Convert the Variable to an array and Bounds.

_abc_impl = <_abc._abc_data object at 0x7f36f75b1e00>