Source
Engine quan_loncar_v1 · package package/quan_loncar_optimizer · assembled 2026-07-29 15:57 UTC.
Architecture¶
Preserved physics layer¶
engine/ is the unchanged historical solver. The production adapter imports:
- geometry and exact constraint logic from phases 14, 26, and 45;
- the converged y3-z1 cross-section basis from phases 50 and 53;
- the P2-z1 hole basis from phases 51 and 54;
- outgoing pole-subtracted radiation and corrected complex poles from phases 33 and 34;
- corrected QNM normalization, geometry JVP, objective VJP, and coupling VJP from phases 39–44;
- the accepted Phase-55/57 autograd configuration.
The adapter in src/quan_optimizer/engine.py exposes two operations:
solve_pole: a fresh branch-tracked complex-pole solve at one geometry;evaluate_from_pole: the complete local observables and 45-coordinate custom VJP at that converged pole.
Optimization layer¶
optimizer.py is a restartable state machine.
verified seed
-> full pole + VJP
-> projected direction
-> trust-limited line search
-> fresh pole gate
-> full VJP gate
-> atomic checkpoint
-> matched FDTD checkpoint
-> accept or rollback
The complex-pole prediction from the resonance gradient is never accepted as a solution. It is only the initial guess for the next nonlinear solve.
Geometry¶
The vector is:
Mirror symmetry reconstructs 30 physical holes. Conversions between the portable FDTD JSON schema and the engine vector are covered by round-trip tests.
FDTD layer¶
fdtd/nanobeam_fdtd/ is the preserved confirmation package. It builds one
nominal simulation or a five-case convergence panel, submits only when
--submit is present, analyzes harmonic inversion, and compares two designs.
The optimizer and FDTD dependencies are intentionally separated so an analytical run does not require cloud credentials.
Audit tools¶
run_preflight.py: engine hashes, seed integrity, optional physical pole and gradient.run_basis_audit.py: production versus stricter continuum/basis settings.make_validation_panel.py: local FDTD directional falsification panel.render_report.py: regenerates the run's dependency-free HTML report.record_fdtd_checkpoint.py: the only supported mutation of FDTD incumbent state.
Backward compatibility¶
Backward compatibility means preserving the successful physical engine and geometry, not preserving unsafe campaign behavior. The new wrapper intentionally removes:
- accepting a linearized pole without a fresh nonlinear solve;
- carrying a stale derivative across accepted geometries;
- long blocks without FDTD;
- comparing a candidate against unmatched simulation settings;
- replacing the FDTD incumbent with a rejected result;
- treating the unverified Phase-58 Q=30,307 continuation as trusted.