check_perturbation_index ======================== .. py:function:: t3toolbox.backend.sampling_derivatives.check_perturbation_index(index, pp, shape = None) .. code-block:: python def check_perturbation_index( index: NDArray, # grid points, int, shape=(d,)+W pp: typ.Sequence[NDArray], # perturbation P, len=d, elm_shape=W+(Ni,) shape: typ.Optional[typ.Sequence[int]] # ambient mode dims (Ni), len=d -- if given, also check P's mode dim = None, ) -> None: Structural check (hard error): the perturbation ``P`` shares the sample stack ``W`` of the grid points ``index`` (shape ``(d,)+W``), and -- when ``shape`` is given (the ambient mode dims ``Ni``, which the integer ``index`` does not carry) -- ``P``'s mode dim matches it. Used by the derivative-entries frontends; jit-safe.