---
title: Joint dielectric/modal-current temporal campaign
---

# Joint dielectric/modal-current temporal campaign

```{admonition} Campaign state
:class: tip

This prepared successor jointly evolves a fully freeform, fixed-norm transverse current sheet and a smooth spline phase-field dielectric. Its pulse, reciprocal output detector, and fixed unity-amplitude causal lossless target remain anchored.
```

| State | Value |
|---|---:|
| Status | `stopped_user_requested_for_midpoint_successor` |
| Source | `trainable_fixed_norm_modal_electric_current` |
| Source spatial profile | `freeform Ex/Ey/Ez on physical center plane` |
| Active source degrees of freedom | 2700 |
| Source coordinate shape | `(3, 1, 42, 42)` |
| Ex / Ey / Ez coordinate norms | `0.1095, 0.9925, 0.0550` |
| Source current norm ratio | 1 |
| Source/reference overlap | 0.98048 |
| Source angular trust radius | 0.01875 rad |
| Detector / target trainable | `False / False` |
| Temporal observable | `fixed_scale_reciprocal_mode_electric_coordinate` |
| Phase | `shifted_lossless_temporal` |
| Active coordinates | `topology_free_spline_phase_field` |
| Completed updates | 119 |
| Temporal objective | -0.96818 |
| Whole-trace fixed-waveform fidelity | 0.50808 |
| Source-off fixed-waveform fidelity | 0.50753 |
| Fixed target source-off power (telemetry) | 0.49985 |
| Fixed-target gain (ideal = 1) | 0.01609 |
| Fixed-target normalized MSE | 0.96818 |
| Normalized temporal residual | 0.98396 |
| Full-field coherence | 0.99999 |
| Shifted stationarity | 0.8102 |
| Q telemetry | 575.91 |
| Normalized V telemetry | 0.051423 |
| Active pole tape | 1 ps |
| Maxwell-step reduction vs 2 ps | 2× |
| Material continuation stage | `cut_cell_spline_boundary_mature` |
| Interface half-width | 6.25 nm |
| Sharpness ratio / threshold | 16 / 0.50 |
| Cut-cell fraction | 11.09% |
| Material optimizer | `adaptive_block_trust_lbfgs_freeform_source_spline_phase_field_v2` |
| Material coordinates | `smooth spline phase field; no density pixels` |
| Material trust radius | 0.00375 µm |
| L-BFGS memory pairs | 8 |
| Forward-only rejected-step retries | 3 |
| Source gradient transform | `unit-sphere tangent and geodesic retraction` |
| Source L-BFGS memory pairs | 8 |
| Boundary handoff | `waiting_for_binary_stable_topology` |
| Stable binary-topology states | 0 / 3 |
| Boundary trust radius | inactive until spline handoff |
| Last candidate accepted | True |
| Last pole trustworthy | True |
| Latest update wall time | 82.07 s |
| Last artifact write | 2026-08-29 00:59:00 UTC |

The authoritative state is
`benchmarks/artifacts/invdes_fryett_modal_temporal_modal_current_freeform_source_v2.npz`. The active fixed-source modal checkpoint is a separate preserved artifact; preparing this successor neither seeds from nor modifies it.

## Geometry and exact material difference

![Initial, accepted, and difference geometry](../_static/generated/fryett_modal_source_codesign_geometry.png)

## Field used by the temporal objective

![Current windowed Ey field](../_static/generated/fryett_modal_source_codesign_fields.png)

## Exact temporal target response

![Simulated and projected target traces](../_static/generated/fryett_modal_source_codesign_temporal.png)

The orange curve is the fixed causal convolution of the prescribed current waveform
with the cosine Green function of one lossless pole. It is not the source waveform and
is not fitted to the simulation. During the drive it contains the exact causal build-up;
after turn-off its extrema are exactly -1 and +1. The blue simulation is plotted in those
same absolute objective units, so a smaller blue envelope is a real amplitude error, not
a display normalization. The current waveform appears only in the diagnostic panel on
its own explicitly independent display scale. The former blue background bands were 4D
field-snapshot windows; they were never objective weights and have been removed from
this plot to make the absolute comparison unambiguous. Every temporal sample still
enters the single normalized mean-square error equally.

## Evolving freeform source profile

![Area-whitened Ex, Ey, and Ez source coordinates](../_static/generated/fryett_modal_source_codesign_source_profile.png)


## Full-field temporal correlations

![Temporal Gram matrix and energies](../_static/generated/fryett_modal_source_codesign_gram.png)

## Objective, interface continuation, and pole history

![Temporal campaign history](../_static/generated/fryett_modal_source_codesign_history.png)

## Q versus iteration — linear scale

![Cavity Q versus optimization iteration on a linear scale](../_static/generated/fryett_modal_source_codesign_q_history.png)

## Exact methodology, target response, and moving components

