t3_probe_derivatives#

t3toolbox.backend.sampling_derivatives.t3_probe_derivatives(ww, pp, x, order)#
def t3_probe_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 K
) -> typ.Tuple[NDArray, ...]:           # z_jets. len=d, elm_shape=(order+1,)+W+C+(Ni,)

Symmetric derivatives of probing a Tucker tensor train, in one repeated direction.

Returns, for each mode i, the stack y_i^(t) = d^t/ds^t y_i(X + s P)|_0 for t=0..K, where y_i is the i-th probing action. Index 0 is the ordinary probe t3_probe.

Two independent stacks ride through, base-inner as in plain probing: a sample stack W on the input vectors (each sample a paired (X, P) – repeat a point across W to sweep many directions at it) and a frame/core stack C on the cores (a batch of T3s probed by the same samples). Outputs are order + W + C + (Ni,) (W outer, C inner); either may be empty. (A plain T3 has no tangent stack K; the Riemannian forwards carry order + W + K + C.)

The symmetric-derivative formulation is not in the published T4S paper; the recursions are verified against dense_probe_derivatives(). (Project write-up in preparation.)

Parameters:
  • ww (typ.Sequence[NDArray]) – probe vectors X. len=d, elm_shape=W+(Ni,)

  • pp (typ.Sequence[NDArray]) – perturbation direction P (the same P fed into every derivative slot). len=d, elm_shape=W+(Ni,)

  • x (t3.TuckerTensorTrain.data) – Tucker tensor train, as a (tucker_cores, tt_cores) data tuple.

  • order (int) – highest derivative order K.

Returns:

Probe-derivative jets, z_jets. len=d, elm_shape=(order+1,)+W+C+(Ni,). z_jets[i][t] is y_i^(t).

Return type:

typ.Tuple[NDArray,…]