Overhaul beam trace optimisation toolkit
Sam's nice new tracing tools API at
finesse.tracing.tools offers a high level interface to the beam tracing functions in Finesse. The tracing optimisation toolkit at
finesse.tracing.assembly (used for e.g. running a cost function minimisation on some assembly of components and beam parameters) currently interfaces directly with the
Model class and extracts parameters out of the
SimulationTraceSolution. It would be nice to convert the optimisation tools to use the
PropagationSolution provided by the tracing tools API. The optimiser shouldn't need to access anything that isn't already provided by the tracing tools module, so it should just use it.
Another thing to change is the way the optimiser deals with free parameters. Currently the optimiser can only handle varying single value parameters like a lens's
f or mirror's
Rc in order to minimise some cost function, but for mode matching it's often useful to optimise the position of a lens or mirror where there can be multiple connected spaces to vary the length of. Currently if you tell the minimiser to vary some space's
L, this will not compensate for the other spaces connected to the component. It would be useful to provide a way that some pair of spaces' lengths can be varied with opposite signs by the optimiser. I'm not sure how this would get handled for beam splitters etc. where there could be more than two connected spaces - probably we should just not support this.