compute_opt_params_direct_to_permittivity_jacobian#
- Parametrization.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).
- params
np.ndarray Optimization parameter values at which to compute the Jacobian.
- index_monitor_name
str,optional Name of the index monitor in the FDTD simulation (default: ‘optimization_index’).
- dft_mon_name
str,optional Name of the DFT monitor in the FDTD simulation (default: ‘optimization_dft’).
- polygon_name
str,optional Override for the FDTD CAD polygon name used when grabbing the bounding box for
ClosedCurveperturbations. WhenNone(default), falls back to the polygon name inself.structure.
- Returns:
- d_eps_dp_dict
dict[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_shape
np.ndarray Shape
(4,)array[Nx, Ny, Nz, Nlambda]of the full (un-cropped) index monitor.- wl_metres
np.ndarray 1D array of the wavelength in meters corresponding to the index monitor.
- d_eps_dp_dict