Algorithms

FilmOptima combines optimization strategies for thin-film design across refinement, synthesis, and global optimization workflows.

Refinement

AdamW

The AdamW method is a refinement algorithm widely used in deep learning and optimization problems. Unlike synthesis methods, which construct new layer structures, AdamW focuses on adjusting the thicknesses of existing layers to improve optical performance.

AdamW (Adaptive Moment Estimation with decoupled weight decay) builds on the Adam optimizer by separating the weight decay term from the gradient-based update. This decoupling improves stability and generalization.

The algorithm combines momentum-based updates with adaptive learning rates for each parameter, while applying weight decay independently as a form of regularization. In thin-film design, this helps prevent physically unrealistic or overly extreme thickness values while still allowing efficient exploration of complex interference effects between layers.

During optimization, AdamW iteratively updates layer thicknesses using both the current gradient (how the optical merit function changes with respect to thickness changes) and the accumulated history of past gradients. This leads to faster and more stable convergence compared to standard gradient descent, particularly in rugged or ill-conditioned design spaces.

The process continues until convergence criteria are met, such as minimal improvement in the objective function or reaching a maximum number of iterations.

Advantages

  • Efficient Refinement: Improves existing designs effectively.
  • Adaptive Learning Rates: Stabilize convergence and accelerate progress.
  • Scale Robustness: Less sensitive to poor initial parameter scaling than plain gradient descent.
  • Seamless Integration: Works naturally with synthesis methods (e.g., Needle, AnyNeedle) in nested workflows.

Limitations

  • Hyperparameter Sensitivity: Depends on well-chosen learning rate, patience, and max epochs.
  • Local Minima Risk: Can converge to suboptimal solutions in complex merit landscapes.
  • Speed–Stability Trade-off: Requires careful balance between fast updates and stable training.

In FilmOptima

In FilmOptima, AdamW belongs to the Refinement category of algorithms. It is the primary refinement algorithm and a cornerstone of FilmOptima’s nested optimization strategy.

Parameters

ParameterDescription
LearningRateControls the step size in the AdamW optimizer during refinement. Higher values make updates faster but risk overshooting, while lower values are more stable but slower to converge.
PatienceDefines how many iterations the AdamW optimizer will continue without improvement in the merit function before halving the learning rate.
MaxEpochSets the maximum number of training cycles for the AdamW optimizer in each refinement step. Acts as a hard limit to keep optimization runs bounded.
DecayRegularization technique that prevents thicknesses from growing too large by gradually penalizing them. A typical value of 0.1 (1/nm) guides the optimizer towards more matieral-efficient (in terms of overall thickness) designs.

ClusterRefinementProprietary

The ClusterRefinement method is a refinement algorithm, proprietary to FilmOptima. It improves an existing stack by systematically exploring joint variations of multiple layers ("clusters") and polishing the best candidates with a local optimizer.

The key idea is a two-stage enumeration:

First, the algorithm generates all possible combinations of up to #LayersToCluster layer indices from the current stack.

For each index combination, the algorithm enumerates all possible permutations of thickness candidates, using discretized thickness values.

Once the "clustered" candidate stacks are generated, they are refined using AdamW.

By jointly perturbing clusters of layers instead of adjusting them individually, ClusterRefinement can escape shallow local minima while still keeping the total number of layers fixed.

Advantages

  • Joint layer optimization: Captures multi-layer interactions by modifying clusters instead of single layers.
  • Systematic enumeration: Guarantees coverage of all index combinations and discretized thickness assignments.
  • Precise local improvement: Nested AdamW ensures each candidate is fully refined.
  • No topology change: Layer count stays fixed, ideal when design structure is constrained.
  • Highly Parallelizable: Candidate stacks can be evaluated independently.

Limitations

  • Combinatorial growth: Number of candidates rises quickly with number of thickness values and the number of layers to cluster.
  • Runtime cost: Full enumeration can be computationally expensive.
  • Local scope: Broader than single-layer refinement but still not a global optimization method.

In FilmOptima

In FilmOptima, ClusterRefinement belongs to the Refinement category of algorithms.

Parameters

