Source
Engine majumdar_lab · package package/multilayer_autonomous_optimizer · assembled 2026-07-29 15:57 UTC.
Performance and fundamental-TE0 coupling¶
Exact analytical acceleration¶
The optimizer still evaluates the same convergent contour model and exact QNM candidate observables. Version 0.3 removes repeated work in the call graph:
- build the cavity operator at the pole and at the two frequency offsets once;
- retain the tracked left/right eigensystem and frequency derivative;
- retain every contour node's regular strip Green tensor and hole projections;
- reuse that state for Q, mode volume, feed-pole coupling, and the geometry VJP;
- keep the accepted candidate state in memory for the next sequential step.
The two frequency-offset evaluations are independent and run in two Python threads. Their SciPy/NumPy kernels release the GIL. Using more than two workers does not expose more concurrency in this fixed three-frequency stencil.
Production phase-16 timings on the same P2 truncation were:
| Operation | Previous path | v0.3 shared path |
|---|---|---|
| exact Q/V/TE0 metrics from no cached state | about 450 s | 179.1 s |
| Q/V/TE0 metrics after state exists | repeated expensive solves | 0.39 s |
| implicit geometry gradient | about 300 s | 86.4 s after state exists |
The shared path reproduced Q=7117.863968904383, normalized
V=3.088336109072468, and analytical beta_TE0=0.6091860640872252.
The next largest cost is the geometry-dependent nonlinear pole correction,
which is necessarily sequential. It now tests the gradient-predicted pole
before creating a second secant point, and each report records shared-state,
gradient, candidate, and total timing.
Use --analytical-workers 2. If the linked BLAS also starts many threads,
limit BLAS to one thread per analytical worker:
OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 \
python run_autonomous.py --output autonomous_run --run --analytical-workers 2
Speculatively evaluating several trust radii in parallel is possible, but is not the default: it reduces latency only by spending several times more CPU and usually wastes the smaller candidates when the first proposal is accepted. FDTD checkpoints are also kept sequential because each one validates the next adaptive block and consumes FlexCredits.
What the FDTD coupling measurement is¶
The original two confirmation simulations contain flux-time monitors on the x
planes. Such a plane measures all outward Poynting flux crossing it. It cannot
separate the fundamental feed mode from higher-order guided modes, film/slab
modes, or radiation. Those old values are now labeled all_x_flux_* and are
not included in TE0 objective calibration.
Every new checkpoint adds a Tidy3D ModeMonitor and a matching FluxMonitor
at the straight +x feed section. Both use the same ringdown apodization. Tidy3D
normalizes a mode amplitude so its squared magnitude is modal power. The code:
- requests three modes near
n_eff=1.75with TE-first sorting; - independently inspects every returned mode;
- selects the propagating candidate with the largest real effective index and x-plane TE fraction at least 0.5;
- uses Tidy3D's x-normal TE definition, for which the in-plane first axis is y,
so the fraction is the Ey-like share
|Ey|^2/(|Ey|^2+|Ez|^2); - compares outgoing TE0 power with total spectral x-plane power;
- rejects the value if incoming/outgoing TE0 exceeds 0.1, modal power exceeds total flux by more than 10%, or the monitor is more than 5 nm from the fitted resonance;
- infers the identical -x result from the simulation's exact x-even symmetry.
A local mode-solver preflight of the actual multilayer feed cross-section at 778.46 nm returned:
| Mode | real neff | x-plane TE fraction | waveguide TE fraction | Selection |
|---|---|---|---|---|
| 0 | 1.75670 | 0.99493 | 0.90336 | fundamental feed TE0 |
| 1 | 1.55397 | 0.99553 | 0.99286 | lower-neff film/slab-like branch |
| 2 | 1.53197 | 0.39635 | 0.95795 | rejected by x-plane Ey-like test |
Thus the selected mode is not merely assumed from its array position: its effective index and polarization distinguish it from the nearby film-stack branches, and the same properties are rechecked after every FDTD run.
If f_TE0|x is the accepted TE0 share of x-directed power, then
The report saves the selected port mode, its effective index, TE fraction, incoming contamination, candidate list, and closure checks. This confirms cavity decay into the fundamental feed TE mode. It does not measure driven input transmission or input-to-cavity loading; those require a separate port-excited S-parameter simulation.