Unit cell and basis#
- fmmax.X = Array([1., 0.], dtype=float32)#
Unit vector pointing in the x direction.
- fmmax.Y = Array([0., 1.], dtype=float32)#
Unit vector pointing in the y direction.
- class fmmax.Expansion(basis_coefficients: ndarray[Any, Any])[source]#
Stores the expansion.
The expansion consists of the integer coefficients of the reciprocal lattice vectors used in the Fourier expansion of fields, permittivities, etc. in the FMM scheme.
- basis_coefficients#
The integer coefficients of the primitive reciprocal lattice vectors, which generate the full set of reciprocal-space vectors in the expansion.
- Type:
numpy.ndarray[Any, Any]
- num_terms#
The number of terms in the expansion.
- class fmmax.LatticeVectors(u: Array, v: Array)[source]#
Stores a pair of lattice vectors.
Note that this is just a pair of 2-dimensional vectors, which may be either for the real-space lattice or the reciprocal space lattice, depending on usage.
- u#
The first primitive lattice vector.
- Type:
jax.Array
- v#
The second primitive lattice vector, with identical shape.
- Type:
jax.Array
- class fmmax.Truncation(value)[source]#
Enumerates truncation modes.
- CIRCULAR = 'circular'#
Fourier orders are truncated based on the total magnitude of their associated wavevectors.
- PARALLELOGRAMIC = 'parallelogramic'#
Fourier orders are truncated based on the magnitude of their component along
u
andv
directions, without regard for their total magnitude.
- fmmax.brillouin_zone_in_plane_wavevector(brillouin_grid_shape: Tuple[int, int], primitive_lattice_vectors: LatticeVectors) Array [source]#
Computes in-plane wavevectors on a regular grid in the first Brillouin zone.
The wavevectors are found by dividing the Brillouin zone into a grid with the specified shape; the wavevectors are at the centers of the grid voxels.
- Parameters:
brillouin_grid_shape – The shape of the wavevector grid.
primitive_lattice_vectors – The primitive vectors for the real-space lattice.
- Returns:
The in-plane wavevectors, with shape
brillouin_grid_shape + (2,)
.
- fmmax.generate_expansion(primitive_lattice_vectors: LatticeVectors, approximate_num_terms: int, truncation: Truncation = Truncation.CIRCULAR) Expansion [source]#
Generates the expansion for the specified real-space basis.
- Parameters:
primitive_lattice_vectors – The primitive vectors for the real-space lattice.
approximate_num_terms – The approximate number of terms in the expansion. To maintain a symmetric expansion, the total number of terms may differ from this value.
truncation – The truncation to be used for the expansion. The default is
Truncation.CIRCULAR
.
- Returns:
The
Expansion
. The basis coefficients of the expansion are sorted so that the zeroth-order term is first.
- fmmax.min_array_shape_for_expansion(expansion: Expansion) Tuple[int, int] [source]#
Returns the minimum allowed shape compatible with expansion.
- fmmax.plane_wave_in_plane_wavevector(wavelength: Array, polar_angle: Array, azimuthal_angle: Array, permittivity: Array) Array [source]#
Computes the in-plane wavevector for a plane-wave excitation.
- Parameters:
wavelength – The free-space wavelength of the plane-wave excitation.
polar_angle – Polar angle of the plane-wave excitation.
azimuthal_angle – Azimuthal angle of plane-wave the excitation.
permittivity – Scalar permittivity of the medium in which the polar angle and azimuthal angle are specified.
- Returns:
The fundamental transverse wavevector, i.e.
(kx0, ky0)
.
- fmmax.transverse_wavevectors(in_plane_wavevector: Array, primitive_lattice_vectors: LatticeVectors, expansion: Expansion) Array [source]#
Obtains all the relevant transverse wavevectors given the expansion.
- Parameters:
in_plane_wavevector – The zeroth-order transverse wavevector.
primitive_lattice_vectors – The primitive vectors for the real-space lattice.
expansion – The expansion for which the set of transverse wavevectors are sought.
- Returns:
The transverse wavevectors.
- fmmax.unit_cell_coordinates(primitive_lattice_vectors: LatticeVectors, shape: Tuple[int, int], num_unit_cells: Tuple[int, int] = (1, 1)) Tuple[Array, Array] [source]#
Compute spatial coordinates given the grid shape and number of unit cells.
- Parameters:
primitive_lattice_vectors – The lattice vectors defining te unit cell.
shape – The shape of the coordinates grid.
num_unit_cells – Determines the number of unit cells for which to compute the coordinates. Default is
(1, 1)
, corresponding to a single unit cell.
- Returns:
The unit cell coordinates, with shape
(shape[0] * num_unit_cells[0], shape[1] * num_unit_cells[1])
.