T3Tangent#
- class t3toolbox.manifold.T3Tangent#
Tangent vector to the manifold of fixed-rank Tucker tensor trains.
A
T3Tangentbundles aT3Frame(the frame at the base point where the tangent space is attached) with aT3Variations(the tangent direction in that frame). Bundling them makes “which tangent space” a checkable property: linear algebra between two tangent vectors is only defined when they live in the same tangent space, which here means they hold the sameT3Frameobject (identity, not merely numerically-equal cores).The metric lives on the geometry, not here:
ManifoldGeometry.inner()/normare the Hilbert-Schmidt inner product / norm (which check the orthogonal-frame + gauged preconditions in safe mode), andCorewiseGeometry.inner()/normare the Euclidean ones. This class exposes only the raw coordinatecorewise_inner()/corewise_norm()(equal to HS only on an orthonormal, gauged, minimal-rank frame – seeis_orthogonal()/is_gauged()and the contract catalog), with no HS claim.A tangent vector is the sum of 2d single-core variation terms – equation (47), Appendix A.3, of Alger, Christierson, Chen & Ghattas (2026), “Tucker Tensor Train Taylor Series” (arXiv:2603.21141).
Examples
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> import t3toolbox.frame_variations_format as bvf >>> import t3toolbox.manifold as t3m >>> x = t3.TuckerTensorTrain.randn((10, 11, 12), (3, 4, 3), (1, 2, 2, 1)) >>> frame, variations = bvf.t3_orthogonal_representations(x) >>> v = t3m.T3Tangent(frame, variations) >>> print(v.shape, v.stack_shape) (10, 11, 12) () >>> print(v.is_orthogonal()) # frame from t3_orthogonal_representations is orthogonal True >>> print(v.is_gauged()) # ...but those variations are not gauged False >>> w = 2.0 * v - v # linear algebra stays in the same tangent space >>> print(np.linalg.norm(w.to_dense() - v.to_dense())) # (2v - v) == v 0.0
- variations: T3Variations#
- __rmul__#
Methods#
|
Validate this tangent: both components well-formed and a compatible (frame, variations) pair. |
|
|
|
|
|
|
Frame stack |
|
Tangent stack |
|
Full stack |
|
|
|
|
Copy with frame and variation cores converted to jax arrays. |
|
Copy with frame and variation cores converted to numpy arrays. |
|
Deep copy (copies the frame and variation cores). |
True if any frame or variation core is a jax array. |
|
|
Number of elements of the represented dense tangent vector ( |
Number of stored core entries (size on disk): frame + variations. |
|
|
Form the dense tensor represented by this tangent vector. |
|
Doubled-rank |
Flatten this tangent's variation degrees of freedom to a 1D vector (the frame is the fixed |
|
|
Inverse of |
|
Save the frame + variation cores to a |
|
Load a tangent saved by |
|
Reverse the mode order of this tangent (reverses both the frame and the variations). |
|
Sum over the tangent stack |
|
Zero tangent vector at a given frame (numpy/jax matching the frame). |
|
Canonical unit tangent at |
|
Zero tangent at |
|
Add tangent vectors. Requires both to share the same T3Frame object. |
|
Subtract tangent vectors. Requires both to share the same T3Frame object. |
|
Scale a tangent vector by a scalar. |
|
|
|
The raw corewise (coordinate) dot of two tangents' variations -- not the HS inner product. |
The raw corewise (coordinate) norm of the variations -- not the HS norm. |
|
|
Absorb the metric |
|
The weighted (Grasedyck-Kramer) coordinate norm: absorb the metric |
|
The weighted coordinate inner product |
Unit-norm rescaling |
|
|
|
Structural minimal ranks of this tangent's base point. See |
|
Dimension of the tangent space at this base point (= the fixed-rank manifold dimension). |
|
True if this tangent's frame has structurally minimal ranks. See |
|
|
True (per frame-stack element) if this tangent's frame is numerically minimal. See |
|
True (per frame-stack element) if this tangent's frame is orthogonal. See |
Max absolute gauge-condition violation, per stack element (shape = variation stack |
|
|
True (per stack element) if the variations are gauged with respect to the frame. |
|
Probe this tangent vector: apply the single-sample least-squares Jacobian J^(s). |
|
Apply the transpose |
|
Apply this tangent vector in all modes: contract the dense tangent with |
|
Extract entries of the dense tangent at |
|
Apply the transpose |
|
Apply the transpose |
|
Symmetric directional derivatives of probing this tangent vector, in one repeated direction. |
|
Symmetric directional derivatives of applying this tangent vector in all modes. |
|
Symmetric directional derivatives of this tangent's entries at |
|
Transpose |
|
Transpose of |
|
Transpose of |
Unstack over the tangent stack |
|
Unstack over the frame stack |
|
|
Stack a |
|
Stack a |