Optimization Methods
Refinement moves the thicknesses of a fixed stack to lower the merit function; synthesis changes the layers themselves. Every method lowers the same merit function, the rows of the Merit Function Editor, and works in every surface mode of the Design Editor.
The map in the figures
Section titled “The map in the figures”Each figure is the merit function of a two-layer antireflection coating on BK7, MgF₂ facing the air over Ta₂O₅, with one RGT row holding R at 0 % from 450 to 650 nm. Every point is one design, and the paler the colour, the lower its merit. Each method starts from 160 nm of MgF₂ on 200 nm of Ta₂O₅ and runs as the Refinement window runs it. Two layers make only a weak antireflection coating; the case is here because two thicknesses fit on a flat map.
Merit, slopes and bounds
Section titled “Merit, slopes and bounds”| Formula | Note | |
|---|---|---|
| residuals | one per row; a range target (TGT, RGT, AGT) gives one per sampled wavelength, | |
| merit | over the rows that score | |
| Jacobian | from the layer matrices; central differences for a row without one | |
| gradient | ||
| Hessian | alone where the curvature is not available |
is how far row misses its target, its weight and its scale, as in the Merit Function Editor; is the miss at sample of a band and its trapezoid weight. has its curvature term when the merit is scored on one side alone, in one environment, with no cone, and with no math, color, ellipsometry, field or curve-block row and no row with a of its own (dB, phase, group delay).
| Formula | Note | |
|---|---|---|
| floor | no upper limit unless an MXT row sets one | |
| MNT, MXT | hard limits in SQP; penalty rows of the merit in every other method, zero while the limit holds | |
| held layer | a layer on a bound whose slope pushes it out sits out the step (DLS, Newton, Newton-CG, Trust-region Newton) | |
| step span | (DLS, Newton, Newton-CG, SQP, CG’s first probe) |
is the longest wavelength the merit samples. A layer a half wave thicker gives the same R and T at that wavelength (Macleod, Eq. 2.111), so the slopes a step is built on say nothing past . Locked layers never move.
Refinement methods
Section titled “Refinement methods”Sequential QP
Section titled “Sequential QP”The default. Each step minimizes a quadratic model of the merit inside a box made of the 1 nm floor, the MNT and MXT rows and the step span, so no step leaves a thickness limit.

| Formula | Note | |
|---|---|---|
| model | ||
| box | from 1 nm and the MNT and MXT rows | |
| solve | primal active set; at its pass cap, the lower of its point and the Cauchy point; while the matrix is not positive definite, at most 12 times, then one DLS step | |
| accept | otherwise | |
| stop | Max iter (200) |
Damped Least Squares
Section titled “Damped Least Squares”Each step solves the linearized least-squares problem for all residuals at once, with a damping term that shortens the step until the merit falls (Levenberg-Marquardt).

| Formula | Note | |
|---|---|---|
| step | by QR the same as scaled down so that no | |
| accept | otherwise | |
| stop | after an accepted step, the actual and the predicted fall of both with the actual the predicted, or Max iter (500) |
The predicted fall is , and : the stopping tests of MINPACK’s lmder.
Conjugate Gradient
Section titled “Conjugate Gradient”Each step picks a direction from the slope and the previous direction, then takes the lowest merit it finds along that line.

| Formula | Note | |
|---|---|---|
| direction | every steps ( free layers, at least 2) or when | |
| search | first : where the first layer along has moved by its span , or the last if shorter; halve until , go on halving while MF falls, keep the lowest; clamps to 1 nm | |
| restart | a failed search is tried again along with a fresh first ; after 12 steps in a row that each gain under of MF, start again from the best point, at most 8 times | |
| stop | 4 failed searches in a row; a plateau after a restart that gained under Max iter (600) |
As the inner refiner of the synthesis windows, CG starts each search from a scan up to 2000 nm instead of the span and has no restarts.
Newton
Section titled “Newton”Each step solves the Newton equations with the full second derivative of the merit, damped until the matrix is positive definite.

