least_squares module
Define LeastSquares, a simple and fast optimization method.
- class LeastSquares(*, compensating_elements, elts, objectives, variables, compute_beam_propagation, compute_residuals, cavity_settings_factory, reference_simulation_output, constraints=None, compute_constraints=None, optimisation_algorithm_kwargs=None, history_kwargs=None, **kwargs)[source]
Bases:
DownhillSimplexPlain least-squares method, efficient for small problems.
See also
- Parameters:
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, default:None)compute_constraints (
Callable[[SimulationOutput],ndarray] |None, default:None)optimisation_algorithm_kwargs (
dict[str,Any] |None, default:None)
- optimize()[source]
Set up the optimization and solve the problem.
- Returns:
info – Gives list of solutions, corresponding objective, convergence violation if applicable, etc.
- Return type:
- _abc_impl = <_abc._abc_data object at 0x70e2501d0180>