compute_opt_params_direct_to_permittivity_jacobian#

CombinedParametrization.compute_opt_params_direct_to_permittivity_jacobian(fdtd_session: FdtdSession, use_jac: bool, params: ndarray, index_monitor_name: str = 'optimization_index', dft_mon_name: str = 'optimization_dft', polygon_name: str | None = None) tuple[dict[str, dict[str, dict[str, ndarray]]], ndarray, float]#

Compute d_eps/dp, the (sparse) Jacobian of the permittivity wrt optimization parameters (‘p’). Uses the DEpsCalculator to compute the sparse Jacobian.

Parameters:
fdtd_sessionFdtdSession,

The FDTD session within which to compute the Jacobian.

use_jacbool

Whether to use the autograd-computed Jacobian dP/dp to determine which geometric parameters are affected by the perturbation of each optimizaton parameter(default: True).

paramsnp.ndarray

Optimization parameter values at which to compute the Jacobian.

index_monitor_namestr, optional

Name of the index monitor in the FDTD simulation (default: ‘optimization_index’).

dft_mon_namestr, optional

Name of the DFT monitor in the FDTD simulation (default: ‘optimization_dft’).

polygon_namestr, optional

Override for the FDTD CAD polygon name used when grabbing the bounding box for ClosedCurve perturbations. When None (default), falls back to the polygon name in self.structure.

Returns:
d_eps_dp_dictdict[str, dict[str, dict[str, np.ndarray]]]

Nested dictionary. Top-level keys are 'object_name::property_name' strings. Each value is a dict with keys 'eps_x', 'eps_y', 'eps_z', where each entry is a dict with 'data', 'indices', and 'indptr' arrays representing the sparse dEps/dp.

global_shapenp.ndarray

Shape (4,) array [Nx, Ny, Nz, Nlambda] of the full (un-cropped) index monitor.

wl_metresnp.ndarray

1D array of the wavelength in meters corresponding to the index monitor.