(pml_lo,pml_hi) denoting the number of PML cells to use
at the bottom and top of the simulation domain. See fdtdz.fdtdz()
docstring for additional details.
Uses the subspace iteration method to obtain modes without leaving JAX.
Allows for updating mode solutions via the init parameter (e.g. for
small changes in epsilon and/or omega).
Parameters:
epsilon β (3,xx,yy,zz) array of permittivity values with exactly one
xx, yy, or zz equal to 1.
omega β Real-valued scalar angular frequency.
num_modes β Integer denoting number of modes to solve for.
init β (2,xx,yy,zz,num_modes) of values to use as initial guess.
shift_iters β Number of iterations used to determine the largest eigenvalue
of the waveguide operator.
max_iters β Maximum number of eigenvalue solver iterations to execute.
tol β Error threshold for eigenvalue solver.
Returns:
(wavevector,excitation,err,iters) where
iters is the number of executed solver iterations, and
excitation.shape==(2,xx,yy,zz,num_modes) and
wavevector.shape==err.shape==(num_modes,), with
excitation[...,i], wavevector[i], and err[i] being ordered
such that i==0 corresponds to the fundamental mode.
Render a three-dimensional vector array of permittivity values.
Produces a 3D vector array of permittivity values on the Yee cell based on a
layered stack of 2D profiles at magnification 2*m. Along the z-axis, both
the layer boundaries and grid positions are allowed to vary continuously,
while along the x- and y-axes the size of each (unmagnified) cell is assumed
to be 1.
Attempts to follow [1] but only computes the on-diagonal elements
of the projection matrix and is adapted to a situation where there are no
explicit interfaces because the pixel values are allowed to vary continuously
within each layer.
Instead, the diagonal elements of the projection matrix for a given subvolume
are estimated by computing gradients across it where df(u)/du is computed as
the integral of f(u)*u over the integral of u**2 where u is relative
to the center of the cell.
Parameters:
layers β (ll,2*m*xx,2*m*yy) array of magnified layer profiles.
interface_positions β (ll-1) array of interface positions between the
ll layer. Assumed to be in monotonically increasing order.
magnification β Denotes a 2*m in-plane magnification factor of layer profiles.
zz β Number of cells along z-axis.
Returns:
(3,xx,yy,zz) array of permittivity values with offsets and vector
components according to the finite-difference Yee cell.
Computes a per-pixel density from raw optimization variable u.
Implements the βthree-fieldβ scheme detailed in [2] in order
to allow for a final density that is binary (with the exception of boundary
values) and that conforms to a minimum feature size requirement.
Parameters:
u β (xx, yy)` variable array with values within [0,1].
radius β Radius of the conical filter used to blur u.
alpha β Float within [0,1] controlling binarization of the density,
where 0 denotes no binarization, and 1 denotes full binarization
of all pixels except those on boundaries (as given by eta) which are
left unchanged (equal to the alpha=0 case).
c β Controls the detection of inflection points.
eta β Threshold value used to binarize the density.
eta_lo β Controls minimum feature size of void-phase features.
eta_hi β Controls minimum feature size of density=1 features.
Returns:
(density,loss) arrays, both of shape (xx,yy), corresponding to
the pixel density and the minimum feature size loss respectively.