Functions#

SpinWaveToolkit.bls.fresnel_coefficients(lambda_, DF, PM, d, source_layer_index, output_layer_index)#

Compute Fresnel coefficients for p- and s-polarized waves as a function of lateral wavevector q.

Parameters:
lambda_float

(m ) wavelength of the calculated light.

DFarray_like

() array of dielectric functions (complex) for each layer, ordered from top (superstrate) downward.

PMarray_like

() array of relative permeabilities for each layer (typically ones).

darray_like

(m ) array of thicknesses for the layers between the superstrate and substrate. Length should be len(DF) - 2.

source_layer_indexint

0-indexed index of the layer where the source (induced polarization) is located.

output_layer_indexint

0-indexed index of the layer where the output is desired.

Returns:
htpfunction

A function that computes the p-polarized Fresnel transmission coefficients for given q.

htsfunction

A function that computes the s-polarized Fresnel transmission coefficients for given q.

Notes

The returned functions htp and hts take single argument q, which can be a float or ndarray in units rad/m. The shape of their output depends on the shape of q and the chosen output_layer_index:

  • if 0 or N-1 (top or bottom layer), output shape is (2, ...) where ... is the shape of q,

  • elsewhere (any interior layer), output shape is (2, 2, ...).

SpinWaveToolkit.bls.sph_green_function(Kx, Ky, DFMagLayer, wavelength, tp, ts)#

Compute the spherical Green’s functions for p- and s-polarized fields.

Parameters:
Kx, Kyndarray

(rad/m) lateral wavevector components.

DFMagLayerfloat

() dielectric function (permitivity) of the magnetic layer.

wavelengthfloat

(m ) wavelength of the light.

tp, tslist or array_like

Fresnel coefficients for p- and s-polarization, respectively. Each is expected to have two elements (e.g. tp[0] and tp[1]).

Returns:
pGFlist[list]

A 3×2 list containing the p-polarized Green’s function components.

sGFlist[list]

A 3×2 list containing the s-polarized Green’s function components.

SpinWaveToolkit.bls.getBLSsignal(SweepBloch, KxKyBloch, Bloch, Exy, E, DF, PM, d, NA, Nq=30, source_layer_index=1, output_layer_index=0, wavelength=5.32e-07, collectionSpot=1e-06, focalLength=0.001)#

Calculate the BLS signal from the Bloch functions.

Parameters:
SweepBlochndarray

Sweep vector of the Bloch functions with shape (Nf,). Usually frequency of spin waves.

KxKyBlochtuple[ndarray]

(rad/m) tuple containing the 1D grids (kx_grid, ky_grid) on which the Bloch functions are defined.

Blochndarray

Array with shape (3, Nf, Nkx, Nky) containing the Bloch function components (Mx, My, Mz) for each frequency and KxKy grid point.

Exyndarray

(m ) XY grid for the electric field. 2D array with shape (Ny, Nx) containing the X and Y coordinates of the electric field.

Endarray

(V/m) 3D array with shape (3, Ny, Nx) containing the X, Y, Z components of the electric field.

DFndarray

() vector of the complex dielectric functions for each material in the stack.

PMndarray

() vector of the complex permeability functions for each material in the stack.

dndarray

(m ) thickness of all layers in the stack excluding the superstrate and substrate. Usually just the thickness of the magnetic layer.

NAfloat

Numerical aperture of the optical system.

Nqint, optional

Number of points in the q-space grid. Default is 30.

source_layer_indexint, optional

Index of the source layer in the stack. Default is 1.

output_layer_indexint, optional

Index of the output layer in the stack. Default is 0.

wavelengthfloat, optional

(m ) wavelength of the light. Default is 532e-9.

collectionSpotfloat, optional

(m ) collection spot size - used here as the beam waist. Default is 1e-6.

focalLengthfloat, optional

(m ) focal length of the lens. Default is 1e-3.

Returns:
ExSndarray

(V/m) scattered electric field in the X axis. 1D array with shape (Nf,) containing the scattered electric field in the X direction for each frequency in SweepBloch.

EySndarray

(V/m) scattered electric field in the Y axis. 1D array with shape (Nf,) containing the scattered electric field in the Y direction for each frequency in SweepBloch.

Px, Py, Pzndarray

(V/m) induced polarization in the magnetic layer. Corresponds to P in eq. (3) in Wojewoda et al. PRB 110, 224428 (2024). Each array has shape (Nf, 2*Nq-1, 2*Nq-1).

Qx, Qyndarray

(rad/m) k-space grids for polarizations Px, Py, Pz. Each array has shape (2*Nq-1, 2*Nq-1).