ParameterDescription
↓ ThicknessThe lower bound for candidate layer thicknesses.
↑ ThicknessThe upper bound for candidate layer thicknesses.
# ThicknessesNumber of equally spaced candidate thickness values between the lower and upper bounds.
# LayerToClusterSpecifies the number of layers to group together for joint optimization.
AdamW ParametersSee AdamW.

Synthesis

Needle

The Needle method is a synthesis algorithm widely used in thin-film design. Its core idea is simple: instead of starting with a complex multilayer structure, the algorithm begins with a minimal design (e.g. 1-layer) and gradually inserts zero thickness "needle" layers at positions where they most improve the optical performance.

Each insertion is tested by evaluating how a small change in thickness at a specific depth influences the merit function. The most effective position is chosen, and the "needle" is then expanded into a real layer. After every insertion, a local refinement algorithm (FilmOptima uses AdamW) adjusts all existing layer thicknesses to further improve the design.

This iterative process continues until no improvements can be achieved.

Advantages

  • Systematic Construction: Does not require a strong initial guess.
  • Rapid Convergence: Computationally efficient, enabling quick progress toward target requirements.

Limitations

  • Enumeration Cost: Computationally expensive when many insertion points are evaluated.
  • Thin-Layer Risk: Often produces very thin layers that require filtering via minimum-thickness constraints.
  • Initial-Design Sensitivity: Performance can depend heavily on the starting design

In FilmOptima

In FilmOptima, the needle method belongs to the Synthesis category of algorithms.

Parameters

ParameterDescription
# InsertionsSpecifies how many equally spaced needle insertions are attempted across the stack. The exact insertion positions are determined using interpolation.
AdamW Parameterssee AdamW.

AnyNeedleProprietary

The AnyNeedle method is a synthesis algorithm, proprietary to FilmOptima. It extends the widely known Needle method. While the classical Needle method only inserts zero-thickness layers into the stack, the AnyNeedle approach also evaluates layers with finite thicknesses, making it more flexible and often more efficient.

For each candidate insertion (depth, thickness), the new stack is refined using AdamW. The best-improving candidate is accepted.

This iterative process continues until no further improvements can be achieved.

Advantages

  • Systematic Construction: Does not require a strong initial guess.
  • Layer Efficiency: Often achieves high performance with fewer layers than the Needle method.
  • Practical Thicknesses: Less prone to generating extremely thin (impractical) layers than the Needle method.
  • Robust to Initial Design: Performance is less sensitive to the initial design than the Needle method.
  • Highly Parallelizable: Candidate stacks can be evaluated independently.

Limitations

  • Combinatorial Cost: Computationally expensive when many insertion points and thickness values are evaluated.
  • Thin-Layer Risk: May still produce very thin layers that require filtering via minimum-thickness constraints.

In FilmOptima

In FilmOptima, the AnyNeedle method belongs to the Synthesis category of algorithms.

Parameters

ParameterDescription
↓ ThicknessThe lower bound for candidate layer thicknesses.
↑ ThicknessThe upper bound for candidate layer thicknesses.
# ThicknessesNumber of equally spaced candidate thickness values between the lower and upper bounds.
# InsertionsSpecifies how many equally spaced needle insertions are attempted across the stack. The exact insertion positions are determined using interpolation.
AdamW ParametersSee AdamW.

Global Optimization

BranchAndBound

The Branch and Bound (BnB) method is a global optimization algorithm that systematically explores the search space by dividing it into smaller subproblems ("branching") and eliminating those that cannot yield a better solution than the current best ("bounding"). In thin-film design, this translates to partitioning ranges of layer thicknesses and discarding subranges that provably cannot improve the merit function.

BnB proceeds by evaluating bounds on each subrange. If a subrange’s best possible (bounded) merit is worse than the current incumbent design, that branch is pruned. The search then focuses on the remaining promising subranges.

This process balances thoroughness with efficiency and, when run to completion under valid bounds and termination criteria, can deliver mathematical guarantees of global optimality (often up to a specified tolerance).

Advantages

  • Global guarantees: Can find the global optimum (or certify optimality within a tolerance) when run to completion under correct bounds.
  • Systematic search: Transparent exploration with principled pruning.
  • Efficient pruning: Eliminates large unpromising regions early.

