Skip to content

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.

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.

Formula Note
residuals rp=wi mi/σir_p = \sqrt{w_i}\, m_i / \sigma_i one per row; a range target (TGT, RGT, AGT) gives one per sampled wavelength, wiqs ms\sqrt{w_i q_s}\, m_s
merit MF=∑prp2/W\mathrm{MF} = \sqrt{\sum_p r_p^2 / W} W=∑wiW = \sum w_i over the rows that score
Jacobian Jpk=∂rp/∂dkJ_{pk} = \partial r_p / \partial d_k from the layer matrices; central differences for a row without one
gradient g=∇MF=JTr/(W⋅MF)g = \nabla\mathrm{MF} = J^T r / (W \cdot \mathrm{MF})
Hessian H=JTJ+∑prp∇2rpH = J^T J + \sum_p r_p \nabla^2 r_p JTJJ^T J alone where the curvature is not available

mim_i is how far row ii misses its target, wiw_i its weight and σi\sigma_i its scale, as in the Merit Function Editor; msm_s is the miss at sample ss of a band and qsq_s its trapezoid weight. HH 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 σ\sigma of its own (dB, phase, group delay).

Formula Note
floor dk≥1 nmd_k \ge 1\ \text{nm} 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 ∣Δdk∣≤sk=λmax⁡/(2 ∣n~k(λmax⁡)∣)\lvert\Delta d_k\rvert \le s_k = \lambda_{\max} / (2\,\lvert\tilde n_k(\lambda_{\max})\rvert) (DLS, Newton, Newton-CG, SQP, CG’s first probe)

λmax⁡\lambda_{\max} 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 sks_k. Locked layers never move.

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.

Sequential QP from the start at 160 nm MgF₂, 200 nm Ta₂O₅: a few short moves into the nearest valley, near 97 nm MgF₂ and 249 nm Ta₂O₅.

Formula Note
model q(Δ)=12 ΔT(H+μ ∣diag⁡H∣) Δ+(JTr)TΔq(\Delta) = \tfrac12\, \Delta^T (H + \mu\,\lvert\operatorname{diag} H\rvert)\,\Delta + (J^T r)^T \Delta
box lok≤dk+Δk≤hik,\mathrm{lo}_k \le d_k + \Delta_k \le \mathrm{hi}_k,
∣Δk∣≤sk\lvert\Delta_k\rvert \le s_k
lo, hi\mathrm{lo},\ \mathrm{hi} 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; μ×10\mu \times 10 while the matrix is not positive definite, at most 12 times, then one DLS step
accept MF(d+Δ)<MF(d): μ←max⁡(0.3μ, 10−6);\mathrm{MF}(d + \Delta) < \mathrm{MF}(d):\ \mu \leftarrow \max(0.3\mu,\, 10^{-6}); otherwise μ←min⁡(10μ, 108)\mu \leftarrow \min(10\mu,\, 10^{8}) μ0=10−3\mu_0 = 10^{-3}
stop μ=108;\mu = 10^{8}; MF<10−7;\mathrm{MF} < 10^{-7}; Max iter (200)

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).

Damped Least Squares from the same start: the first step overshoots the valley floor, the next ones are shorter, and it stops near 97 nm MgF₂, 249 nm Ta₂O₅.

Formula Note
step [JλM]Δ=[−r0],\begin{bmatrix} J \\ \sqrt{\lambda M} \end{bmatrix} \Delta = \begin{bmatrix} -r \\ 0 \end{bmatrix},
M=diag⁡(JTJ)M = \operatorname{diag}(J^T J)
by QR the same Δ\Delta as (JTJ+λM) Δ=−JTr(J^T J + \lambda M)\,\Delta = -J^T r Δ\Delta scaled down so that no ∣Δk∣>sk\lvert\Delta_k\rvert > s_k
accept MF(d+Δ)<MF(d): λ←max⁡(λ/2, 10−8);\mathrm{MF}(d + \Delta) < \mathrm{MF}(d):\ \lambda \leftarrow \max(\lambda/2,\, 10^{-8}); otherwise λ←min⁡(5λ, 108)\lambda \leftarrow \min(5\lambda,\, 10^{8}) λ0=10−2\lambda_0 = 10^{-2}
stop λ=108;\lambda = 10^{8}; MF<10−7;\mathrm{MF} < 10^{-7}; after an accepted step, the actual and the predicted fall of ∑r2\sum r^2 both ≤ε\le \sqrt{\varepsilon} with the actual ≤2×\le 2 \times the predicted, or ∥M1/2Δ∥≤ε ∥M1/2d∥;\lVert M^{1/2}\Delta\rVert \le \sqrt{\varepsilon}\,\lVert M^{1/2} d\rVert; Max iter (500)

The predicted fall is 1−∥r+JΔ∥2/∥r∥21 - \lVert r + J\Delta\rVert^2 / \lVert r\rVert^2, and ε=2.2⋅10−16\varepsilon = 2.2 \cdot 10^{-16}: the stopping tests of MINPACK’s lmder.