| Formula | Note | |
|---|---|---|
| step | by Cholesky; until it factors, at most 12 times, then one DLS step; scaled to the spans, the trial clamped to 1 nm | |
| accept | MF falls: otherwise | |
| stop | Max iter (200) |
Newton-CG
Section titled “Newton-CG”Each step solves the Newton equations only roughly, by conjugate gradients inside a trust radius, with second derivatives taken from differences of the gradient, so the Hessian is never formed.

| Formula | Note | |
|---|---|---|
| model | ||
| solve | Steihaug CG, at most iterations, to , the radius or negative curvature; scaled to the spans | |
| ratio | the move after clamping to 1 nm | |
| radius | and | |
| accept | and MF falls | |
| stop | 6 steps in a row rejected or with Max iter (200) |
Trust-region Newton
Section titled “Trust-region Newton”Each step minimizes a quadratic model of the merit within a trust radius of every thickness, and can put several layers onto the 1 nm floor at once. It is also the default refiner of Needle and Deep Synthesis, and a choice in Gradual Evolution and the Structural Optimizer.

| Formula | Note | |
|---|---|---|
| model | for | |
| step | the Cauchy point along the projected , then at most minor iterates: CG on the layers off a bound and a projected search with sufficient decrease 0.01 | |
| ratio | ||
| radius | with on the edge: | |
| accept | ||
| stop | predicted fall an accepted step whose actual and predicted fall are a step or radius MF down by under 0.01 % over the last 6 steps; Max iter (200) |
DLS multi-start
Section titled “DLS multi-start”Runs Damped Least Squares from copies of the start, each with every free thickness scaled at random, and keeps the lowest merit.

| Formula | Note | |
|---|---|---|
| start | uniform in from restart ’s own stream of the Seed, ( 20 and 30 % by default) | |
| run | Damped Least Squares from each start with Max iter (500), several at once on the CPU threads | |
| keep | the restart with the lowest MF |
Differential Evolution
Section titled “Differential Evolution”Keeps a population of designs. Each generation builds a trial for every member from the difference of two other members and keeps it when it scores at least as well.

| Formula | Note | |
|---|---|---|
| population | member 1 is the start, the others at least 1 nm | |
| mutation | distinct and | |
| crossover | when or otherwise clamped to 1 nm | |
| selection | the trial replaces when a generation’s trials all come from the old population | |
| stop | no new best in 60 generations; Max iter (250) |
With four or more free layers and more than two CPU threads, each generation’s trials are scored on several workers at once, with the same result.
Simulated Annealing
Section titled “Simulated Annealing”Each sweep tries random moves of every thickness. It keeps a move that lowers the merit, and one that raises it with a probability that falls as the temperature drops (Macleod, Eq. 3.33).

