fmm#
Functions related to layer eigenmode calculation for the FMM algorithm.
Copyright (c) Meta Platforms, Inc. and affiliates.
- class fmmax.fmm.Formulation(value)[source]#
Enumerates supported Fourier modal method formulations.
Each formulation specifies an algorithm to compute the transverse permittivity matrix used in the Fourier modal method. The simplest formulation is FFT, in which the blocks of the transverse permittivity matrix are simply the Fourier convolution matrices for their respective permittivity tensor components.
The remaining formulations are so-called vector formulations, which make use of a vector field generated in the unit cell of the FMM calculation. The vector field defines a local coordinate system that tangent and normal to the interfaces of features in the unit cell, allowing improved convergence through independent treatment of field components that are tangent and normal to the interfaces.
- Formulations:
FFT: The simplest formulation. POL: generates a complex linear vector field which has maximum magnitude 1 and
a null in the interior of features. In the objective, the gradient of the vector field on the real-space grid is computed; a penalty term discourages non-smooth fields (i.e. fields whose gradient is large).
- NORMAL: takes the field computed by POL, but then normalizes so the magnitude
is 1 evereywhere in the unit cell. Where POL has zeros, NORMAL has discontinuities.
- JONES: takes the field computed by POL, and converts it to a complex
elliptical field which has magnitude 1 everywhere and lacks discontinuities.
- JONES_DIRECT: directly computes a complex elliptical vector field without first
finding a linear vector field. Smoothness is evaluated on the real-space grid.
- POL_FOURIER: generates a complex linear vector field, but with an alternate
method of penalizing non-smoothness. Specifically, the Fourier components corresponding to high spatial frequencies are penalized. Compared to POL, POL_FOURIER can be computed more efficiently.
- NORMAL_FOURIER: takes the field computed by POL_FOURIER, but then normalizes
so the magnitude is 1 evereywhere in the unit cell.
- JONES_FOURIER: takes the field computed by POL_FOURIER and converts it to a
complex elliptical field.
- JONES_DIRECT_FOURIER: directly computes a complex elliptical vector field, using
Fourier coefficients to penalize non-smoothness.
- class fmmax.fmm.LayerSolveResult(wavelength: Array, in_plane_wavevector: Array, primitive_lattice_vectors: LatticeVectors, expansion: Expansion, eigenvalues: Array, eigenvectors: Array, z_permittivity_matrix: Array, inverse_z_permittivity_matrix: Array, z_permeability_matrix: Array, inverse_z_permeability_matrix: Array, transverse_permeability_matrix: Array, tangent_vector_field: Tuple[Array, Array] | None)[source]#
Stores the result of a layer eigensolve.
This eigenvalue problem is specified in equation 28 of [2012 Liu].
- wavelength#
The wavelength for the solve.
- Type:
jax.Array
- in_plane_wavevector#
The in-plane wavevector for the solve.
- Type:
jax.Array
- primitive_lattice_vectors#
The primitive vectors for the real-space lattice.
- expansion#
The expansion used for the eigensolve.
- Type:
- eigenvalues#
The layer eigenvalues.
- Type:
jax.Array
- eigenvectors#
The layer eigenvectors.
- Type:
jax.Array
- z_permittivity_matrix#
The fourier-transformed zz-component of permittivity.
- Type:
jax.Array
- inverse_z_permittivity_matrix#
The fourier-transformed inverse of zz-component of permittivity.
- Type:
jax.Array
- z_permeability_matrix#
The fourier-transformed zz-component of permeability.
- Type:
jax.Array
- inverse_z_permeability_matrix#
The fourier-transformed inverse of zz-component of permeability.
- Type:
jax.Array
- transverse_permeability_matrix#
The transverse permeability matrix, needed to calculate the omega-script-k matrix from equation 26 of [2012 Liu]. This is needed to generate the layer scattering matrix.
- Type:
jax.Array
- tangent_vector_field#
The tangent vector field (tx, ty) used to compute the transverse permittivity matrix, if a vector FMM formulation is used. If the FFT formulation is used, the vector field is None.
- Type:
Tuple[jax.Array, jax.Array] | None
- property omega_script_k_matrix#
Compute omega-script-k matrix from equation 26 of [2012 Liu].
- fmmax.fmm.eigensolve_anisotropic_media(wavelength: Array, in_plane_wavevector: Array, primitive_lattice_vectors: LatticeVectors, permittivity_xx: Array, permittivity_xy: Array, permittivity_yx: Array, permittivity_yy: Array, permittivity_zz: Array, expansion: Expansion, formulation: Formulation | Callable[[Array, Expansion, LatticeVectors], Tuple[Array, Array]] = Formulation.JONES_DIRECT_FOURIER) LayerSolveResult [source]#
Performs the eigensolve for a layer with anisotropic permittivity.
This function performs either a uniform-layer or patterned-layer eigensolve, depending on the shape of the trailing dimensions of a given layer permittivity. When the final two dimensions have shape (1, 1), the layer is treated as uniform. Otherwise, it is patterned.
- Parameters:
wavelength – The free space wavelength of the excitation.
in_plane_wavevector – (kx0, ky0).
primitive_lattice_vectors – The primitive vectors for the real-space lattice.
permittivity_xx – The xx-component of the permittivity tensor, with shape (…, nx, ny).
permittivity_xy – The xy-component of the permittivity tensor.
permittivity_yx – The yx-component of the permittivity tensor.
permittivity_yy – The yy-component of the permittivity tensor.
permittivity_zz – The zz-component of the permittivity tensor.
expansion – The field expansion to be used.
formulation – Specifies the formulation to be used, or a callable which computes the tangent vector field for a custom vector FMM formulation.
- Returns:
The LayerSolveResult.
- fmmax.fmm.eigensolve_general_anisotropic_media(wavelength: Array, in_plane_wavevector: Array, primitive_lattice_vectors: LatticeVectors, permittivity_xx: Array, permittivity_xy: Array, permittivity_yx: Array, permittivity_yy: Array, permittivity_zz: Array, permeability_xx: Array, permeability_xy: Array, permeability_yx: Array, permeability_yy: Array, permeability_zz: Array, expansion: Expansion, formulation: Formulation | Callable[[Array, Expansion, LatticeVectors], Tuple[Array, Array]] = Formulation.JONES_DIRECT_FOURIER, vector_field_source: Array | None = None) LayerSolveResult [source]#
Performs the eigensolve for a general anistropic layer.
Here, “general” refers to the fact that the layer material can be magnetic, i.e. the permeability and permittivity can be specified.
This function performs either a uniform-layer or patterned-layer eigensolve, depending on the shape of the trailing dimensions of a given layer permittivity. When the final two dimensions have shape (1, 1), the layer is treated as uniform. Otherwise, it is patterned.
- Parameters:
wavelength – The free space wavelength of the excitation.
in_plane_wavevector – (kx0, ky0).
primitive_lattice_vectors – The primitive vectors for the real-space lattice.
permittivity_xx – The xx-component of the permittivity tensor, with shape (…, nx, ny).
permittivity_xy – The xy-component of the permittivity tensor.
permittivity_yx – The yx-component of the permittivity tensor.
permittivity_yy – The yy-component of the permittivity tensor.
permittivity_zz – The zz-component of the permittivity tensor.
permeability_xx – The xx-component of the permeability tensor.
permeability_xy – The xy-component of the permeability tensor.
permeability_yx – The yx-component of the permeability tensor.
permeability_yy – The yy-component of the permeability tensor.
permeability_zz – The zz-component of the permeability tensor.
expansion – The field expansion to be used.
formulation – Specifies the formulation to be used, or a callable which computes the tangent vector field for a custom vector FMM formulation.
vector_field_source – Optional array used to calculate the vector field for vector formulations of the FMM. If not specified, (permittivity_xx + permittivity_yy) / 2 is used. Ignored for the FFT formulation. Should have shape matching the permittivities and permeabilities.
- Returns:
The LayerSolveResult.
- fmmax.fmm.eigensolve_isotropic_media(wavelength: Array, in_plane_wavevector: Array, primitive_lattice_vectors: LatticeVectors, permittivity: Array, expansion: Expansion, formulation: Formulation | Callable[[Array, Expansion, LatticeVectors], Tuple[Array, Array]] = Formulation.JONES_DIRECT_FOURIER) LayerSolveResult [source]#
Performs the eigensolve for a layer with isotropic permittivity.
This function performs either a uniform-layer or patterned-layer eigensolve, depending on the shape of the trailing dimensions of a given layer permittivity. When the final two dimensions have shape (1, 1), the layer is treated as uniform. Otherwise, it is patterned.
- Parameters:
wavelength – The free space wavelength of the excitation.
in_plane_wavevector – (kx0, ky0).
primitive_lattice_vectors – The primitive vectors for the real-space lattice.
permittivity – The permittivity array.
expansion – The field expansion to be used.
formulation – Specifies the formulation to be used, or a callable which computes the tangent vector field for a custom vector FMM formulation. The default is Formulation.JONES_DIRECT_FOURIER.
- Returns:
The LayerSolveResult.