Skip to content

QNM and arbitrary-boundary shape derivatives

This page gives the mathematical contract for the free-form Q optimizer. It is solver-independent: the QNM may come from the analytical scattering engine, finite elements, or an FDTD pole fit, provided the forward and adjoint objects represent the same outgoing resonance.

1. Open-cavity eigenproblem

Use the time convention \(e^{-i\omega t}\). A passive outgoing quasinormal mode (QNM) has

\[ \widetilde\omega = \omega_r + i\omega_i, \qquad \omega_i < 0, \]

and

\[ Q=-\frac{\omega_r}{2\omega_i}. \]

After spatial discretization, material dispersion, radiation conditions, and PML coordinate stretching may all depend on frequency. The most general useful statement is therefore a nonlinear eigenproblem

\[ \mathcal A(\widetilde\omega,p)\,u_R=0, \qquad u_L^{T}\mathcal A(\widetilde\omega,p)=0, \]

where \(p\) describes the material boundaries. The transpose denotes the reciprocal QNM bilinear pairing; it is not automatically a Hermitian conjugate. The exact pairing must match the solver's discretized operator.

2. Complex-frequency derivative

Differentiate the nonlinear eigenproblem with respect to a scalar shape coordinate \(p\), multiply by the left mode, and eliminate the unknown field derivative. For an isolated simple pole,

\[ \boxed{ \frac{d\widetilde\omega}{dp} =- \frac{u_L^T(\partial_p\mathcal A)u_R} {u_L^T(\partial_\omega\mathcal A)u_R} } \]

The denominator is the QNM normalization. It includes frequency derivatives of dispersive materials and PML terms when those are present. Arbitrarily scaling either mode cancels between numerator and denominator.

This equation is the safest implementation interface. A closed-cavity energy normalization substituted into an outgoing, dispersive, or PML-truncated problem generally gives the wrong imaginary-frequency derivative even when the real-frequency shift looks plausible.

3. Hadamard boundary form

Let an interface \(\Gamma\) separate isotropic materials 1 and 2. Choose the unit normal \(n\) from material 1 to material 2 and let a positive scalar velocity \(h\) move the interface along \(n\). For a nondispersive dielectric interface, the volume perturbation can be reduced to a boundary integral. In a common convention its electric part is

\[ u_L^T(\partial_p\mathcal A)u_R \;\propto\; \int_\Gamma h\left[ (\epsilon_1-\epsilon_2) \mathbf E_{L,\parallel}\!\cdot\!\mathbf E_{R,\parallel} - (\epsilon_1^{-1}-\epsilon_2^{-1}) D_{L,\perp}D_{R,\perp} \right]dA. \]

Tangential \(E\) and normal \(D\) appear because those components are continuous at a sharp dielectric boundary. Magnetic-contrast terms have the dual form with \(H\) and \(B\). The proportionality factor and overall sign are fixed by the exact definition of \(\mathcal A\), the normal orientation, and whether \(p\) is displacement or signed-distance value.

An implementation must pin the convention with tests rather than prose:

  1. Translate one planar interface by a known signed amount.
  2. Compare the predicted complex-frequency shift with a centered difference on identical connectivity.
  3. Reverse the normal and verify that the gradient sign reverses.
  4. Repeat on each material pair used by the device.

For a free-form step, the bracketed field expression is a scalar shape-gradient density \(g_\omega(s)\). Any admissible normal velocity \(h(s)\) gives

\[ \delta\widetilde\omega = \int_\Gamma g_\omega(s)h(s)\,dA. \]

This is why holes and waveguide sidewalls can be optimized together: both are pieces of the movable material boundary.

4. From complex frequency to Q

Writing \(\widetilde\omega=a+ib\),

\[ \delta Q=-\frac{\delta a}{2b}+\frac{a\,\delta b}{2b^2}, \qquad \boxed{\delta\log Q=\frac{\delta a}{a}-\frac{\delta b}{b}}. \]

