finesse.knm.maps.map_scattering_coefficients

finesse.knm.maps.map_scattering_coefficients(q: BeamParam, int max_order, double[::1] x, double[::1] y, double complex[:, ::1] Z, bool reverse_gouy=False)

Calculates the mode scattering coefficients up to some maximum mode order for a uniformly spaced 2-dimensional map. Essentially it is computing multiple overlap integrals between each input and output mode for some complex valued abberation map, Z.

\[K_{abnm} = \iint^{\infty}_{-\infty} U_{nm}(x,y,q_{ix},q_{iy}) Z(x,y) U^*_{ab}(x,y,q_{ox},q_{oy}) \, dy \, dx \]
  • ab are the output mode indicies

  • nm are the input mode indicies

Parameters:
qBeamParam

Setting input and output complex beam parameters for overlap calcuations. Options are: - q : all input/output beam parameters are the same - (qx, qy) : astigmatic input/output beam parameters - (q_ix, q_iy, q_ox, q_oy) : general case, each x/y input/out can be different

max_orderint

Maximum order of mode scattering to compute up to.

x, yarray[double]

1-dimensional arrays specifying the x and y uniformally sampled axis for the map

Zarray[complex]

2-dimensional array describing the complex abberation being applied to some input beam. The shape of this array should be Z[Ny, Nx], where Ny and Nx are the number of y and x samples respectively.

reverse_gouybool, optional

If true, the gouy phase terms are removed from the scattering coefficients

Returns:
Karray[complex]

Coupling coefficients array with indexing (inx, outx, iny, outy) upto max_order input.

Examples

Same input and output beam parameter but computing the scattering from some arbitrary map:

import finesse
from finesse.knm.maps import map_scattering_coefficients
import numpy as np

maxtem = 10
q = finesse.BeamParam(w0=1e-3, z=0)
x = np.linspace(-4*q.w, 4*q.w, 201)
y = np.linspace(-4*q.w, 4*q.w, 200)
X, Y = np.meshgrid(x, y)
# Mix of liner and quadratic phase terms to compute scattering
# coefficients for
Z = np.exp(
    1j * 1e-6 * 2 * np.pi
    * (0.2*X + 0.1*Y + 1000*X**2 - 1000*Y**2) / 1064e-9
)
K = map_scattering_coefficients(q, maxtem, x, y, Z)
print("HG 10 -> 30", K[1,3,0,0])
print("HG 00 -> 00", K[0,0,0,0])
print("HG 00 -> 21", K[0,2,0,1])

Different input and output beam parameters. Here modelling mode mismatch between different beam parameters:

qx1 = finesse.BeamParam(w0=1e-3, z=0)
qy1 = qx1
qx2 = finesse.BeamParam(w0=1.2e-3, z=0)
qy2 = qx2

Z = np.ones_like(Z)
K = map_scattering_coefficients((qx1,qy1,qx2,qy2), maxtem, x, y, Z)
print("HG 00 -> 20", K[0,2,0,0])
print("HG 00 -> 00", K[0,0,0,0])