finesse.utilities.homs module
Functions for manipulating Higher Order Modes.
- finesse.utilities.homs.HG_to_LG(n, m)[source]
Returns the coefficients and mode indices of the Laguerre-Gaussian modes required to create a particular Hermote-Gaussian mode.
Parameters
- n, m: integer
Indices of the HG mode to re-create.
Returns
- coeffcients: array_like
Complex coefficients for each order=n+m LG mode required to re-create HG_n,m.
- ps, ls: array_like
LG mode indices corresponding to coefficients.
- finesse.utilities.homs.HG_to_LG_matrix(hgs, lgs)[source]
Returns a matrix that will convert a Hermite-Gaussian mode vector into Laguerre- Gaussian modes. The HG and LG modes provided to this function must contain all the required modes. A 2nd order HG mode will require 2nd order LG modes.
Parameters
- hgsarray_like
Array of (n,m) indicies
- lgsarray_like
Array of (p,l) indicies
Returns
- Kmatrix
Matrix to multiply with a HG mode vector to get the equivalent LG modes.
- finesse.utilities.homs.insert_modes(modes, new_modes)[source]
Inserts the mode indices in new_modes into the modes array at the correct (sorted) position(s).
Parameters
- modes
numpy.ndarray An array of HOM indices.
- new_modessequence, str
A single mode index pair or an iterable of mode indices. Each element must unpack to two integer convertible values.
Returns
- out
numpy.ndarray A sorted array of HOM indices consisting of the original contents of modes with the mode indices from new_modes included.
Raises
- ValueError
If new_modes is not a mode index pair or iterable of mode indices.
See Also
make_modes
Examples
Make an array of even modes and insert new modes into this:
>>> modes = make_modes("even", 2) >>> modes array([[0, 0], [0, 2], [2, 0]], dtype=int32) >>> insert_modes(modes, ["11", "32"]) array([[0, 0], [0, 2], [1, 1], [2, 0], [3, 2]], dtype=int32)
- modes
- finesse.utilities.homs.jacobi_real_x(n, a, b, x)[source]
Jacobi Polynomial P_n^{a,b}(x) for real x.
n / n+a \ / n+b \ / x-1 \^(s) / x+1 \^(n-s) P_n^{a,b}(x)= Sum | | | | | --- | | --- | s=0 \ n-s / \ s / \ 2 / \ 2 /Parameters
- n, a, bint
Polynomial coefficients
- xfloat
Polynomial argument
Notes
Implementation of Jacobi function using binominal coefficients. This can handle values of alpha, beta < -1 which the special.eval_jacobi function does not.
- finesse.utilities.homs.lens_diopt_to_f(f, d)[source]
Convert a dioptre shift, at a lens, to a focal length.
Parameters
- ffloat
The initial focal length of the lens.
- dfloat, array-like
A value or array of values representing the dioptre shift.
Returns
- outfloat, array-like
The new value(s) of the focal length.
- finesse.utilities.homs.make_modes(select=None, maxtem=None)[source]
Construct a 2D
numpy.ndarrayof HOM indices.Parameters
- selectsequence, str, optional; default: None
Identifier for the mode indices to generate. This can be:
An iterable of mode indices, where each element in the iterable must unpack to two integer convertible values.
A string identifying the type of modes to include, must be one of “even”, “odd”, “x” or “y”.
- maxtemint, optional; default: None
Optional maximum mode order, applicable only for when select is a string. This is ignored if select is not a string.
Returns
- modes
numpy.ndarray An array of mode indices.
Raises
- ValueError
If either of the arguments select, maxtem are invalid or non-unique.
See Also
insert_modes : Add modes to an existing mode indices array at the correct positions.
Examples
Modes up to a maximum order of 2:
>>> make_modes(maxtem=2) array([[0, 0], [0, 1], [0, 2], [1, 0], [1, 1], [2, 0]], dtype=int32)
Even modes up to order 4:
>>> make_modes("even", maxtem=4) array([[0, 0], [0, 2], [0, 4], [2, 0], [2, 2], [4, 0]], dtype=int32)
Sagittal modes up to order 3:
>>> make_modes("y", maxtem=3) array([[0, 0], [0, 1], [0, 2], [0, 3]], dtype=int32)
Modes from a list of strings:
>>> make_modes(["00", "11", "22"]) array([[0, 0], [1, 1], [2, 2]], dtype=int32)
- finesse.utilities.homs.make_modes_LG(maxtem)[source]
Returns an array of LG modes ordered in increasing polynomial order, 2p+|l|.
Parameters
- maxtemint
Maximum LG order to include, maxtem > 0.
Returns
- plarray_like
array of (p,l) indicies
- finesse.utilities.homs.surface_diopt_to_roc(roc, d)[source]
Convert a dioptre shift, at a surface, to a radius of curvature.
Parameters
- rocfloat
The initial radius of curvature of the surface.
- dfloat, array-like
A value or array of values representing the dioptre shift.
Returns
- outfloat, array-like
The new values of the radius of curvature.