Product engine
Self-contained project under engines/quan_loncar_meep_lab/ (package · campaigns · runs · notes). Assembled 2026-09-05 14:44 UTC.
Quan–Lončar ringdown-free Meep laboratory¶
This is an experimental fork for developing a trustworthy inverse-design
method around Meep's direct complex-frequency and driven-frequency-domain
solvers. It does not modify engines/quan_loncar_v1, whose validated
analytical/FDTD history remains the reference.
The initial benchmark is the compact, mirror-symmetric Quan–Lončar silicon nanobeam at approximately 1.52 µm. The first milestones are deliberately narrow:
- reproduce and track the intended cavity pole with
Simulation.solve_eigfreq; - compute \(Q=\operatorname{Re} f/[-2\operatorname{Im} f]\) without a decay-time simulation;
- obtain a driven steady-state field and selected forward waveguide-mode amplitude;
- validate complex-pole and port derivatives against central finite differences before trusting an optimization step.
The initial solver qualification is complete. The direct solver passes a
small official-style 2D regression, but neither stock nor field-seeded Meep
converges the shifted linear systems reliably for the full 3D Quan problem.
Consequently, this engine is fail-closed: it does not report a 3D Meep Q or
start an optimization from those attempts. See
notes/MEEP_QUALIFICATION_2026-07-29.md.
Hard operating rules¶
- Do not use a full high-Q ringdown. The engine contains no ringdown command.
- Warm-start every pole solve from the previously accepted complex pole.
- Re-solve and branch-check every proposed step; reject on mode-identity loss.
- Tidy3D is independent validation, not the inner-loop optimizer.
- Every Tidy3D submission requires a recorded estimate, and the new campaign total may never exceed 15.0 FlexCredits.
- Start Tidy3D checks conservatively; add mesh overrides only when a convergence question requires them.
Environment¶
The working environment is isolated from the repository virtual environment:
export CAVITYGRAD_ENVS=/absolute/path/to/cavitygrad-envs
micromamba create -f environment.yml \
-p "$CAVITYGRAD_ENVS/meep-1.34"
micromamba run -p "$CAVITYGRAD_ENVS/meep-1.34" \
python -m pip install -e package/quan_meep
The committed environment specification pins Meep 1.34 and MPI MPICH. The absolute prefix above is only the current workstation convention.
The preconditioned vector-Maxwell work uses a second environment so its complex PETSc/SLEPc build cannot disturb Meep:
Higher-order Nédélec H(curl) and curved-PML work uses a third isolated environment:
Current entry point¶
Inspect the discretized problem without solving:
micromamba run -p "$CAVITYGRAD_ENVS/meep-1.34" \
python -m quan_meep.cli pole \
benchmarks/seeds/quan_baseline.json --dry-run
Translate a preserved analytical Q/V/coupling result into the explicit selected-+x objective and Purcell constraint:
python -m quan_meep.cli oracle \
../quan_loncar_v1/package/quan_loncar_optimizer/engine/quan_loncar_series_phase57/RESULTS_PHASE57.json
Run a direct pole solve:
mpirun -np 4 \
"$CAVITYGRAD_ENVS/meep-1.34/bin/python" \
-m quan_meep.cli pole benchmarks/seeds/quan_baseline.json \
--output runs/baseline_pole.json
The pole command performs no time-domain decay fit.
Run the fast environment regression:
PYTHONPATH=/path/to/patched-prefix/lib/python3.12/site-packages \
micromamba run -p "$CAVITYGRAD_ENVS/meep-1.34" \
python tools/meep_eigfreq_smoke.py
The current development pivot is a preconditioned complex-frequency kernel with independently checked left/right pole and selected-port derivatives. Until it passes those gates, the preserved Quan analytical engine is the 3D benchmark oracle and Tidy3D is reserved for sparse independent certification.
Device23 complete-boundary Q campaign¶
The Device23 40-hole campaign represents both hole walls and the mirrored
outer waveguide sidewall in one level set. Its local objective is pure
log(Q): no curvature, wavelength, mode-volume, or coupling term is hidden in
the direction. A trial is one Hamilton--Jacobi advection; zero displacement is
bitwise identity and no smoothing, reinitialization, or pruning occurs inside
the line search.
Local acceptance uses a fixed-connectivity ALE pole solve. The incumbent mesh nodes move with all 41 contours while its material tags and DOF numbering stay fixed. This is essential at high Q: an independently generated million-DOF mesh changed Q by more than the predicted physical step and reversed its sign even after the geometry and pole-tracking defects were removed. Fresh remeshes are therefore re-baselines and diagnostics, not infinitesimal sign tests. Tidy3D remains an independent diagnostic every ten accepted steps and never steers or vetoes the local trajectory.
The production gate and persistent supervisor are, respectively,
tools/run_level_set_stack_ale_q_gate.py and
campaigns/device23_surrogate_freeform_q/run_campaign.py. The public run page
contains the geometry, retained fields, convergence, failure diagnosis, and
exact numerical provenance.
The first scalar algorithm fixture now passes those algebraic gates:
Its full complex-pole derivative agrees with central differences to 1.7e-9.
The promoted discrete-unit-power +x port closes total power to 3.9e-16, and
the selected-mode efficiency adjoint agrees with central differences to
1.6e-8.
This is not yet a vector Maxwell or quantitative 3D result; the exact scope
and promotion requirements are in
notes/FDFD_KERNEL_QUALIFICATION_2026-07-29.md.
The smooth physical-control pullback also passes central re-solves at 0.25–1.0 nm for the central gap, innermost ellipse radii, and a collective selected-efficiency ascent direction:
The worst complex-pole, log-Q, and shifted net-guided-efficiency relative
errors are 8.83e-4, 9.37e-4, and 1.08e-3, respectively. A reciprocal bordered
mode solve also differentiates the scalar QNM effective area to 1.15e-3 at
the same fabrication steps. The reflected guided amplitude is tracked
explicitly so the compact absorber cannot create a false one-sided-coupling
claim. See
notes/SHAPE_DERIVATIVE_GATE_2026-07-29.md.
The gated pieces are connected in a fully re-solved scalar optimization fixture:
Five default trust-region steps improve net selected efficiency from
0.473442 to 0.473693 while retaining an active scalar Q/effective-area floor
and limiting total real-pole drift to 2.43e-7 (1/µm). This is a method test,
not a Purcell or 3D device claim; see
notes/CONSTRAINED_SHAPE_FIXTURE_2026-07-29.md.
A complex SLEPc shift-invert backend now reproduces the scalar reference and passes both an analytic PEC-cube Yee-grid gate and an open vector dielectric PML-strength gate:
PYTHONPATH=package/quan_meep/src \
"$CAVITYGRAD_ENVS/slepc-3.23/bin/python" \
tools/run_slepc_qualification.py
PYTHONPATH=package/quan_meep/src \
"$CAVITYGRAD_ENVS/slepc-3.23/bin/python" \
tools/run_vector_pec_qualification.py
PYTHONPATH=package/quan_meep/src \
"$CAVITYGRAD_ENVS/slepc-3.23/bin/python" \
tools/run_vector_pml_qualification.py
The open 13,620-unknown vector fixture returns a passive Ey-like pole near
Q=642 whose real frequency varies by 1.52e-6 and loss rate by 0.507% over a
three-point PML-strength sweep. Its two-sided complex-pole derivative also
passes 0.25–1.0 nm smooth-vector shape re-solves with worst pole and log-Q
errors of 8.25e-4 and 1.33e-3. The reciprocal vector-QNM volume and combined
Q/V chain pass the same scale at 1.45e-3 and 2.06e-3. This is the
preconditioned vector method gate, not a 3D Quan or absolute Purcell claim.
See
notes/SLEPC_VECTOR_QUALIFICATION_2026-07-29.md.
The vector selected-mode algebra also has an analytic PEC-waveguide gate: discrete unit-power normalization and forward/backward decomposition close at roundoff, while its driven selected-power adjoint agrees with central differences to 4.32e-7.
That port has now been promoted to the numerical dielectric Quan guide. A Bloch-periodic vector Yee cross-section follows the fundamental Ey branch, normalizes it by discrete Poynting power, and maps it onto a three-plane cavity functional. The actual coarse Quan QNM is more than 99.97% outgoing in that selected channel at the qualified port planes. Its complete guided-decay shape derivative—including cavity eigenvector motion, QNM energy, loss-rate motion, and phase-aligned port-frequency motion—agrees with fresh ±0.5 nm cavity and port re-solves to 5.79e-5 worst relative error.
The complete 15-pair Quan baseline also runs in its Ey-symmetry octant:
PYTHONPATH=package/quan_meep/src \
"$CAVITYGRAD_ENVS/slepc-3.23/bin/python" \
tools/run_quan_octant_pole.py \
benchmarks/seeds/quan_baseline.json
Eight-point dual-cell material quadrature now replaces point sampling for the Quan beam and all apertures. PML convergence passes at 15 cells/µm, but the spatial loss-rate gate remains red: Q rises from 1,946 at 10 cells/µm to 3,996 at 20 cells/µm, and the final loss-rate change is still about 14%. The 20 cells/µm direct solve already uses 4.28 GB on this 7.8 GB host.
All 45 Quan spacing/radius material pullbacks are implemented. Coarse-grid complex-pole, QNM-volume, Purcell-chain, and guided-decay derivatives pass fabrication-scale central re-solves. One fully re-solved constrained method step improves the selected-forward proxy from 0.42458 to 0.42973 while retaining the explicit Purcell-method floor of 50 and holding the real pole within 9.32e-7 per µm. It is deliberately not a physical optimization result.
See notes/QUAN_VECTOR_METHOD_GATE_2026-07-29.md for the full gate table and
scope boundary. That coarse-grid result remains a derivative method gate, not
the physical evaluator used by the acceptance protocol below.
Higher-order H(curl) status¶
NGSolve analytic PEC-cube and open-Mie gates now pass without time stepping:
PYTHONPATH=package/quan_meep/src \
"$CAVITYGRAD_ENVS/ngsolve-6.2.2606/bin/python" \
tools/run_ngsolve_pec_qualification.py
PYTHONPATH=package/quan_meep/src \
"$CAVITYGRAD_ENVS/ngsolve-6.2.2606/bin/python" \
tools/run_ngsolve_mie_qualification.py
On the Quan octant, local physical p refinement and order-3 PML give a
ringdown-free pole near 0.66389 - 7.54e-6i 1/um, or Q approximately 44,000.
The PML loss spread is 1.60%; the last two high-order physical models differ
by 1.97% in loss. A corrected 10 ps Tidy3D short-window study independently
finds Q=45,000--49,000 on 16--28 point automatic grids. The defensible
cross-solver absolute envelope is currently Q=44,000--50,000.
The saved high-order field gives an energy mode volume of 0.05438 um^3, or
0.6591 (lambda/n)^3; the last two high-order spaces differ by 0.074%.
The native Tidy3D port monitor finds 99.888% of +x power in the desired
fundamental mode with backward/forward power ratio 2.05e-8. Selected-port
purity passes; absolute total guided-decay fraction remains fail-closed
because reactive transverse flux makes a closed-box ratio exceed one.
Direct solves are guarded at 150,000 DOF after a nested refinement expanded
to 725,023 DOF and likely exhausted the 7.8 GB no-swap host. Flux evaluation
is saved and run in a separate low-memory process, but that Q route was
rejected as PML-sensitive. See
notes/NGSOLVE_HCURL_QUALIFICATION_2026-07-30.md.
The Tidy3D convergence evidence and boundary-condition audit are documented in
notes/TIDY3D_SHORT_POLE_VALIDATION_2026-07-30.md.
First physically accepted transfer step¶
The old Phase-58 analytical optimizer has now been promoted only as a direction generator. Its step-3 geometry raises the matched mesh-20 Tidy3D Q from 47,567 to 166,233. Its later analytical-Q≈30k seed is independently resolved at Q=334,725 by the mixed-order H(curl) backend, while 21 Tidy3D short-window fits span Q=281,636--344,026. No run waits for field decay.
For the later seed:
- high-order energy volume is 0.03270 um^3, or 0.3992
(lambda/n)^3; - the desired fundamental mode carries 99.469% of +x power;
- the absolute two-sided selected-mode decay fraction is 99.664%;
- the conservative physical gate retains a 5.66x Q gain, Purcell factor 52,580, and selected guided fraction 99.464% after uncertainty inflation.
The gate is executable in quan_meep.physical_acceptance; every future
surrogate proposal must pass fresh independent pole, volume, coupling,
frequency, geometry, and uncertainty checks before it can replace the
incumbent. The complete evidence and exact scope are in
notes/PHASE58_PHYSICAL_TRANSFER_2026-07-30.md.
The first live 1 nm surrogate-Q proposal demonstrated the protocol's purpose: H(curl) Q improved 5.50% and Tidy3D Q ranked upward, but absolute desired-mode decay fell from 99.664% to 89.060%. The gate rejected it and retained the Q≈30k analytical seed as incumbent; the unneeded candidate volume solve was skipped.
Actual Tidy3D campaign spend is 0.9159245 FlexCredits, leaving 14.0840755 of the authorized 15.0.