Limitations

  • Computational cost: Can be expensive for large stacks or wide thickness ranges (curse of dimensionality).
  • Quality of bounds: Effectiveness depends on tight bounding strategies; weak bounds reduce pruning efficiency.
  • Practical runtime: May require carefully chosen ranges/tolerances to finish in a reasonable time. Importantly, the runtime cannot be determined in advance, as it depends on how much of the search space can be pruned during execution.

In FilmOptima

In FilmOptima, Branch and Bound belongs to the Global Optimization category of algorithms.

Parameters

ParameterDescription
↓ ThicknessDefines the lower bound for candidate layer thicknesses considered during the search.
↑ ThicknessDefines the upper bound for candidate layer thicknesses considered during the search.
ToleranceSets the precision threshold for the global search. The algorithm stops branching once the difference between the current best solution and the best possible bound is below this value, ensuring global optimality within the specified tolerance.

ParticleSwarmOptimization

The Particle Swarm Optimization (PSO) method is a global optimization algorithm inspired by the collective behavior of swarms in nature (e.g., flocks of birds, schools of fish). Unlike local refinement algorithms, PSO explores the search space broadly, making it well suited for discovering high-quality solutions in complex optimization landscapes.

In PSO, each particle represents a candidate thin-film design. Particles "fly" through the search space by updating their positions based on two factors: their own best-known solution and the best-known solution of the swarm. Over time, the swarm converges towards promising regions of the search space.

Since PSO generates candidate designs with arbitrary thicknesses, FilmOptima combines it with nested refinement using AdamW.

Advantages

  • Global Exploration: Escapes local minima via swarm-based search.
  • Nonlinearity Ready: Handles highly non-linear or discontinuous merit landscapes effectively.
  • Highly Parallelizable: Particles can be evaluated independently.
  • Refinement Synergy: Integrates naturally with local refinement for fine-tuning.

Limitations

  • Compute Intensive: More expensive than local methods (many particles × many simulations).
  • Parameter Sensitivity: Requires careful tuning of swarm parameters to balance exploration and convergence.
  • Premature Convergence Risk: Can collapse early if swarm diversity diminishes.
  • No global guarantees: No mathmatical guarantees regarding global optimality.

In FilmOptima

In FilmOptima, PSO belongs to the Global Optimization category of algorithms.

Parameters

ParameterDescription
↓ ThicknessThe lower bound for candidate layer thicknesses.
↑ ThicknessThe upper bound for candidate layer thicknesses.
c1Cognitive coefficient – weight given to a particle’s own best-known position.
c2Social coefficient – weight given to the swarm’s best-known position.
wInertia weight – controls the balance between exploration (high w) and exploitation (low w).
# ParticlesNumber of particles (candidate designs) in the swarm.
# IterationsNumber of swarm update steps (iterations) performed during the optimization.
AdamW ParametersSee AdamW.

Stochastic

The Stochastic Optimization method is a global optimization algorithm that explores the design space by generating random candidate solutions within specified bounds. Unlike deterministic methods such as Branch and Bound or Exhaustive Search, it relies on probability and repeated sampling to discover high-performing designs.

Each run begins by randomly assigning layer thicknesses between the defined lower and upper limits. These candidate designs are then refined using AdamW.

Repeating this process across many independent runs increases the likelihood of finding a near-global optimum, even in highly complex design landscapes.

Advantages

  • Broad exploration: Random sampling helps escape local minima.
  • Simplicity: Easy to configure and extend with more runs.
  • Effective with refinement: Nested AdamW ensures each random candidate is optimized locally.
  • Scalable: More runs increase the chance of finding high-quality solutions.

Limitations

  • No global guarantees: Results depend on the number of runs and randomness.
  • Potentially high computational cost: More runs and larger stacks increase runtime.
  • Reproducibility: Different random seeds may lead to different outcomes.

In FilmOptima

In FilmOptima, Stochastic Optimization belongs to the Global Optimization category of algorithms.

Parameters

ParameterDescription
↓ ThicknessThe lower bound for candidate layer thicknesses.
↑ ThicknessThe upper bound for candidate layer thicknesses.
# RunsNumber of independent random initializations to perform. Higher values improve reliability but increase runtime.
AdamW ParametersSee AdamW.