Welcome to EMUstack’s documentation!
Introduction
Installation
Guide
- Tutorials and Examples Guide
- Simulation Workflow
- Available Tutorial Notebooks
- Native Netgen CSG Tutorials (In-Memory Meshing)
- From a BIC to a quasi-BIC: Bar-Dimer Metasurface (Gorkunov et al., Fig. 3a)
- Libraries
- EMUstack: Au Nanodisk array with interpolators
- Libraries
- EMUstack: tilted elliptical au nanohole array using the ‘custom’ target interface
- 1. Single Non-Dispersive Interface: Analytical Fresnel Equations & EMUstack S-Matrix
- 2. Single Dispersive Interface: Wavelength-Dependent Optical Constants
- 3. Multilayered Dispersive Thin-Film Stack: Fabry–Pérot Interference
- 4. Finite Metallic Back-Reflector & Lossless Substrate Invariant
- 5. 1D Lamellar Diffraction Grating: Bloch Modes and Polarization
- 6. 1D Grating with Two Interleaved Inclusions: Unit-Cell Symmetry Breaking
- 7. 1D Grating with Three Inclusions: Compound Grating Resonances
- 8. 2D Silicon Nanowire Array for Photovoltaics: Efficiency and Dispersion
- 9. Combining a 1D Grating and a 2D Array in One Stack
- 10. Elliptical Nanohole Array: In-Plane Anisotropy and Circular Dichroism
- 11. 1D Grating Mode Profiles and Vertical Field Cross-Sections
- 12. 2D Nanostructure Near-Field Visualization (In-Plane and Cross-Sections)
- 13. Modal Expansion Analysis: Bloch Mode & Plane-Wave Coupling Amplitudes
- 14. Reciprocal-Space Momentum Spectrum: \(k_\parallel\) Excitation Distribution
- 15. Shifting Periodic Layers Sideways: Shear Transformations
- 16. Fundamental 50% Absorption Limit in Coherent Ultrathin Films
- 17. S-Matrix Layer Mode Reuse Across Diverse Substrates & Thickness Averaging
- 18. Modal Convergence in Stacked Lamellar Gratings (Handmer et al., 2010)
- 19. Extraordinary Optical Transmission (EOT) in Subwavelength Metallic Hole Arrays
- 20. Metamaterial Slab Waveguide Dispersion via S-Matrix Poles
- Classic Gmsh & Pre-Generated Mesh Tutorials
- Libraries
- EMUstack: Au Nanodisk array with interpolators
- Libraries
- EMUstack: tilted elliptical au nanohole array using the ‘custom’ target interface
- 1. Single Non-Dispersive Interface: Analytical Fresnel Equations & EMUstack S-Matrix
- 2. Single Dispersive Interface: Wavelength-Dependent Optical Constants
- 3. Multilayered Dispersive Thin-Film Stack: Fabry–Pérot Interference
- 4. Finite Metallic Back-Reflector & Lossless Substrate Invariant
- 5. 1D Lamellar Diffraction Grating: Bloch Modes and Polarization
- 6. 1D Grating with Two Interleaved Inclusions: Unit-Cell Symmetry Breaking
- 7. 1D Grating with Three Inclusions: Compound Grating Resonances
- 8. 2D Silicon Nanowire Array for Photovoltaics: Efficiency and Dispersion
- 9. Combining a 1D Grating and a 2D Array in One Stack
- 10. Elliptical Nanohole Array: In-Plane Anisotropy and Circular Dichroism
- 11. 1D Grating Mode Profiles and Vertical Field Cross-Sections
- 12. 2D Nanostructure Near-Field Visualization (In-Plane and Cross-Sections)
- 13. Modal Expansion Analysis: Bloch Mode & Plane-Wave Coupling Amplitudes
- 14. Reciprocal-Space Momentum Spectrum: \(k_\parallel\) Excitation Distribution
- 15. Shifting Periodic Layers Sideways: Shear Transformations
- 16. Fundamental 50% Absorption Limit in Coherent Ultrathin Films
- 17. S-Matrix Layer Mode Reuse Across Diverse Substrates & Thickness Averaging
- 18. Modal Convergence in Stacked Lamellar Gratings (Handmer et al., 2010)
- 19. Extraordinary Optical Transmission (EOT) in Subwavelength Metallic Hole Arrays
- 20. Metamaterial Slab Waveguide Dispersion via S-Matrix Poles
Python Backend
- objects module
- materials module
- mode_calcs module
- stack module
- plotting module
BM_amplitudes()Bloch_fields_1d()EOT_plot()E_conc_plot()Fabry_Perot_res()FieldBundleGridInterpolatorWrapperJ_sc_eta_NO_plots()J_short_circuit()PW_amplitudes()clear_previous()evanescent_merit()extinction_plot()field_values()fields_3d()fields_in_plane()fields_interpolator_cross_section()fields_interpolator_in_plane()fields_vertically()gen_params_string()layers_plot()layers_print()max_n()omega_plot()spectra_to_xarray()t_func_k_plot_1D()t_r_a_plots()t_r_a_plots_subs()t_r_a_write_files()tick_function()total_tra_plot()total_tra_plot_subs()ult_efficiency()vis_matrix()vis_scat_mats()zeros_int_str()
Finite Element Mode Solvers & Meshing
EMUstack calculates the electromagnetic Bloch modes of periodically structured layers using modern finite element methods: pure Python/SciPy for 1D gratings and NGSolve/Netgen for 2D nanostructures.
- 1D Finite Element Mode Solver
- 2D Finite Element Mode Solver
- 2D Geometry & Meshing Guide (Gmsh & Netgen)
- Using the Shipped Templates
- Where the Meshes Are Written
- Part I: General Presentation & the 6 Core Concepts
- Concept 1: Parameter Injection (
geo_file&geo_params) - Naming: One Vocabulary for
.geo,.pyandunit_cell - Concept 2: Coordinate Normalization to a Dimensionless Unit Cell
- Concept 3: Outer Unit-Cell Boundaries & Periodic Node Identification
- Concept 4: Interior Inclusions & High-Order Curved Boundaries
- Concept 5: Subdomain Material Tagging (
bg,inc2,inc3, …) - Concept 6: Mesh Refinement Controls (
lc, lc2, ..., lc_nvs. Netgenmaxh) & Verification
- Concept 1: Parameter Injection (
- Part II: Step-by-Step Practical Examples
- Example A: Step-by-Step Gmsh Template (
ellipse_msh_template.geo)- Step 1 (Concept 1 — Parameter Placeholders)
- Step 2 (Concept 2 — Coordinate Normalization)
- Step 3 (Concept 3 — Outer Unit-Cell Box & Physical Boundary Lines)
- Step 4 (Concept 4 — Rotated Elliptical Inclusion)
- Step 5 (Concept 5 — Domain Surfaces & Material Tags)
- Step 6 (Concept 6 — Interior Mesh Control & Calling from
NanoStruct)
- Example B1: Netgen Route B1 — Standard Inclusions via
meshing.unit_cell()(ellipse_msh_template.py&chiral_qbic_gorkunov_msh_template.py)- Step 1 (Concept 1 — Python Function Signature & Parameter Validation)
- Step 2 (Concept 2 — Coordinate Normalization to \([0, 1] \times [0, d_y]\))
- Steps 3, 4, 5, & 6 (Concepts 3–6 — Automated by
meshing.unit_cell()) - What
meshing.unit_cell()Supports vs. When to Take Route B2 - Calling
ellipse_msh_template.pyandchiral_qbic_gorkunov_msh_template.pyfromNanoStruct
- Example B2: Netgen Route B2 — Fancier Custom Shapes via Direct
SplineGeometry- Step 1 (Concept 1 — Python Function Signature)
- Step 2 (Concept 2 — Coordinate Normalization to \([0, 1] \times [0, d_y]\))
- Step 3 (Concept 3 — Outer Unit-Cell Box & Periodic
copy=Boundaries) - Step 4 (Concept 4 — Drawing the Custom Inclusion with
"line"and"spline3") - Step 5 (Concept 5 — Oriented Domain Tagging
leftdomain/rightdomain& Materials) - Step 6 (Concept 6 — Mesh Generation, Curving
ngm.Curve(2), & Calling fromNanoStruct)
- Example A: Step-by-Step Gmsh Template (
meshingModule API Referencearc_control_points()arc_segments()bloch_spaces()conv_gmsh()copy_template()fill_geo_template()geo_placeholders()gmsh_available()import_gmsh_mesh()inclusion_name()is_shipped_template()legacy_params()list_templates()mail_to_msh22()mesh_folder()mesh_from_geo()mesh_from_py()param_equivalents()parse_mail_data()read_mail_file()resolve_mesh_file_path()unit_cell()user_cache_dir()
- field_eval module