t3_apply_derivatives#

t3toolbox.backend.sampling_derivatives.t3_apply_derivatives(ww, pp, x, order)#
def t3_apply_derivatives(
        ww:     typ.Sequence[NDArray],  # probe vectors X,        len=d, elm_shape=W+(Ni,)
        pp:     typ.Sequence[NDArray],  # perturbation vectors P, len=d, elm_shape=W+(Ni,)
        x:      typ.Tuple[
            typ.Sequence[NDArray],      # tucker_cores. len=d, elm_shape=C+(nUi,Ni)
            typ.Sequence[NDArray],      # tt_cores.     len=d, elm_shape=C+(rLi,nUi,rR(i+1))
        ],                              # = TuckerTensorTrain.data
        order:  int,                    # highest derivative order
) -> NDArray:                           # apply-derivative jets, shape=(order+1,)+W+C

Symmetric derivatives of applying a Tucker tensor train in all modes, in one repeated direction.

The all-modes Euclidean analog of t3_probe_derivatives(): returns the stack y^(t) = d^t/ds^t apply(X, W + s P)|_0 for t=0..order, where apply contracts the tensor with the vectors in every mode (a scalar). Index 0 is the ordinary apply. Computed as the terminal carry of the left mu-jet sweep (via the cores), bond summed – no right/central sweeps. Stacks ride as order + W + C (sample stack W, frame stack C; no tangent stack here). Verified against dense_apply_derivatives().

Parameters:
  • ww (t3toolbox.backend.common.typ.Sequence[NDArray])

  • pp (t3toolbox.backend.common.typ.Sequence[NDArray])

  • x (t3toolbox.backend.common.typ.Tuple[t3toolbox.backend.common.typ.Sequence[NDArray], t3toolbox.backend.common.typ.Sequence[NDArray]])

  • order (int)

Return type:

NDArray