tv_apply_derivatives#

t3toolbox.backend.sampling_derivatives.tv_apply_derivatives(ww, pp, variation, frame, order)#
def tv_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,)
        variation:  typ.Tuple[
            typ.Sequence[NDArray],          # var_tucker_cores dU. len=d, elm_shape=K+C+(nOi,Ni)
            typ.Sequence[NDArray],          # var_tt_cores     dG. len=d, elm_shape=K+C+(rLi,nUi,rRi)
        ],                                  # = T3Variations.data
        frame:       typ.Tuple[
            typ.Sequence[NDArray],          # up_tucker_cores  U. len=d
            typ.Sequence[NDArray],          # down_tt_cores    O. len=d
            typ.Sequence[NDArray],          # left_tt_cores    P. len=d
            typ.Sequence[NDArray],          # right_tt_cores   Q. len=d
        ],                                  # = T3Frame.data = (up, down, left, right) = (U, O, P, Q)
        order:      int,                    # highest derivative order
) -> NDArray:                               # apply-derivative jets, shape=(order+1,)+W+K+C

Symmetric derivatives of applying a tangent vector in all modes, in one repeated direction.

The all-modes Riemannian analog of tv_probe_derivatives() (and the derivative analog of apply.tv_apply()): returns y^(t) = d^t/ds^t [apply(v, W + s P)]|_0 for t=0..order, where v is the tangent vector (frame, variation). A single left-to-right pass (frame mu via P, perturbation sigma via Q) to the terminal carry, bond summed. Stacks order + W + K + C (sample stack W, tangent stack K, frame stack C). Verified against dense_apply_derivatives() on the densified tangent.

See also

t3_apply_derivatives, tv_probe_derivatives, apply.tv_apply

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

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

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

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

  • order (int)

Return type:

NDArray