Each step picks a direction from the slope and the previous direction, then takes the lowest merit it finds along that line.

Conjugate Gradient from the same start: two line searches reach the valley near 97 nm MgF₂, 249 nm Ta₂O₅.

Formula Note
direction β=max⁡ ⁣(0, gkT(gk−gk−1)gk−1Tgk−1),\beta = \max\!\left(0,\ \dfrac{g_k^T (g_k - g_{k-1})}{g_{k-1}^T g_{k-1}}\right), β=0\beta = 0 every nn steps (nn free layers, at least 2) pk=−gk+β pk−1,p_k = -g_k + \beta\, p_{k-1}, or −gk-g_k when gkTpk≥0g_k^T p_k \ge 0
search first α\alpha: where the first layer along pp has moved by its span sks_k, or 4×4 \times the last α\alpha if shorter; halve α\alpha until MF(P(d+αp))≤MF(d)+10−4 gT(P(d+αp)−d)\mathrm{MF}(P(d + \alpha p)) \le \mathrm{MF}(d) + 10^{-4}\, g^T (P(d + \alpha p) - d), go on halving while MF falls, keep the lowest; PP clamps to 1 nm
restart a failed search is tried again along −g-g with a fresh first α\alpha; after 12 steps in a row that each gain under 10−710^{-7} of MF, start again from the best point, at most 8 times
stop ∥g∥<10−9;\lVert g\rVert < 10^{-9}; 4 failed searches in a row; a plateau after a restart that gained under 10−7;10^{-7}; MF<10−7;\mathrm{MF} < 10^{-7}; 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.

Each step solves the Newton equations with the full second derivative of the merit, damped until the matrix is positive definite.

Newton from the same start: its first step reaches the 1 nm floor of MgF₂, then it follows the valley floor to 94 nm MgF₂, 121 nm Ta₂O₅.

Formula Note
step (H+μ ∣diag⁡H∣) Δ=−JTr(H + \mu\,\lvert\operatorname{diag} H\rvert)\,\Delta = -J^T r by Cholesky; μ×10\mu \times 10 until it factors, at most 12 times, then one DLS step; Δ\Delta scaled to the spans, the trial clamped to 1 nm
accept MF falls: μ←max⁡(0.3μ, 10−6);\mu \leftarrow \max(0.3\mu,\, 10^{-6}); otherwise μ←min⁡(10μ, 108)\mu \leftarrow \min(10\mu,\, 10^{8}) μ0=10−3\mu_0 = 10^{-3}
stop μ=108;\mu = 10^{8}; MF<10−7;\mathrm{MF} < 10^{-7}; Max iter (200)

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.

Newton-CG from the same start: three steps to the valley near 97 nm MgF₂, 249 nm Ta₂O₅.

Formula Note
model m(p)=gTp+12 pTHp,m(p) = g^T p + \tfrac12\, p^T H p,
∥p∥≤Δ;\lVert p\rVert \le \Delta;
Hv≈∇MF(d+εv)−∇MF(d)ε,Hv \approx \dfrac{\nabla\mathrm{MF}(d + \varepsilon v) - \nabla\mathrm{MF}(d)}{\varepsilon},
ε=1.5⋅10−8 (1+∥d∥∞)/∥v∥∞\varepsilon = 1.5 \cdot 10^{-8}\, (1 + \lVert d\rVert_\infty) / \lVert v\rVert_\infty
solve Steihaug CG, at most min⁡(n,25)\min(n, 25) iterations, to ∥residual∥≤min⁡(0.5,∥g∥) ∥g∥\lVert\text{residual}\rVert \le \min(0.5, \sqrt{\lVert g\rVert})\,\lVert g\rVert, the radius or negative curvature; pp scaled to the spans
ratio ρ=MF(d)−MF(d+s)−gTs−12 sTHs,\rho = \dfrac{\mathrm{MF}(d) - \mathrm{MF}(d + s)}{-g^T s - \tfrac12\, s^T H s}, ss the move after clamping to 1 nm
radius ρ<0.25: Δ←Δ/4;\rho < 0.25:\ \Delta \leftarrow \Delta/4; ρ>0.75\rho > 0.75 and ∥p∥>0.8Δ: Δ←min⁡(2Δ, 104 nm);\lVert p\rVert > 0.8\Delta:\ \Delta \leftarrow \min(2\Delta,\, 10^{4}\ \text{nm}); Δ0=max⁡(1, 0.1 (1+∥d∥∞)) nm\Delta_0 = \max(1,\, 0.1\,(1 + \lVert d\rVert_\infty))\ \text{nm}
accept ρ>0.1\rho > 0.1 and MF falls
stop 6 steps in a row rejected or with ∥g∥<10−10;\lVert g\rVert < 10^{-10}; MF<10−7;\mathrm{MF} < 10^{-7}; Max iter (200)

Each step minimizes a quadratic model of the merit within ±\pm 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.

Trust-region Newton from the same start: a few steps to the valley near 97 nm MgF₂, 249 nm Ta₂O₅.

