The frame-variations representation (and why the cores are numbered as they are)#
A tangent vector to the fixed-rank manifold is stored as a frame plus variations
(T3Frame + T3Variations, bundled as a T3Tangent). This note explains what those cores mean, why
there are d of each but d+1 rank/bond indices, and why the variations behave like plain coordinates
— which is what makes corewise linear algebra (and the weighted metric, T3FrameWeights) work.
A tangent is a sum of 2d terms#
The key picture: a tangent vector is the sum of d tensor-train diagrams, each with one variation
core (in parentheses) surrounded by frame cores:
1--(H0)--R1---R2--1 1---L0--(H1)--R2--1 1---L0---L1--(H2)--1
| | | | | | | | |
D0 D1 D2 D0 D1 D2 D0 D1 D2
(plus a matching set with the Tucker variation (Vᵢ) in place of Dᵢ and the up core Uᵢ in the chain.) The
frame cores encode the base point — where the tangent space attaches to the manifold — and the variation
cores encode the tangent direction relative to that frame. There are four frame families and two variation
families:
frame core |
symbol |
role |
rank on its legs |
|---|---|---|---|
down-Tucker |
|
the Tucker factors (retained directions) |
|
up-TT |
|
the Tucker complement (where |
|
left-TT |
|
left environment (left of the variation) |
|
right-TT |
|
right environment (right of the variation) |
|
tucker-variation |
|
Tucker-factor direction (in the |
|
tt-variation |
|
TT-core direction |
|
d cores, d+1 bonds — and the carriers L(d-1), R0#
Each family has d cores (D0…D(d-1), L0…L(d-1), …), but the TT bonds run rL0 … rLd and
rR0 … rRd — d+1 of them. Mathematically there are only d natural left/right cores: in the
diagrams above, L(d-1) and R0 are never used (the leftmost term needs no left environment; the
rightmost needs no right environment).
So why keep them? To give the base point a home. A frame is meant to remember the point it was
constructed at, and that point is stored as a single extra variation term — the base point written as a
gauged tangent, v_X, whose only nonzero variation is the last TT variation (= L_last, the
L(d-1)-adjacent slot). Keeping the carriers L(d-1) / R0 means:
there is a canonical, non-arbitrary place to put the base-point term (rather than picking one of the
dcores by fiat), soT3Tangent.to_t3(include_shift=True)can fold the point back in; andevery family has a uniform length
dwith uniform bond indexing, which is an enormous win for code reuse and off-by-one safety — the numbering headaches (the “0-th right core sits in a different place than the0-th left core”) largely disappear. This was a deliberate, hard-won choice: the austered-core math versus the practicald+1bookkeeping — practicality won.
Takeaway for reading the code: left_ranks / right_ranks have length d+1, but the last left bond
and first right bond are frame-internal padding, “not really part of the frame.” The d things that are
genuinely per-mode are the variation cores and their adjacent edges.
Gauge conditions make the variations coordinates#
When the frame is orthonormal and the variations are gauged (Dᵢ Vᵢᵀ = 0; Lᵢ left-orthogonal
against all but the last Hᵢ — Appendix A.3 of the T4S paper), something powerful happens: plain
“dumb” corewise linear algebra on the variation cores faithfully equals Hilbert–Schmidt linear algebra on
the tangent vectors they represent. Adding variations adds tangents; corewise_norm/corewise_inner
of the variations is the HS norm/inner (see T3Tangent.corewise_norm vs MANIFOLD.norm). The variation
cores are, in this gauge, an orthonormal coordinate system for the tangent space.
That is exactly why the minimal T3Tangent stores only (frame, variations) and derives everything else,
and why the K/C stack split is recovered rather than stored (see
batching_and_stacking.md).
Four rank stores — and why excess rank is inert#
A T3Frame does not carry one rank tuple, it carries four: down_ranks (the rows of each Tucker
factor Dᵢ), up_ranks (the mode leg of each up core Uᵢ), and left_ranks / right_ranks
(the TT bonds, in each sweep direction). That redundancy is not bookkeeping sloppiness — it is what makes
non-minimal ranks harmless, and it is worth understanding before reading
numerical_contracts.md’s verdict that minimal rank is a precondition for
nothing.
Store names. Draw a T3 with its TT chain on top and its Tucker factors hanging below, one under each TT core:
1 --- c0 --- c1 --- c2 --- 1 TT chain: bonds r0 ... r3, each with a left and a right side
| | |
l0 l1 l2 Tucker factors: edges n0 ... n2, each with an up and a down side
one TT bond: c(i) --|-- c(i+1) left core L(i) on the left side, right core R(i+1) on the right
one Tucker edge: c(i) up core U(i): TT-shaped, above the edge
-+-
l(i) down core D(i): the Tucker factor, below the edge
Every internal edge carries two frame cores, one on each side, and each is orthonormal over the indices on its
own side. A store is named for the side its cores occupy: the left store holds the cores on the left of
every TT bond, the right store those on the right, the up store the TT-shaped cores above every Tucker edge,
and the down store the Tucker factors below it. The orthogonality adjectives say the same thing: a left core is
left-orthogonal, an up core up-orthogonal (up_orthogonalize_tt_cores), a down core down-orthogonal
(down_orthogonalize_tucker_cores). Name a store by its side, never by where its edge points: as a directed
edge, a core’s edge points away from its side (a left core’s edge points right, an up core’s edge points down
to the leaf). A frame keeps the stores in the order (down, up, left, right), Tucker family first as in
TuckerTensorTrain.data.
Letters. Diagrams, equations, shape comments and the update argument write the stores D, U, L, R
(Dᵢ the down core, the Tucker factor; Uᵢ the up core). Their widths are nD (the down store’s: the Tucker
factor’s rows), nU (the up store’s: the up core’s mode leg), rL and rR (the left and right stores’
bonds); at a minimal frame the down and up ranks agree. A T3’s own cores, outside a frame, are Bᵢ (Tucker) and
Gᵢ (TT), as in TuckerTensorTrain. d is both the number of modes and, upright, the differential (dΦ);
context tells them apart. Before 2026.5.0 the words up and down, and with them the widths nU and nD, named
the other store (release notes, “Upgrading from 2026.4.0”).
T4S notation. T4S writes U, O, P, Q for our D, U, L, R; its δU is our V (tucker_variations), its δG our H
(tt_variations). The paper ↔ code maps (entries_apply_probe.md §8,
batching_and_stacking.md §8) keep the paper’s letters.
Each core must be orthonormal in its own matricization or unfolding, and that caps that core’s own rank — you cannot have more orthonormal rows than the space they live in:
core |
orthonormality |
the rank it caps |
|---|---|---|
|
rows orthonormal |
|
|
|
|
|
|
|
|
|
|
Those are exactly the four minimal-rank inequalities (t3svd_minimal_ranks.md) — read as
feasibility conditions for an orthonormal core rather than as a property of the tensor. Violate one in a
single core and orthogonality fails outright (a residual of order 1, not a tolerance miss).
But the bound is per core, not per frame. Ask for more rank than the rest of the network supports and
nothing fails: the excess is carried as slack between the four stores. T3Frame.random_orthogonal
with tucker_ranks=(4,4,4), tt_ranks=(1,2,2,1) on a (6,6,6) tensor — where mode 0’s Tucker ceiling is
r₀·r₁ = 2 — returns down_ranks=(4,4,4) alongside up_ranks=(2,4,2). Ask for tt_ranks=(1,9,9,1) and
left_ranks and right_ranks come back different from each other, each capped in its own direction.
Orthogonalizing a non-minimal point does the same thing.
Two consequences follow, and they are the whole story:
An orthonormal frame need not have minimal ranks.
has_minimal_ranksadditionally requiresdown == upandleft == right, so it reportsFalseon exactly these frames. That is correct and useful — it is a diagnostic that your stored rank tuple is partly unrealizable — but it is not a defect of the frame, and orthogonality does not imply it.The excess is geometrically inert. The tangent variations are shaped by the operative (up) ranks, so the tangent space is unchanged: its dimension still equals
manifold_dim,MANIFOLD.inner/normare still exactly Hilbert–Schmidt, and the ambient projection is still idempotent and self-adjoint — all to machine precision. What grows is the ungauged coordinate array; the gauge conditions cut it back to the same tangent space. The first retraction collapses the slack, which is why retraction preserves ranks only on a minimal frame.
So the precondition for the whole tangent machinery is orthonormality plus the gauge, full stop. Minimality is a property of how the base point is stored, not of the geometry built on it.
Weights are a diagonal metric on those coordinates#
This is where the weighted layer (weighting.md) plugs in, and it clarifies the whole
picture:
A base point is a tensor;
T3Weightsweights all its internal edges (a weighted network).A tangent is a set of coordinates;
T3FrameWeightsis a diagonal metric on those coordinates — one weight per variation-core edge (deach:down↔H.nD,up↔V.nU,left↔H.rL,right↔H.rR). The weighted norm is justcorewise_normof the weight-scaled variations; the frame stays orthonormal.
The d-natural-edges count is not a coincidence — it is the same d as the variation cores, and the
carrier bonds rLd / rR0 (being base-point machinery, not tangent directions) correctly carry no weight.
Putting inverse singular values on these coordinate edges penalises the poorly-informed tangent directions
— the Grasedyck–Kramer preconditioner.
Where to look#
The core diagrams, orthogonality, and gauge conditions: the
T3Framedocstring (frame_variations_format.py).The tangent bundle + geometries (
MANIFOLDHS vsCOREWISEcoordinate metric):manifold.py.The doubled-rank point+tangent embedding (base point folded into the last core):
T3Tangent.to_t3.The
K/C/Wstack blocks:batching_and_stacking.md.