fdtdx.unfold_source_mode#
- fdtdx.unfold_source_mode(source, config)[source]#
Reconstruct the full-domain
(E, H)mode profile a mode source injects.A
ModePlaneSourcesolves and stores its mode on the reduced cross-section (source._E/source._H, real, shape(3, Nx, Ny, Nz)with a singleton on the propagation axis). This mirrors that profile back to the full transverse cross-section with the correct per-component parity. Only the two transverse axes are unfolded — the propagation axis is never a symmetry plane for a mode source (its mode plane is one cell thick there).Convenience wrapper so callers don’t reach into the private
_E/_Hstate; for the fields recorded during the run, prefer a detector on the source plane plusunfold_detector_states().- Parameters:
source – A placed mode source whose
applyhas already run (so_E/_Hare populated), e.g. aModePlaneSource. Runfdtdx.apply_params()first.config (SimulationConfig) – Simulation config; must have nonzero
symmetryon at least one axis transverse to the source’s propagation axis.
- Returns:
Full-domain
(E, H)mode profiles, shape(3, Nx, Ny, Nz).- Return type:
tuple[jax.Array, jax.Array]
- Raises:
ValueError – If the mode has not been computed yet, the source is not a plane, or there is no transverse symmetry to unfold.