## Scientific question and separation from the live run

This is an opt-in successor to the fixed-source modal-current campaign. It
keeps the same 8 µm × 1 µm design region, continuous feedthrough-waveguide
initialization, fixed causal unity-amplitude lossless temporal target, pole
tracking, and minimum viable FDTD tapes. It changes two coordinate systems:

1. the impressed current becomes freeform over the physical transverse source
   plane instead of being restricted to six envelopes of a waveguide mode;
2. the dielectric is a smooth cubic-spline phase field with subpixel cut-cell
   fractions instead of projected material pixels.

The campaign has a distinct ID, artifact, method fingerprint, lock, services,
and dashboard assets. Preparing it does not stop, seed from, or write the live
fixed-source artifact. No FDTD optimization is started during preparation.

## What “freeform source” means

The source remains a single electric-current sheet at the center x plane with
the fixed broadband Gaussian waveform \(s(t)\). On the symmetry-reduced
physical cross-section it has an independent real value for every electric
Yee component,

\[
  \mathbf J(y_j,z_k,t)=s(t)
  \begin{bmatrix}J_x(j,k)&J_y(j,k)&J_z(j,k)\end{bmatrix}^{T}.
\]

The 30 × 30 non-PML transverse grid therefore supplies
\(3\times30\times30=2700\) independent spatial degrees of freedom. Current is
exactly zero in the PML. The reduced-domain PEC/PMC walls impose the requested
mirror parities when FDTD unfolds the source; no waveguide-mode polarization,
nodal pattern, or envelope is prescribed.

This is freeform in the physically meaningful *local transverse* sense. It is
not a distributed current along x. Giving the source longitudinal samples
throughout the design would let it paint a Bloch envelope and manufacture a
long ringdown without requiring the dielectric to form a cavity. Here the
dielectric must still create the longitudinal periodic Bloch physics. A real,
reciprocal, lossless defect cavity has a standing eigenmode whose electric
profile can be chosen real at the source plane, so these coordinates span its
relevant source cross-section. A genuinely traveling Bloch wave at generic k
would require a second temporal quadrature and a complex spatial profile; that
extra freedom is deliberately absent from this standing-cavity experiment.

## Fixed source norm

Let \(w_{jk}\) be the physical Yee-face area weights and \(M_{cjk}\) the mask
of non-PML samples. The stored source coordinate is area-whitened,

\[
 u_{cjk}=\sqrt{w_{jk}}\,M_{cjk}J_{cjk},
 \qquad \widehat{\mathbf u}={\mathbf u\over\|\mathbf u\|_2}.
\]

The injected current is reconstructed with the reference guide current norm
\(N_0\),

\[
 J_{cjk}=M_{cjk}{N_0\widehat u_{cjk}\over\sqrt{w_{jk}}}.
\]

Thus every proposal has exactly the same area-weighted impressed-current norm.
The optimizer cannot improve the objective by increasing source power. The
initial direction is the terminal-guide mode restricted to the physical plane.

The reciprocal output detector stays fixed to the terminal feedthrough mode.
This anchors the measurement and target: adapting the source away from that
mode must produce a better Maxwell-mediated cavity response at the same fixed
observable; it cannot redefine what is being measured.

## One fixed temporal objective

The ideal response is the exact discrete causal cosine Green-function
convolution described in `MODAL_TEMPORAL_METHOD.md`. It includes the pulse-on
transient and becomes a unit-amplitude, nondecaying sinusoid after the source
turns off. Neither amplitude nor phase is fitted to a simulated trace. The sole
scalar objective is

\[
 F(\phi,\mathbf u)
 =-\frac{\sum_n[y_n(\phi,\mathbf u)-y_n^*]^2}
          {\sum_n(y_n^*)^2}.
\]

There is no separate late-time-power, Q, Q/V, mode-volume, output-mode,
periodicity, DCT, or field-correlation term. Pole fits remain tracking and
safety telemetry only.

## One forward/reverse pair for both blocks

For the time-discrete Maxwell state

\[
 x_{n+1}=f_n(x_n,\phi,\mathbf u),
\]

one checkpointed primal trajectory and one reverse-mode sweep gives both derivatives,

\[
 {dF\over d\phi_i}=\sum_n\lambda_{n+1}^T{\partial f_n\over\partial\phi_i},
 \qquad
 {dF\over du_m}=\sum_n\lambda_{n+1}^T{\partial f_n\over\partial u_m}.
\]

The source derivative is the time correlation of the adjoint electric field
with \(s(t)\) at every source-plane degree of freedom. Its cost does not scale
with the 2700 source coordinates. The campaign intentionally uses the
checkpointed differentiator because the custom reversible VJP does not expose
source-object leaves.

## Smooth material representation from the first solve

The material is not parameterized by independent density pixels. Controls
\(a_{pq}\) define an absolute signed cubic B-spline phase field,

