DEpsCalculator#

class lumopt2.parametrization.d_eps_calculator.DEpsCalculator(fdtd_session: FdtdSession, parametrization: BaseParametrization, directly_on_params: bool = False, use_jac: bool = True, index_monitor_name: str = 'optimization_index', dft_mon_name: str = 'optimization_dft')#

Compute dEps/dP for a parametric geometry via finite differences.

This class encapsulates the Lumerical-coupled logic for perturbing geometric parameters and reading back the resulting permittivity change through an index monitor.

Parameters:
fdtd_sessionFdtdSession

The FDTD session used for simulations.

parametrizationBaseParametrization

The lumopt2 BaseParametrization defining the geometry.

directly_on_paramsbool, optional

If True, compute dEps/dp directly on the optimization parameters ‘p’, rather than on the underlying geometric properties P (i.e., dEps/dP) and then multiplying by the Jacobian dP/dp to obtain dEps/dp. This flag is ignored for ClosedCurve objects, where dEps/dp is always computed directly on the optimization parameters.

use_jacbool, optional

If True, use autograd to obtain the Jacobian dP/dp of the geometric parameters with respect to the optimization parameters. This flag is ignored if directly_on_params is set to False, where the Jacobian is ALWAYS calculated. The results of the Jacobian are used to determine which geometric object(s) are affected by each optimization parameter in the directly_on_params=True case. If False, or when we have a closed_curve parametrization, we assume that each optimization parameter affects ALL the geometric objects in the optimization region; this may have the effect of severely slowing down the d_eps calculation. Default is True.

index_monitor_namestr, optional

Name of the index monitor in the simulation. Default is 'optimization_index'.

dft_mon_namestr, optional

Name of the DFT monitor whose spatial extent defines the region of interest. Default is 'optimization_dft'.

Attributes:
fdtd_sessionFdtdSession

The FDTD session.

parametrizationParametrization

The parametrization object.

directly_on_paramsbool

If True, calculate dEps/dp directly on the optimization parameters ‘p’.

use_jacbool

If True, use autograd to calculate the Jacobian dP/dp of the geometric parameters P with respect to the optimization parameters p.

index_monitor_namestr

Name of the index monitor.

dft_mon_namestr

Name of the DFT monitor.

Methods

DEpsCalculator.calculate_dF_dPi(d_eps_data, ...)

Contract dF/dEps (dense) with dEps/dPi (sparse) to get dF/dPi.

DEpsCalculator.compute(params[, dp, ...])

Compute the sparse Jacobian dEps/dP using central differences.

DEpsCalculator.grab_epsilon_material(...)

Grab wavelength-dependent permittivity data for a material in the FDTD.

DEpsCalculator.remap_wavelengths(...)

Remap single-wavelength dEps/dP to multiple wavelengths.