# finesse.gaussian.optimise_HG00_q¶

finesse.gaussian.optimise_HG00_q(e, q, homs, max_iterations=100, accuracy=1e-09, return_field=False)[source]

Computes the optimal complex beam parameter to describe an optical field, described by a vector of HG modes. This optimisation assumes that the field to be optimised is approximately a HG00 beam shape.

Parameters:
earray_like

Array of complex HG mode amplitudes to be optimised

q[complex | finesse.BeamParam] or tuple

x and y complex beam parameter basis that e is in. If a singular value is given qx=qy, else (qx, qy) should be provided.

homslist(tuple(n, m))

List of HG mode indices for each element in e

max_iterationsint, optional

Maximum number of iterations to try before raising a RuntimeError

accuracyfloat, optional

level to suppress HG20 and HG02 modes to

return_fieldbool, optional

When True the optimised array of HG modes is returned

Returns:
qx, qy(finesse.BeamParam, finesse.BeamParam)

Optimised beam parameters

endarray

optimised HG mode amplitude array, only when return_field == True

Raises:
ConvergenceException

If the maximum number of iterations is reached.

Notes

The algorithm is fairly simple: assuming an approximatly HG00 beam described by a vector of HG modes has the wrong basis, it will have less HG00 amplitude and more HG20 and HG02 modes. The optimal basis is then finding {qx, qy} which reduces the amount of HG20 and HG02.

This algorithm is iterative and takes linear steps towards the correct {qx, qy} using the amount of HG20 and HG02 present. The next q to try is given by:

$\frac{-4 a Z_r}{i\sqrt{2}} + q$

Where $$a$$ is the amplitude of the HG20 or HG02 for x and y optimisation in each direction. The above is reached by the coupling coefficient k_00->02 and determining how much amplitude is expected for a given mismatch, then reverting it.

When using a finite number of modes to describe some mismatched beam some level of information is lost and not retrievable with this method. For large mismatches it may not be possible to optimise back to the true beam parameters.

For example, consider describing a mismatched beam up to order 6 HG modes. A mismatched beam will scatter the 6th order modes into the 8th which are not included in the description of the beam, therefore the information is lost. When performing this inverse the 8th order mode information cannot be brought back to fix the 6th order mode. The result is that this method may not reduce higher order terms.