\[
 \phi(x,y)=\sum_{p,q}a_{pq}B_p(x)B_q(y),
\]

on an 81 × 11 control grid. Because these are absolute phase-field controls,
any control may cross zero during discovery: holes and components are not
prescribed and topology is not locked.

The zero contour \(\phi=0\) is the continuous material boundary. FDTD receives
the area fraction of material inside each Yee cell,

\[
 \rho_{ij}={1\over A_{ij}}\int_{A_{ij}}
 H_{\epsilon}(\phi(x,y))\,dA,
\]

evaluated by 4 × 4 subcell quadrature directly on the cubic spline. The compact
C1 Heaviside \(H_\epsilon\) is exactly zero or one outside its interface band.
Consequently the sharp representation has binary island interiors and
exteriors; only cells intersected by the smooth boundary have a gray area
fraction. Those gray values are physical inverse-subpixel averages, not
intermediate material.

This construction avoids the jagged-edge failure of independently thresholding
pixels and fitting a contour afterward. The geometry is the spline contour
throughout; sharpening changes only how accurately its cut-cell coverage is
resolved.

## Interface continuation and smooth-boundary lock

For the first 12 accepted updates the interface half-width is held at
\(\epsilon_0=100\) nm. This supplies shallow, distributed material gradients
while source and dielectric establish context. It is then narrowed with a
logarithmic smoothstep on the accepted-step clock,

\[
 \epsilon(k)=\exp\left[(1-s)\log\epsilon_0+s\log\epsilon_f\right],
 \quad s=3r^2-2r^3,
\]

where \(r=(k-12)/(61-12)\) is clipped to \([0,1]\) and
\(\epsilon_f=6.25\) nm, one quarter of a Yee cell. Rejected trials do not
advance the continuation. L-BFGS memory is not reset when the width changes.

After update 61, three trustworthy accepted states with stable topology are
required before a replayed handoff. The accepted density is fit to a signed
distance contour, replayed as a topology-guarded 81 × 11 cubic-spline boundary,
and accepted only if the exact Maxwell response, field overlap, pole fit, and
topology survive. Subsequent optimization moves only that smooth boundary and
continues to use cut-cell area fractions. No hard pixel mask is ever the
optimized terminal geometry.

## Block adaptive trust-region L-BFGS

Material and source coordinates have separate eight-pair L-BFGS memories and
separate trust radii. The phase-field material radius starts at 1 nm in signed
distance and the source radius starts at 0.0025 radians. The source direction
is projected onto the unit-sphere tangent and retracted geodesically,

\[
 \mathbf d_T=\mathbf d-\widehat{\mathbf u}
 (\widehat{\mathbf u}^{T}\mathbf d),\qquad
 \widehat{\mathbf u}'=\cos\theta\widehat{\mathbf u}
 +\sin\theta{\mathbf d_T\over\|\mathbf d_T\|_2}.
\]

One exact joint trial controls both radii using

\[
 p=\nabla_\phi F^T\Delta\phi+\nabla_u F^T\Delta u,
 \qquad r={F'-F\over p}.
\]

The trial must improve the exact objective and have \(r\ge0.05\). Rejection
halves both radii and caches both gradients, so the smaller retry costs one
forward solve and no new adjoint. A well-predicted boundary-using step grows a
radius by 1.5. Three consecutive misses clear stale curvature. There is no
Q-dependent density cap and no routine line search.

## Fixed and moving components

Fixed:

- center source plane, temporal waveform, source-off time, and total current norm;
- zero source support inside PML and no longitudinal source painting;
- reciprocal feedthrough detector and absolute temporal target;
- grid, material stack, symmetry, PML, design region, and terminal feedthrough;
- absence of Q/V, mode-volume, output-coupling, DCT, or periodicity terms.

Moving:

- 2700 real transverse electric-current coordinates on their norm sphere;
- 81 × 11 topology-free cubic-spline phase-field controls during discovery;
- the same smooth contour in a topology-guarded cut-cell boundary chart after maturity;
- independent material/source trust radii and L-BFGS histories;
- after trustworthy Q exceeds 100, the next-turn tracking carrier and minimum
  viable pole tape.

## Launch state

Preparation creates `modal_current_freeform_source_v2` with status
`ready_not_started`. It performs no FDTD optimization and starts no service.
The active fixed-source campaign remains untouched until this successor is
explicitly launched.


## Operations

A bounded manual turn can be run with:

```bash
FDTDX_FRYETT_MODAL_SOURCE_CO_DESIGN=1 FDTDX_FRYETT_MODAL_TEMPORAL_ID=modal_current_freeform_source_v2 uv run python -m benchmarks.cases.invdes_fryett_hybrid_scratch.modal_temporal --updates 1
```

The persistent launcher is `scripts/start_fryett_modal_source_codesign_campaign.sh`.


