solve_modes(...) is the main entry point. It validates the Materials grid,
resolves frequencies or wavelengths, builds the Yee derivative matrices, chooses
the sparse formulation, solves one frequency at a time, and returns a
coordinate-aware Result.
Materials.from_diagonal(...)builds scalar or diagonal-anisotropic grids. These usually use the faster diagonal sparse formulation.Materials.from_components(...)accepts full (3\times3) material tensors. Any off-diagonal component routes the solve through the tensorial sparse formulation.Materials.from_slice(...)creates a 1D mode-plane slice with an invariant width so integrations and overlaps still have physical weights.Materials.from_subpixel_diagonal(...)downsamples a high-resolution diagonal raster with arithmetic, harmonic, geometric, min, or max averaging.
num_modes: number of modes returned near the requested target.target_neff: center of the shift-invert search. If omitted, MicroMode uses a heuristic based on the largest absolute permittivity component.pml: absorbing boundary thickness and stretch profile viaPmlSpec.boundary: low-edge PEC/PMC symmetry settings viaBoundarySpec.direction:"+"or"-"propagation; the backward solve flips the appropriate magnetic and longitudinal electric signs.components: optional subset of returned field components.krylov_dim: dimension of the Arnoldi search space.angle_theta,angle_phi,bend_radius,bend_axis: transformation-optics controls that update (\epsilon) and (\mu) before the sparse solve.
The SciPy solver selects eigenpairs with sparse shift-invert SciPy/ARPACK [1, 2]. For a matrix (A) and shift (\sigma), Arnoldi is applied to
where (\theta) is a Ritz value of the inverse-shifted operator. The diagonal formulation uses (\sigma=-\texttt{target_neff}^2); the tensorial formulation uses (\sigma=\texttt{target_neff}).
Returned modes are sorted by decreasing real effective index, normalized to unit transverse power,
and orthogonalized with the unconjugated Lorentz product
Result exposes the post-processing methods users normally need: n_eff,
k_eff, mode_area, pol_fraction, pol_fraction_waveguide, modes_info,
to_dataframe(), overlap(), overlap_matrix(), plot_field(),
plot_field_components(), to_hdf5(), and Result.from_hdf5().
[1] W. E. Arnoldi, "The principle of minimized iterations in the solution of the matrix eigenvalue problem," Quarterly of Applied Mathematics, vol. 9, no. 1, pp. 17-29, 1951. AMS record.
[2] R. B. Lehoucq, D. C. Sorensen, and C. Yang, ARPACK Users' Guide: Solution of Large-Scale Eigenvalue Problems with Implicitly Restarted Arnoldi Methods, SIAM, 1998. doi:10.1137/1.9780898719628.