| Formula | Note | |
|---|---|---|
| move | clamped to 1 nm | |
| accept | or | |
| sweep | moves, then | |
| the mean of the uphill moves among 20 trial moves from the start (), divided by | ||
| stop | no new best in 100 sweeps; Max iter (400) |
The result is the lowest design met on the way, not the last one.
Try all, keep best
Section titled “Try all, keep best”Runs CG, DLS, Newton, Newton-CG, SQP, Trust-region Newton, DE, SA and DLS multi-start in turn, each from the same start with its own iteration budget, and keeps the lowest merit.
Synthesis methods
Section titled “Synthesis methods”These change the number of layers. See each tool’s page.
| Tool | What it does | Default inner refiner |
|---|---|---|
| Needle | Inserts thin “needle” layers where the P-function says the merit falls, then refines. | Trust-region Newton, which ended lower than CG on most of the benchmark’s cases and grows the stack without collapsing it. |
| Gradual Evolution | Needle optimization in an outer loop that forces a needle in, even uphill, to leave a local minimum. | CG, which does not stall on demanding multi-passband targets the way a least-squares refiner can. |
| Structural Optimizer | Randomly adds, removes, splits, merges or perturbs layers with a simulated-annealing accept. | CG. Best layer efficiency in the benchmark. |
How to choose
Section titled “How to choose”One method for most designs? → SQP (the default)No min-thickness, want the classic? → DLSDecent design to polish? → CG (or Newton-CG)Near the minimum, want last digits? → Newton-CG (or Newton on small stacks)Hard min-thickness to respect? → SQP (holds MNT and MXT as hard limits)Thin layers to fold onto the floor? → Trust-region NewtonBad / unknown start, multimodal? → DE (or SA on a rugged surface)Too few layers for the target? → Synthesis: Needle → GE → StructuralNot sure? → Try all, keep bestA reliable full workflow:
Synthesize unconstrained → Design Cleaner at your min-thickness → Refine with your min-thickness on.
Clean before the floor goes on: SQP lifts every layer thinner than the floor up to it, so a Cleaner pass after it finds nothing to take out.
Benchmark
Section titled “Benchmark”Every method was run on five designs (a broadband antireflection coating, a 50/50 beam splitter, a three-line bandpass, a shortpass edge filter and a demanding multi-passband filter), with and without a realistic minimum thickness.
- No local refiner wins every case. SQP, the default, was far ahead on the hardest constrained case, the multi-passband with a 40 nm floor (MF 0.235 where the others reached 0.51 to 0.56). CG was the best local refiner on the beam splitter and the three-line bandpass, with and without the floor; with it, CG reached MF 0.009 on the beam splitter where SQP stopped at 0.067. DLS, Newton and SQP tied on the shortpass edge.
- The global refiners leave local minima: on the broadband antireflection coating, DE reached MF 0.012 and DLS multi-start 0.008, where plain DLS stopped at 0.118.
- Synthesis reaches the lowest merit: the tools that grow layers (Needle, GE) go lower than any fixed-structure refiner, given enough layers.
- The Structural Optimizer gives the lowest merit per layer.
dMin1 nm against 40 nm: 1 nm lets synthesis reach a lower merit with more, thinner layers; a manufacturable floor raises the merit but gives a buildable stack. Synthesize at 1 nm, then enforce the real floor with a Cleaner pass and then Refinement.- Each tool treats MNT its own way: Needle leaves it out (an MNT penalty would wipe out every improving candidate), GE respects it, Structural holds it as a hard floor on every layer, and Refinement holds it as a hard limit with SQP and as a penalty with the other methods.
References
Section titled “References”- H. A. Macleod, Thin-Film Optical Filters, 5th ed., Section 3.6, pp. 88-97 (automatic design: damped least squares p. 90, direction set methods and simulated annealing, Eqs. 3.32-3.33, p. 91, differential evolution p. 92); Eq. 2.111 (layer matrix).
- K. Levenberg, Quart. Appl. Math. 2, 164 (1944); D. W. Marquardt, J. SIAM 11, 431 (1963): damped least squares.
- J. J. Moré, B. S. Garbow and K. E. Hillstrom, User Guide for MINPACK-1, Argonne ANL-80-74 (1980): the lmder stopping tests.
- J. Nocedal and S. J. Wright, Numerical Optimization, 2nd ed.: Eq. 3.4 and Algorithm 3.1 (backtracking with sufficient decrease), Algorithm 4.1 (trust radius), Section 5.2 (Polak-Ribière conjugate gradients), Algorithm 7.2 (Steihaug CG), Sections 16.5 and 16.7 (active-set QP, Cauchy point).
- D. P. Bertsekas, SIAM J. Control Optim. 20, 221 (1982): projected Newton methods, the held-layer rule.
- C.-J. Lin and J. J. Moré, SIAM J. Optim. 9, 1100 (1999): the trust-region step with projected searches.
- A. N. Tikhonov, A. V. Tikhonravov and M. K. Trubetskov, Comp. Maths. Math. Phys. 33, 1339 (1993): second-order methods in coating synthesis.
- R. Storn and K. Price, J. Global Optim. 11, 341 (1997): differential evolution.
- S. Kirkpatrick, C. D. Gelatt and M. P. Vecchi, Science 220, 671 (1983): simulated annealing.
- A. V. Tikhonravov, M. K. Trubetskov and G. W. DeBell, Appl. Opt. 35, 5493 (1996) and 46, 704 (2007): needle optimization and gradual evolution.