The logarithmic objective is preferable numerically and makes multiplicative Q changes additive. It also exposes the central difficulty: \(|b|/a=1/(2Q)\). At \(Q=10^4\), the loss rate is only \(5\times10^{-5}\) of the resonant frequency. A discretization error that is harmless for wavelength can dominate \(\delta b\) and reverse the Q gradient.

There is no contradiction when a tiny shape step moves \(a\) by many original linewidths. The derivative is local in geometry, not restricted to one old linewidth. What must remain continuous is the mode, not a fixed frequency window centered on the previous pole.

5. Mode continuation

Frequency-nearest tracking alone fails when modes approach, when the resonance moves quickly, or when the solver returns a different pole first. The tracking order used by the optimizer should be:

  1. biorthogonal field overlap with the accepted QNM on a common representation;
  2. localization in the intended cavity region;
  3. symmetry and polarization sector;
  4. agreement with the first-order complex-pole prediction;
  5. frequency proximity only as a final tie-breaker.

If no candidate clears the overlap and localization gates, the step is unresolved and must not update a quasi-Newton history. A mode switch can make a positive directional derivative appear to produce a negative objective change even when the derivative itself is correct.

6. Boundary representation and metric

The raw shape gradient is generally too rough for direct geometric advection. The optimizer maps it through a boundary metric, for example

\[ (I-\ell^2\partial_s^2)h = g_Q, \]

where \(s\) is arclength and \(\ell\) is a fabrication-aware smoothing length. This is a Sobolev gradient, not an extra objective term. Separate hole and sidewall blocks may use different \(\ell\) values, but their RMS normalization must be explicit so one block does not dominate only because it has more sample points.

The normal velocity is then applied to a contour, level set, or mesh. The geometry handed to the next solver must be the geometry actually produced by that motion. Smoothing, signed-distance reinitialization, polygon repair, and remeshing can all introduce a non-vanishing displacement as the requested step tends to zero. A valid line search therefore requires

\[ \operatorname{dist}(\Gamma(\alpha),\Gamma(0))\rightarrow0 \quad\text{as}\quad\alpha\rightarrow0. \]

The Device23 pre-fix trajectory violated this condition and is retained as a counterexample.

7. A trustworthy Q optimization loop

For one accepted geometry:

  1. solve and certify the QNM;
  2. compute the complex boundary gradient from matched left/right fields;
  3. regularize it in the declared boundary metric;
  4. predict \(\delta\widetilde\omega\) and \(\delta\log Q\) using the applied boundary motion;
  5. solve candidate poles on common connectivity for the local line search;
  6. reject unresolved mode tracking, invalid geometry, poor mesh transfer, or a nonpositive measured surrogate gain;
  7. update L-BFGS only after a clean accepted secant;
  8. periodically rebuild the geometry independently and evaluate it with FDTD or another physical solver.

Common connectivity makes the local derivative measurable; independent reconstruction tests whether the representation and discretization transfer to a physical device. They answer different questions, so neither should be silently substituted for the other.

8. Trust ladder for reported results

Level Evidence Permitted claim
Algebraic Adjoint agrees with a discrete directional derivative. The implementation differentiates its discrete operator.
Local surrogate Predicted and solved complex-pole changes agree on common connectivity with high mode overlap. The surrogate optimizer has a valid local ascent direction.
Representation transfer The exact saved contour reproduces on an independent mesh. The boundary handoff is not dominating the step.
Physical transfer Periodic FDTD/FEM evaluation improves under a fixed protocol. The optimization is improving a physical solver observable.
Converged device Q is stable to mesh, domain, runtime, and pole-fit choices. A numerical Q value may be quoted as validated.

Q, mode volume, and beta do not automatically share one trust level. In the current project the Q shape derivative has passed more of this ladder than the V or beta derivatives. Those objectives should remain outside quasi-Newton updates until their own normalization, adjoints, and finite-difference tests pass independently.