Run Optimisation
When at least one optimisation target is checked, the desktop rewires the main action button from Run Analysis to Run Optimisation. The same analysis widgets are then reused as live optimisation surfaces.
Targets and order
Plain English
You can optimise detection gates, excitation profile, or both. If both are active, the optimiser alternates between the two according to the chosen run order for up to the configured maximum iteration count.
For specialists
The integrated workflow is implemented in TwinEngine.run_optimization_workflow(). It runs a detection stage, an excitation stage, or a sequential combination depending on the optimisation flags and ordering controls.
Detection-gate algorithms
| Algorithm | Use case | Implementation note |
|---|---|---|
| Fisher Compression | Default choice for compact, information-preserving gate design. | Supports nuisance-aware Schur-complement scoring and optional auto-compression. |
| Direct Mean F Minimisation | General-purpose direct numerical search. | Uses restarts, ftol, and per-restart iteration limits. |
| Partition Theorem Bottom-Up | Published constructive partitioning strategy. | Builds from a fine partition upward. |
| Partition Theorem Top-Down | Published constructive partitioning strategy. | Merges from a finer partition downward. |
Excitation-profile optimisation
Plain English
The optimiser can tune the laser profile as Gaussian width, square width, or a free-form waveform. It can either preserve total light dose or preserve peak amplitude.
For specialists
The excitation stage operates on the same dt_excitation() latent model as the normal simulator. Objectives include Fisher Information, Fisher Throughput, Photon Efficiency AUC, and Throughput AUC.
History, retained steps, and live display
Plain English
The optimiser can show the current instrument every few seconds while it runs. It also stores the final history and a chosen number of intermediate steps so the user can inspect how the design evolved.
For specialists
Live display is throttled by a real-time refresh interval. Full scalar histories are retained until the next run or until optimisation mode is exited.
Exiting optimisation mode
Leaving optimisation mode unchecks the target boxes, restores the normal main action button label, and asks whether the optimised result should be imported into the current instrument definition.