[fdfd.waveguide*] comment updates

This commit is contained in:
jan 2025-12-10 19:45:26 -08:00
parent b486fa325b
commit d4f1008c5c
2 changed files with 3 additions and 1 deletions

View File

@ -413,7 +413,6 @@ def _normalized_fields(
shape = [s.size for s in dxes[0]]
# Find time-averaged Sz and normalize to it
# H phase is adjusted by a half-cell forward shift for Yee cell, and 1-cell reverse shift for Poynting
Sz_tavg = inner_product(e, h, dxes=dxes, prop_phase=prop_phase, conj_h=True).real
assert Sz_tavg > 0, f'Found a mode propagating in the wrong direction! {Sz_tavg=}'

View File

@ -45,6 +45,7 @@ def solve_mode(
'E': NDArray[complexfloating],
'H': NDArray[complexfloating],
'wavenumber': complex,
'wavenumber_2d': complex,
}
```
"""
@ -196,6 +197,8 @@ def compute_overlap_e(
Etgt = numpy.zeros_like(Ee)
Etgt[slices2] = Ee[slices2]
# note no sqrt() when normalizing below since we want to get 1.0 after overlapping with the
# original field, not the normalized one
Etgt /= (Etgt.conj() * Etgt).sum() # type: ignore
return cfdfield_t(Etgt)