Skip to content

Source

engines/quan_loncar_meep_lab/notes/mode_volume_gradient.md · assembled 2026-09-05 15:26 UTC.


dV/dh: the algebra is exact, the wall integral is not

dQ/dh needs only the eigenvalue, which a complex-symmetric problem hands over with no adjoint at all. dV/dh needs the eigenvector's sensitivity, which is a different object and the reason V was reported rather than optimized until now.

The derivation

With A v = lam B v, lam = omega^2, and the curl-curl form blind to the permittivity so that only B moves under a shape change:

(A - lam B) dv - (B v) dlam = lam (dB) v
        (B v)^T dv          = -(1/2) v^T (dB) v

the second row being the derivative of v^T B v held fixed. Bordering is what makes this solvable at all — A - lam B is singular precisely because lam is an eigenvalue, and the extra row and column replace the null direction with the normalization constraint.

V = 4 (v^T B v) / (eps(r0) E(r0).E(r0)) is invariant under scaling of the eigenvector, so the arbitrary normalization of an eigensolve drops out. Holding v^T B v fixed makes the numerator stationary, leaving dV/V = -dD/D. One adjoint solve then gives dD for every design direction at once:

dD = w^T (lam (dB) v) - (1/2) nu (v^T (dB) v)

and both pieces are boundary integrals of the Johnson kernel — the second the quadratic form the pole derivative already uses, the first the same kernel as a bilinear form in the mode and the adjoint field.

What is verified

On a toy cavity where dB is an exact matrix rather than a boundary integral, so the algebra is tested with no wall integration in the way:

check result
g_v^T v against 2D 1.0000000000
adjoint form against primal bordered solve 1.0000000000
full chain against a re-solved eigenproblem 0.9999988

All three are now in the suite and run in five seconds. The eigenvector sensitivity, the normalization handling and dV = -V dD / D are correct.

What is not

Against the phi -+ delta finite difference, the ratio is stable to three digits across a factor of four in step size — systematic, and quite unlike the pole gradient's 0.59, 0.57, 0.41 when that was being evaluated on the wrong wall. Two methodological errors were found and fixed, and the rest is real:

state of the comparison ratio
as first written 0.609
perturbed designs settled, nominal not 0.658
both anchored on one settled geometry 0.716
the same, at p = 3 0.723

The anchoring mattered because settling only the perturbed designs measures the derivative at the settled wall while predicting it at the raw one, and on a wiggly field those are different devices — one filtering pass moves emitted power thirty-five percent on this article.

Seven things it is not

Each ruled out by measurement rather than by argument:

suspect test result
the point functional g_v g_v^T v against 2D exact to 1e-10
the adjoint algebra toy problem, exact dB 0.9999988
the emitter site (origin vs offset) D at both agree to 9 digits
the bordered solve's accuracy relative residual 1.3e-12
the normalization constraint v^T B w 8.6e-13
interface sampling offset 4, 2, 1, 0.5, 0.25 nm ±10 %, non-monotone
discretization p = 2 against p = 3 0.716 against 0.723

The last is the one that kills the leading hypothesis. The adjoint field is driven by point sources, and a point source in three dimensions is not in the energy space, so it was reasonable to expect slow convergence around it. Refining from 89k to 227k degrees of freedom moves the ratio by under one percent, with V, the prediction and the measurement each converged to about a percent. The 0.72 is converged, not an artefact.

What remains is localized: the cross term carries 95.4 % of dD, so the gap lives in the boundary kernel's bilinear form w^T (dB) v and not in the quadratic one, which reads 0.91 from the identical code path. Structurally the bilinear kernel is the unique symmetric form reducing to the validated quadratic one at w = v, which is why this is unsatisfying rather than obvious.

This is a known class for this engine rather than a new defect. The wall-mode basis gave 1.63 against an ALE reference while smooth-boundary directions gave 0.954, and the recorded conclusion then was that direction is reliable and magnitude in a given basis less so.

How to use it

Usable as a descent direction under measured acceptance, on the same reasoning the Q loop already runs on: a trust region accepting on a measured improvement needs the direction, not the magnitude. Not usable as a predicted value of dV, and not yet wired into an objective, because a 0.72 that is understood only to the extent above should not be presented as a working derivative.

Next thing to try, given the elimination above: build the same cross term by an independent route — an ALE mesh deformation, which needs no boundary kernel at all — and compare. That separates the kernel from everything else in one measurement, the way ALE already settled the Im(omega) question when the finite-difference reference was itself in doubt.