Source
engines/majumdar_lab/package/multilayer_autonomous_optimizer/quan_loncar_series_phase26/STATUS_PHASE26.md · assembled 2026-07-29 15:57 UTC.
Phase 26 status: all-hole geometry adjoint¶
Result¶
The N=15 dielectric-centered Ey pole now has analytic reverse-mode gradients with respect to all 45 mirror-symmetric hole variables:
- one central gap and fourteen successive positive-side spacings;
- fifteen independent positive-side radius_x values;
- fifteen independent positive-side radius_y values.
The negative-side holes are generated by exact x reflection, so every design
tangent remains in the (x,y,z)=(+1,-1,+1) sector. The direct physical
coordinates are measured in nm; constrained or logarithmic optimizer
coordinates can be added as a smooth outer map.
Derivative path¶
The implementation differentiates each unit-disk hole projection analytically with respect to center_x, radius_x, and radius_y. These derivatives are composed through the outgoing beta contour to produce:
- a geometry-to-Maxwell-operator JVP;
- an adjoint operator VJP for every geometry variable in one contour pass;
-
the implicit simple-pole pullback
d omega/dp = -(y^H A_p x)/(y^H A_omega x);
-
the Q chain rule.
Newton iterations and eigensolver histories are excluded from the derivative. The expensive reverse pass scales approximately with one contour assembly, not with the number of geometry variables.
Validation¶
Local tests verify:
- exact geometry-vector round trip;
- gap-map JVP/VJP duality;
- center_x/radius_x/radius_y projection partials against finite differences;
- full operator JVP against a centered geometry difference;
- adjoint contraction against the forward operator JVP.
The full operator JVP relative error is 3.17e-8 and its reciprocity error is 4.89e-16.
For the N=15 cavity, a dense deterministic direction changed every one of the 45 parameters by up to 0.05 nm. Compared with independently re-solved plus and minus cavities:
- complex pole-gradient relative error: 4.174e-5;
- Q-gradient relative error: 3.583e-5;
- perturbed branch overlaps: above 0.99999985.
Gradient convergence¶
From K=12,A=48 to K=14,A=56:
- complex pole-gradient L2 change: 0.0479%;
- imaginary pole-gradient L2 change: 0.612%;
- Q-gradient L2 change: 4.055%;
- Q-gradient direction cosine: 0.9999819.
The full geometry gradient is therefore ready for initial constrained optimization experiments at the present P1/z0 basis. Quantitative final design claims still require P2/z1 basis convergence.
Autograd status¶
The costly custom VJP is implemented. A thin JAX, PyTorch, or other framework
adapter is still needed for native grad() syntax. The backend-neutral
implicit_full_geometry_gradient already returns value and gradient data for
an optimizer without per-parameter finite differences.
Smooth width modulation¶
Elliptical radius_x/radius_y is already supported. Smooth longitudinal beam width is a separate geometry primitive because the current reference Green operator assumes a constant rectangular waveguide. Add it as symmetric sidewall perturbation elements on a fixed reference domain, parameterized by a smooth basis such as B-splines. Their projection JVP/VJP then enters the same operator and implicit-pole pullback; the resonance solver and adjoint formula do not need to be redesigned.