Start here: 3D air-strip nanocavity handoff
Public documentation and live optimization status: https://www.christianmlange.com/nanocavity-optimizer/.
Mission
Develop a first-principles, free-form inverse-design pipeline for a high-Q on-chip cavity that couples a laser-trapped atom in air to an integrated waveguide. The protected atom/tweezer opening is the full transverse strip
and it must remain exactly free of dielectric. Light must cross this air region to couple the two dielectric sides. The finite optimized defect is terminated in \(\pm x\) by exact semi-infinite periodic nanobeam mirrors; only the defect, not a long mirror, is meshed in the sparse 3D solve. Radiation is absorbed by PML in \(\pm y\) and \(\pm z\).
This repository is a research implementation, not a finished device claim. It contains the solver, regression tests, every important accepted and rejected checkpoint, and the evidence needed to continue without the original chat transcript.
Read in this order
AGENTS.md: operating rules for Codex or a human developer.SCIENTIFIC_STATUS.md: what has actually been demonstrated and what has not.DERIVATIONS.md: continuous equations, discretization, exact periodic boundary, gradients, pole extraction, and acceptance gates.FILE_MAP.md: source and artifact map.WORKSTATION96_RUNBOOK.md: commands for the 96 GB machine.CODEX_SETUP.md: command-line Codex installation and session handoff.REFERENCES.md: papers, software, and how each relates to this solver.README.mdand the milestone reports for historical detail.ATOM_COUPLING_OBJECTIVE.mdbefore running the atom-aware optimizer.SHIFTED_COOPERATIVITY_ARCHITECTURE.mdfor the accelerated objective, gradients, constraints, and acceptance contract.OPTIMIZATION_ACCELERATION_REPORT.mdfor the accepted A/B evidence.UNATTENDED_RUNBOOK.mdfor the current fail-closed multi-step runner.PUBLISH.mdfor the public documentation and live-dashboard pipeline.
Current accepted result
On the exact y/z parity-reduced 40 x 26 x 22 grid, an authoritative 41-point wide sweep, 449-point local sweep, and separately solved 28-point confirmatory sweep identify
All combined sheet-local-v2 spectral gates and all prescribed transverse-PML perturbations pass. The PML campaign's largest complex pole displacement is 0.005713 halfwidths, Q-fit span is 0.7526%, minimum dielectric-to-PML clearance is 0.20 lambda0, and air density is exactly zero in every case.
Two unattended common-ascent steps followed by one shifted constrained-MMA step improved normalized centered atom LDOS from 0.585294311 to 0.586177236 and fitted Q from 172.161687 to 172.706389. The latest step also improved moving-pole normalized LDOS from 1.883915970 to 1.887807730, used a 0.002 trust radius without backtracking, and achieved shifted-surrogate agreement 0.98168. It passed a completely rebuilt spectral validator and its own seven-case transverse-PML campaign: maximum complex-pole displacement is 0.005698 halfwidths, fitted-Q span is 0.7542%, minimum clearance is 0.20 lambda0, and the protected strip remains exactly empty. This is a PML-converged controlled-grid result, not a physical device-Q claim; grid/domain convergence remains incomplete.
Immediate objective
The production campaign now uses scripts/run_persistent_cooperativity.sh. It moves each exact periodic boundary outward by two complete mirror periods, turns those explicit phase-matched periods into designable cells, and keeps the slab thickness and transverse/PML geometry unchanged. The resulting 64 x 26 x 22 checkpoint is a topology transfer only: the bootstrap must freshly pass its 41/449/28-point spectral reacquisition and checkpoint-bound PML gate before its no-step-limit shifted-MMA loop starts. See UNATTENDED_RUNBOOK.md for restart and stop semantics. No expanded-domain Q is valid until that bootstrap completes, and grid convergence remains required for a physical device claim.
Environment
The code requires Python, NumPy, SciPy, and Matplotlib. Debian/Ubuntu protects the system interpreter under PEP 668, so use a virtual environment:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
If venv is missing:
sudo apt update
sudo apt install python3-venv python3-full unzip time
Set explicit BLAS thread counts before expensive runs:
export OPENBLAS_NUM_THREADS=4
export OMP_NUM_THREADS=4
export MKL_NUM_THREADS=4
Starting a new Codex session
From this directory, start Codex and give it this instruction:
Read START_HERE.md, AGENTS.md, SCIENTIFIC_STATUS.md, DERIVATIONS.md, FILE_MAP.md, and WORKSTATION96_RUNBOOK.md completely. Run the regression suite. Then continue the fine-grid resonance reacquisition exactly from the runbook, stopping at every scientific acceptance gate. Preserve the protected air strip and do not report a Q as physical until its spectral, PML, and grid gates pass.
Do not ask Codex merely to “maximize Q.” The model contains overlapping resonances and PML-sensitive failure modes; mode identity and independent validation are part of the objective.