# Low-order image-based wavefront control

Recorded 1 December 2026, before training or held-out controller comparisons.

## Question and relation to prior work

Can a small reinforcement-learning policy learn low-order wavefront correction from noisy phase-diversity images, and how does it compare with an image-driven phase-diversity least-squares controller on unfamiliar phase screens and photon budgets?

This is a computational pilot adapting the non-coronagraphic phase-diversity stage of Gutierrez et al. (2024), arXiv:2407.18733. The published numerical results use much larger training and optical models. This experiment uses a six-mode pupil-phase corrector and an ideal coherent-mode-removal coronagraph for downstream diagnostics. Its scope is simulated low-order control and robustness.

## Optical model and control

Use HCIPy to define a unit-diameter unobstructed circular pupil sampled on 32 × 32 points. The sensing focal plane covers 8 × 8 lambda/D on 16 × 16 pixels. Control six Zernike shapes starting at Noll index 4, excluding piston and tip/tilt. Individually normalize each sampled mode to unit RMS over the illuminated pupil and record its sampled Gram matrix. Report actual residual phase RMS from the pupil samples. Coefficients and commands are radians of applied pupil phase. At 500 nm, optical-path difference equals phase × 500 / (2 pi) nanometres; reflective mirror surface displacement would be half that OPD.

Each static episode has six bounded incremental commands. A command changes each modal coefficient by at most 0.15 rad and the total commanded coefficient is bounded to ±1 rad. The agent receives focused and defocused non-coronagraphic intensity images, its previous command, remaining horizon, and the known exposure-photon calibration. Defocus diversity is 0.8 rad RMS. True aberrations, residual phase, and a condition label are unavailable to the actor.

Normalize intensities to a fixed ideal on-axis point-source reference. Generate independent Poisson photon counts plus one-electron Gaussian read noise for each sensing exposure. Retain signed read-noise outcomes. Each measurement pair uses two exposures with the declared incident photon budget per exposure. Both controllers acquire one initial pair and a new pair after each of six commands, totaling 14 exposures per episode. Image-driven reward reuses the focused frame and requires no extra exposure.

Training phase screens combine the six modes with coefficient weights proportional to reciprocal modal index, then scale the actual pupil phase RMS to a uniform draw from 0.15–0.45 rad. Training photon budgets are log-uniform from 30,000 to 300,000 incident photons per sensing exposure. The training controller has unit gain. Reward is five times the clipped, measured on-axis intensity ratio minus 0.01 times mean squared normalized action. All detector calibration and clipping are explicit in code.

## Learning and comparison

Train three independent SAC MLP policies, seeds 11, 22, and 33, with 50,000 environment steps each. Use two hidden layers of 128 units, learning rate 0.0003, discount 0.9, batch 128, buffer 50,000, learning start 1,000, and one gradient update per step. Automatic entropy starts at 0.05. Train on CPU with one PyTorch thread. Save final policies and development learning curves at 10,000-step intervals. Primary comparisons use the final policies, without choosing a checkpoint from the final test results.

Compare with no correction, an untrained policy, and a conventional controller that estimates residual modal phase by fitting its nominal focus/diversity image model to the measured pair, then applies its bounded negative estimate. The fit uses intensity measurements and its nominal optical model. All controller actions obey identical bounds and sensing budgets. Internal computation is reported separately from exposure count.

## Held-out cases

For each of five conditions, use 100 deterministic test episode seeds beginning at 900,000, distinct from training streams and development seeds beginning at 700,000. Pair every controller on the same initial phase screen. Noise draws are indexed independently by episode, step, and exposure, keeping sensing budgets comparable while allowing intensity-dependent Poisson outcomes. Test conditions are fixed as follows.

- Nominal conditions use 0.4 rad initial controlled phase RMS and 100,000 photons per exposure.
- Low photon count uses 0.4 rad RMS and 1,000 photons per exposure.
- Larger aberrations use 0.8 rad RMS and 100,000 photons per exposure.
- Uncontrolled modes add an independent 0.2 rad RMS component from Noll indices 11–16 to the 0.4 rad controlled component, with 100,000 photons.
- Gain mismatch uses nominal aberrations and photons with actual modal actuator gain 1.15 while the baseline nominal model retains gain 1.0.

Final tests are first evaluated after training settings and validation are fixed. Development evaluations use 24 nominal episodes and 24 low-photon episodes. They are used to diagnose implementation failures and document training behavior.

## Physical diagnostics and reporting

Compute noise-free on-axis intensity relative to the ideal unaberrated peak, actual residual phase RMS, and its OPD equivalent at every command. For downstream high-contrast diagnostics, remove the coherent projection onto the unaberrated pupil field and propagate the remaining field. Measure mean residual starlight in a 2–4 lambda/D annulus relative to the ideal non-coronagraphic PSF peak. Also propagate a unit-flux off-axis point source at 3 lambda/D and measure encircled energy in a 0.75 lambda/D aperture relative to the same source propagated without the coronagraph and without phase error. This is a throughput diagnostic, with no planet population or detectability inference.

Downstream optical diagnostics are computed from simulator state, excluded from policy observations and rewards, and do not represent additional simulated sensing exposures. Report all training seeds, paired episode outcomes, bootstrap intervals resampling test episodes, exposure accounting, validation checks, and representative images on a common fixed intensity scale. Choose representative cases deterministically. Keep code, locked dependencies, trained model files, environment metadata, and complete result tables. Training/environment budgets and simplified optics bound the conclusions.
