calculate_dF_dPi#
- static DEpsCalculator.calculate_dF_dPi(d_eps_data: dict[str, dict[str, dict[str, ndarray]]], dF_deps: ndarray, global_shape: ndarray) tuple[ndarray, tuple[str]]#
Contract dF/dEps (dense) with dEps/dPi (sparse) to get dF/dPi.
- Parameters:
- d_eps_data
dict Nested dictionary containing the sparse representation of dEps/dPi for each geometric parameter Pi.
Top layer: keys are geometric parameter names (str).
Second layer: keys are
'eps_x','eps_y','eps_z'.Third layer: keys are
'data','indices','indptr'representing the sparse matrix dEps in CSC format.
The dense form would be a 4D ndarray of shape
(Nx, Ny, Nz, Nlambda).- dF_deps
np.ndarray Array containing dF/dEps values. Must be 5-dimensional with shape
(Nx, Ny, Nz, Nlambda, 3), where the last dimension holds the vector components of the field.- global_shape
np.ndarray Shape
(4,)array[Nx, Ny, Nz, Nlambda]associated withd_eps_data.
- d_eps_data
- Returns:
- dF_dPi
np.ndarray 1D array of length
len(d_eps_data)containing dF/dPi values.- geom_names
tuple[str] Geometric parameter names corresponding to each entry in
dF_dPi.
- dF_dPi
- Raises:
ValueErrorIf
dF_depsis not 5-dimensional.ValueErrorIf
global_shapeis not length 4 or does not matchdF_deps.shape[:-1].