Periodic dielectric gratings and metasurfaces can trap light in Bound States in the Continuum (BICs)—modes with an infinite radiative quality factor (Q → ∞) that remain completely decoupled from far-field radiation as long as unit-cell symmetry holds.
Introduce a small geometric asymmetry α, and the dark BIC turns into a sharp quasi-BIC Fano resonance whose radiative quality factor scales as Q ∝ α⁻² (Koshelev et al., PRL 2018).
In this walkthrough, we'll simulate this transition in pure Python using EMpy (ElectroMagnetic Python) (pip install ElectroMagneticPython).
▶ Run this notebook interactively in Google Colab
Symmetric vs. Asymmetric Si₃N₄ Dimer Grating in 25 Lines
Using EMpy.RCWA.IsotropicRCWA (with Lalanne–Morris TM Fourier factorization and Moharam Enhanced Transmittance Matrix stabilization), we compare a period-halved SymmetricDoubleGrating (α = 0, dark BIC) against width-perturbed AsymmetricDoubleGrating dimers (α = (dc₁ - dc₂) / (dc₁ + dc₂)):
import numpy as np
import EMpy
pitch = 0.88e-6
h_grating = 0.18e-6
h_wg = 0.26e-6
f0 = 0.22
dc_spacer = 0.5 * (1.0 - 2.0 * f0)
air = EMpy.materials.Air
sio2 = EMpy.materials.IsotropicMaterial("SiO2", n0=EMpy.materials.RefractiveIndex(n0_const=1.45))
sin = EMpy.materials.IsotropicMaterial("Si3N4", n0=EMpy.materials.RefractiveIndex(n0_const=2.05))
wls = np.linspace(1.495e-6, 1.555e-6, 201)
# 1. Symmetric dimer (dark BIC)
ml_sym = EMpy.utils.Multilayer([
EMpy.utils.Layer(air, np.inf),
EMpy.utils.SymmetricDoubleGrating(sin, sin, air, f0, f0, pitch, h_grating),
EMpy.utils.Layer(sin, h_wg),
EMpy.utils.Layer(sio2, np.inf),
])
sol_sym = EMpy.RCWA.IsotropicRCWA(ml_sym, 0.0, 0.0, np.pi / 2.0, np.pi / 2.0, n=4).solve(wls)
# 2. Asymmetric dimer (quasi-BIC Fano resonance, alpha = 0.20)
alpha = 0.20
ml_asym = EMpy.utils.Multilayer([
EMpy.utils.Layer(air, np.inf),
EMpy.utils.AsymmetricDoubleGrating(
sin, sin, air, f0 * (1 + alpha), f0 * (1 - alpha), dc_spacer, pitch, h_grating
),
EMpy.utils.Layer(sin, h_wg),
EMpy.utils.Layer(sio2, np.inf),
])
sol_asym = EMpy.RCWA.IsotropicRCWA(ml_asym, 0.0, 0.0, np.pi / 2.0, np.pi / 2.0, n=4).solve(wls)
Sweeping α reveals the sharp Fano dip emerging in 0th-order transmittance (DE3) and confirms the Q ∝ α⁻² scaling law:
EMpy.RCWA also includes AnisotropicRCWA for 3D Euler-rotated birefringent gratings and conical diffraction across Wood–Rayleigh passing-off anomalies.
Try It Yourself
- Run interactively (no install): Open in Google Colab
- Full RCWA Guide (with 3D anisotropic & conical examples): lbolla.github.io/EMpy/rcwa-gratings/
- Source & Other Solvers (Ring Resonators, Transfer Matrix, Mode Solvers, Liquid Crystals): github.com/lbolla/EMpy

Top comments (0)