lumopt2#

The Lumerical photonic inverse design module lumopt2 provides a framework for the inverse design of photonic devices using Ansys Lumerical FDTD™. The following pages contains API documentation for the lumopt2 module.

Note

lumopt2 is only available in Ansys Lumerical FDTD™ version 2026 R1.2 and later.

Common lumopt2 API#

These classes are commonly used in the lumopt2 workflow, and you can directly initialize them from the top-level lumopt2 module.

Classes and functions for setting up the optimization project.

Classes

Optimization

Coordinates the optimization workflow for photonic inverse design.

OptimizationResult

Immutable result object returned from an optimization run.

Project

Main project class that coordinates parametrization, FOM, and solver.

ProjectConfig

A class used to modify the base simulation in the Project.

FdtdSession

A class to manage the FDTD simulation session.

SimulationStatus

FDTD simulation status codes.

SimulationError

Exception raised when a simulation fails.

Classes and functions for handling simulation results and figures of merit.

Classes

PortResults

Container for port monitor simulation results.

FieldResults

Container for field monitor simulation results.

Functions

Fom

Factory function that returns either a FieldFom or PortFom instance.

PNorm

Create a p-norm based figure of merit function.

Classes and functions for parametrizing the simulation geometry.

Classes

Parametrization

Parametrized geometry using a user-defined function to map parameters.

ClosedCurve

A Beziergon - a polygon where edges can be linear or cubic Bezier curves.

ClosedCurveLinearSegment

A linear segment connecting two vertices

ClosedCurveCubicSegment

A cubic Bezier curve segment.

CombinedParametrization

Combine multiple parametrizations into a single parametrization.

Segment

Specification for a segment in Composite Bezier path.gy.

EqualSplit

Specification for splitting a segment into a parametric segment

Parametrize

Specification for making a segment parametric

ParamVertex

Specification for a parametric vertex adjustment.

Box

A 3D rectangular box defined by spans and centers or min/max coordinates.

Classes and functions for setting tools to calculate the gradient.

Classes

ScipyOptimizer

Wrapper for scipy.optimize.minimize optimizers, particularly L-BFGS-B.

ParameterScaler

Scales parameters between physical and normalized spaces.

Functions

validate_bounds

Validate parameter bounds and return lower/upper arrays.

extract_fom

Extract FOM value from objective function result.

extract_fom_and_gradient

Extract FOM and gradient from objective function result.

finite_difference_gradient

Compute the gradient of the figure of merit using finite difference.

validate_gradient

Validate the adjoint gradient by comparing it to a finite difference gradient for specified parameter indices.

fd_sweep_perturbation

Finite difference convergence test: compute the finite difference gradient for a range of perturbation values and plot the results.

Classes and functions for managing computational resources to run optimization.

Classes

LocalRunner

Class to manage simulation jobs locally.

Job

Class representing a single job.

Classes and functions for visualizing optimization results.

Classes

BaseCallback

Base class for optimization callbacks.

CallbackList

Container for managing multiple callbacks.

FileLogger

Record the numerical history of one optimization run to a text file.

GraphicalVisualizer

Callback that visualizes optimization progress with live matplotlib plots.

Panel

Abstract base class for a single subplot in a GraphicalVisualizer.

PanelState

Immutable per-update snapshot handed to every panel's update call.

FomPanel

Live plot of the figure of merit vs.

GeometryPanel

Live plot of the current geometry on top of the initial baseline.

GradientNormPanel

Live plot of the gradient L2 norm vs.

MonitorPanel

Live plot of an FDTD monitor result (field component, S-parameter, ...).

Classes and functions for logging, profiling, and other utilities.

Classes

Profiler

Aggregate wall-clock time per named category.

Functions

setup_default_logging

Configure the lumopt2 logger with sensible defaults.

All lumopt2 modules#

lumopt2.core

Modules for project configuration, optimization configuration, and FDTD session management.

lumopt2.core
lumopt2.fom

Modules to capture simulation results and define figures of merit from them for optimization.

lumopt2.fom
lumopt2.parametrization

Modules to parametrize the simulation.

lumopt2.parametrization
lumopt2.optimizer

Modules to set up and perform the optimization algorithm.

lumopt2.optimizer
lumopt2.utils

Utility modules.

lumopt2.utils