Formula Note
model q(s)=gTs+12 sTHsq(s) = g^T s + \tfrac12\, s^T H s
1 nm≤dk+sk,1\ \text{nm} \le d_k + s_k,
∣sk∣≤Δ\lvert s_k\rvert \le \Delta
for F=12∥r∥2,F = \tfrac12 \lVert r\rVert^2, g=JTr;g = J^T r;
step the Cauchy point along the projected −g-g, then at most 2n+52n + 5 minor iterates: CG on the layers off a bound and a projected search with sufficient decrease 0.01
ratio ρ=F(d)−F(d+s)−q(s)\rho = \dfrac{F(d) - F(d + s)}{-q(s)}
radius ρ<0.25: Δ←Δ/4;\rho < 0.25:\ \Delta \leftarrow \Delta/4; ρ>0.75\rho > 0.75 with ss on the edge: Δ←min⁡(2Δ, 500 nm);\Delta \leftarrow \min(2\Delta,\, 500\ \text{nm}); Δ0=20 nm\Delta_0 = 20\ \text{nm}
accept ρ>10−4\rho > 10^{-4}
stop predicted fall <10−15F;< 10^{-15} F; F=0;F = 0; an accepted step whose actual and predicted fall are ≤10−10F;\le 10^{-10} F; a step or radius ≤10−10 (10−10+∥d∥∞);\le 10^{-10}\,(10^{-10} + \lVert d\rVert_\infty); MF down by under 0.01 % over the last 6 steps; Max iter (200)

Runs Damped Least Squares from NN copies of the start, each with every free thickness scaled at random, and keeps the lowest merit.

DLS multi-start: twenty restarts from perturbed copies of the start end in several valleys; the best ends near 94 nm MgF₂, 121 nm Ta₂O₅.

Formula Note
start jj dk,j=max⁡(1 nm, dk(1+f(2u−1))),d_{k,j} = \max(1\ \text{nm},\ d_k (1 + f (2u - 1))),
f=Perturb ±%/100,f = \text{Perturb } {\pm}\text{\%} / 100,
j=1…Nj = 1 \ldots N
uu uniform in [0,1)[0, 1) from restart jj’s own stream of the Seed, (N=Restarts;N = \text{Restarts}; 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

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.

Differential Evolution: ten designs spread around the start and gather in the valley near 94 nm MgF₂, 121 nm Ta₂O₅.

Formula Note
population NP=max⁡(10,5n);\mathrm{NP} = \max(10, 5n); member 1 is the start, the others dk(1+0.5(2u−1)),d_k (1 + 0.5 (2u - 1)), at least 1 nm
mutation v=xr1+F(xr2−xr3),v = x_{r_1} + F (x_{r_2} - x_{r_3}), r1,r2,r3r_1, r_2, r_3 distinct and ≠i,\ne i, F=0.7F = 0.7
crossover trialk=vk\text{trial}_k = v_k when u<CRu < \mathrm{CR} or k=krand,k = k_\text{rand}, otherwise xi,k;x_{i,k}; CR=0.9;\mathrm{CR} = 0.9; clamped to 1 nm
selection the trial replaces xix_i when MF(trial)≤MF(xi);\mathrm{MF}(\text{trial}) \le \mathrm{MF}(x_i); a generation’s trials all come from the old population
stop no new best in 60 generations; MF<10−7;\mathrm{MF} < 10^{-7}; 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.

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).

Simulated Annealing: the walk crosses several valleys while the temperature is high, then settles near 94 nm MgF₂, 121 nm Ta₂O₅.

Formula Note
move dk′=dk+max⁡(1 nm, fdk)⋅N(0,1),d'_k = d_k + \max(1\ \text{nm},\ f d_k) \cdot N(0, 1),
f=max⁡(0.01, 0.15 T/T0);f = \max(0.01,\ 0.15\, T / T_0);
clamped to 1 nm
accept ΔMF≤0,\Delta\mathrm{MF} \le 0, or u<exp⁡(−ΔMF/T)u < \exp(-\Delta\mathrm{MF} / T)
sweep max⁡(8,2n)\max(8, 2n) moves, then T←0.95 TT \leftarrow 0.95\,T
T0T_0 the mean ΔMF\Delta\mathrm{MF} of the uphill moves among 20 trial moves from the start (f=0.15f = 0.15), divided by −ln⁡0.8-\ln 0.8
stop T<10−7;T < 10^{-7}; no new best in 100 sweeps; MF<10−7;\mathrm{MF} < 10^{-7}; Max iter (400)

The result is the lowest design met on the way, not the last one.

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.

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.
One method for most designs? → SQP (the default)
No min-thickness, want the classic? → DLS
Decent 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 Newton
Bad / unknown start, multimodal? → DE (or SA on a rugged surface)
Too few layers for the target? → Synthesis: Needle → GE → Structural
Not sure? → Try all, keep best

A 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.

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.
  • dMin 1 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.
  • 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.