finesse.cymath.laguerre.compute_lg_mode¶
- finesse.cymath.laguerre.compute_lg_mode(int p, int l, double w0, double z, double wavelength, ndarray x, ndarray y, helical=True) np.ndarray[np.complex128] ¶
Compute a Laguerre-Gaussian mode.
- Parameters
- pint
Radial index of the Laguerre-Gaussian mode.
- lint
Azimuthal index of the Laguerre-Gaussian mode.
- w0double
Beam waist.
- zdouble
Propagation distance.
- wavelengthdouble
Wavelength of the beam.
- xnp.ndarray[double, ndim=1]
Array of x-coordinates.
- ynp.ndarray[double, ndim=1]
Array of y-coordinates.
- helicalbool
True if this is a helical LG mode, False for Sinusoidal
- Returns
- np.ndarray[np.complex128]
2D array of complex values representing the Laguerre-Gaussian mode at the given coordinates.
Examples
>>> import finesse >>> from finesse.cymath import laguerre as lg >>> import numpy as np >>> import matplotlib.pyplot as plt >>> finesse.init_plotting() >>> >>> fig, axes = plt.subplots(3, 3, figsize=(8, 8)) >>> >>> w0 = 1e-3 >>> z = 0 >>> x = np.linspace(-4 * w0, +4 * w0, 50) >>> y = np.linspace(-4 * w0, +4 * w0, 51) >>> X, Y = np.meshgrid(x, y) >>> helical = False # whether to plot helical LG modes or sinusoidal LG modes >>> >>> for i, p in enumerate([0, 1, 2]): >>> for j, l in enumerate([0, 1, 2]): >>> E = lg.compute_lg_mode(p, l, w0, z, 1064e-9, x, y, helical) >>> intensity = np.abs(E) ** 2 >>> ax = axes[i, j] >>> C = ax.contourf(X, Y, intensity.T, levels=100) >>> C.set_edgecolor("face") >>> ax.set_title(f"LG Mode p={p}, l={l}") >>> ax.set_aspect("equal") >>> >>> for ax in axes.flatten(): >>> ax.set_xticks([]) >>> ax.set_yticks([]) >>> plt.tight_layout() >>> plt.show()