Glossary#
One entry per concept, under one canonical name in bold, with the other names the docs and the API use for it (“also: …”). Each definition is short; the link goes to the page that explains it fully (or, for a term the docs use without defining, to where it matters most). Entries are alphabetical within each section, so related terms stay together and a known term is still quick to find; to land on an entry from an alias, use the browser’s find or the docs search. Symbols that mean different things on different pages are collected at the end, in Symbols.
Tensor formats and layers#
absorb (
t3_absorb_weights,ut3_absorb_weights,fv_absorb_weights,ufv_absorb_weights;T3Tangent.absorb_weights). Contract diagonal edge weights into the cores (tensor weights) or into the variation cores only (a tangent metric), keeping all shapes. Edge weightingbatch block (also: block; the
C/W/Kblocks). One of the three independent batches a computation can carry: the frame stackC, the probe stackW, the tangent stackK. Each is zero or more leading axes. The three batch blocksboundary bonds (also: tails;
r0,rd). The first and last TT ranks. Usually 1; otherwise the train’s ends are vectors of ones.squash_tailsmakes both 1 without changing the represented tensor. User guidecentral core (also: central Tucker core;
Cin thet3mpage). Then0 × … × n(d-1)core tensor of the Tucker decomposition, which a T3 stores as a tensor train. Never called a “Tucker core” here. What there is to truncatecore (also: core array). A small tensor contracted with its neighbours to form the represented tensor: Tucker cores, TT cores, frame cores, variation cores; on the uniform layer, a slice of a supercore. User guide
CP factors (also: canonical factors;
from_canonical). A length-dtuple of(R, Ni)factor matrices for the rank-RsumΣ_k ⊗_i f_i[k]; the ambient transposes return them. Transposesd-leading layout (also: mode axis first). A supercore puts the core indexdbefore the stack,(d,) + stack_shape + …, so a sweep over cores is alax.scanover axis 0. Ragged objects are stack-leading. Whydleadsdeterminantal variety (also: bounded-rank variety,
V_{≤n,≤r}). The tensors whose ranks are at most given bounds. A uniform stack is a batch of points in it; each element’s masks name its nominal stratum. A batch in a varietyedge (also: internal edge; Tucker edge, TT bond). A contracted index of the T3 network:
dTucker edges (Tucker core to TT core, sizeni) andd+1TT bonds (between TT cores, sizeri). Cutting a Tucker edge gives a matricization, cutting a TT bond an unfolding. Masks and weights live on edges.T3Weightsedge mask (
tucker_edge_mask,tt_edge_mask;UT3Masks; also: rank mask, mask). Per edge and stack element, a host boolean vector over the padded width: slotjis real iff the mask isTruethere. The rank ismask.sum(-1). What a mask meansedge weights (
T3Weights,UT3Weights; also: weighted layer,weights). One diagonal per Tucker edge (d) and per TT bond (d+1), the layoutt3svd’s singular values come in. Unrelated to the residual weightweight=. Edge weightingequivalence contract (also: uniform equivalence contract).
to_uniform → op → to_raggedequals the ragged op on the real slots; padding is don’t-care. Gauge-carrying ops agree only up to gauge. A small number of operations are exceptions, most notably the alignment, whose two layers agree only if its fixed-point iteration runs to convergence and does not get stuck in a local optimum; the library keeps exceptions to those with a good reason. The contractframe stack
C(stack_shape,frame_stack_shape; also: core stack, frame/core stack, base-point stack). A batch of whole T3s or base points, on every core of an object. It isstack_shape. The three batch blocksframe-inner (order
W + K + C). The library-wide order of the batch axes before the core axes: the frame stackCinnermost,Woutermost, so a frame broadcasts over its tangents and probes for free. The frame-inner conventiongappy mask (also: working form; non-prefix mask). A mask whose real slots are not a prefix. On the uniform layer
+concatenates rank masks (and a weights’kroneckerKroneckers weight masks), leaving gaps; arithmetic never compacts them, whileut3svdand frame compaction return prefix masks. Code selects real slots through the mask. Canonical form vs working formgroup ceiling. The largest useful rank of a sharing group:
n_g ≤ min(N_g, Σ_{i∈g} min(N_g, r_i·r_{i+1})), so per-mode Tucker ceilings add across a group. Rank machinerygroup spectrum (
s_g). The singular values of a sharing group’s concatenated matricizations[T_(i1) | … | T_(ik)];t3svd(sharing=…)reports it at every mode of the group. What the group spectrum isgrouped T3-SVD (
t3svd(sharing=…); also: two-phase truncation). Round the TT bonds first, then truncate each sharing group with one SVD of its members’ concatenated centers. Grouped truncationHadamard product (
t3m,x * y; also: elementwise product,⊙). The elementwise product of represented tensors (ragged layer only); ranks multiply.x * yis exact;t3mcan also truncate, by'form_then_round','inplace_fused'(default) or'swap'.t3mmethodsheterogeneous stack. One T3 whose cores carry different but broadcastable stacks, e.g. frame cores
Cand variation coresK + C. Allowed in the backend; frontend classes require onestack_shape. Heterogeneous tuplesHilbert–Schmidt (also: HS, Frobenius;
inner,norm). The inner product and norm of the represented dense tensors,Σ X[i]·Y[i]. On tangents it isMANIFOLD.inner/norm; the corewise metric equals it only on an orthonormal frame with gauged variations. The geometriesleft-orthogonal form / right-orthogonal form (
is_left_orthogonal,is_right_orthogonal;t3svd(..., assume_orthogonal=True); also: orthogonality center, center remainder). A T3 with every Tucker core down-orthogonal and every TT core but the last left-orthogonal (left form) or but the first right-orthogonal (right form); that last or first core is the orthogonality center.t3svdreturns left form;assume_orthogonal=Trueasserts right form. How to minimizemask holder (
UT3Masks,UT3FrameMasks,UT3VariationsMasks). The frozen frontend object that carries a uniform object’s masks as jaxaux_data, hashed by mask content. The decisionmatricization (
X_(i); also: mode-imatricization). The matrix formed by cutting a Tucker–TT edge: modei’s index as the rows, all other modes as the columns (Kolda & Bader’s usage). For a tensor of shapeN0 × N1 × N2:N0 × (N1N2),N1 × (N0N2),N2 × (N0N1). Its rank is the minimal Tucker rankni. Compare unfolding. Notationminimal ranks (
has_minimal_ranks,minimal_ranks; also: structurally minimal). Ranks with no structural redundancy, judged by integer arithmetic:ni ≤ Ni,ni ≤ ri·r(i+1),ri ≤ ni·r(i+1),r(i+1) ≤ ri·ni. No operation needs them for correctness. The fitting layer reducesx0itself (on the uniform layer always, since that path needs a minimal-rank frame; on the ragged layer on manifold geometries). What minimal ranks meansmode (also: index, physical index, leg;
d= number of modes, the tensor’s order). One index of the represented tensor. “Order” also means derivative order; see jet. Notationmode size (
Ni;shape). The length of modeiof the represented tensor,shape = (N0, …, N(d-1)). On the uniform layerNis the padded width instead. User guidenumerically minimal (
has_numerically_minimal_ranks; markernumerically_). No stored rank is numerically redundant: an SVD-grade check, unlike the structuralhas_minimal_ranks. Minimal ranksorthogonal core (left-, right-, down-, up-orthogonal; also: outer-orthogonal). A core with orthonormal rows or columns in one reshape (API “orthogonal” means orthonormal). TT core: left, its
(ri·ni) × r(i+1)unfolding has orthonormal columns; right, itsri × (ni·r(i+1))unfolding has orthonormal rows; up (also outer), itsni × (ri·r(i+1))matricization has orthonormal rows (up_orthogonalize_tt_cores). Tucker core: down,B Bᵀ = I(down_orthogonalize_tucker_cores). The adjective names the side of the cut edge whose indices the orthonormality sums over. The frame stores are named the same way: an up core is up-orthogonal, a down core down-orthogonal (2026.5.0; before, the store names were the other way round). Four rank storesoversample (
t3m(method='swap', oversample=k)). Relax every truncation criterion bykduring the swap merge, then truncate once at the targets. Unrelated to the alignment’soversampling. Oversamplingpacked vectors (
pack_vectors,unpack_vectors,pack_if_ragged; also: packedness mirror). Mode vectors as one(d,) + … + (N,)zero-padded array instead of a length-dlist; uniform ops return the form they were given. The vector I/O boundarypad-safe SVD (
linalg.pad_safe_svd). An SVD of a zero-padded matrix whose leading triplets are exactly the economy SVD of the real block, bitwise zero on padding, with no rank tolerance. Uniform sweeps use it. The full-rank qualifierpadded widths (
n,r,N; framesnD,nU,rL,rR; also: nominal rank, a level’s widths, paddedN). The common sizes a uniform object’s cores are padded to: Tuckern, TTr, modeN ≥ max Ni. A frame’s stores each have their own:nDthe down store’s (the Tucker factor’s rows),nUthe up store’s (the up core’s mode leg),rL,rRthe left and right stores’ bonds.nDandnUswapped meaning in 2026.5.0. The layoutprefix mask (
common.prefix_mask; also: canonical form). A mask whose real slots are[0, rank).ut3svdand SVD-based orthogonalization produce it; it is an output property, never an input assumption. Canonical form vs working formprobe stack
W(also: sample stack, vec/index stack). A batch of probe-vector sets or entry indices. It lives onww/index/pponly, never on the cores. The three batch blocksragged layer (also: ragged representation). The default representation: tuples of per-core arrays, each with its own true shape. Glossary of batching
rank adjustment sweep (
rank_adjustment_sweep(direction)). One lossless directional sweep that drops structurally redundant ranks; it reaches minimal ranks when the input is orthogonal in the opposite direction. How to minimizeranks (
ranks,structure,uniform_structure).ranks = (tucker_ranks, tt_ranks);structure = (shape, tucker_ranks, tt_ranks, stack_shape); uniformuniform_structure = (d, N, n, r, stack_shape). User guideraw sweep ranks (
ranks.compute_raw_sweep_ranks). The rankst3svdreturns under hard caps: no truncation or a tolerance gives minimal ranks, but a cap can orphan the rank before it. Non-minimal ranksreal slot / padding (also: junk slot, the padded-frame code’s word; padded slot, garbage, don’t-care). On the uniform layer a slot is real iff its mask is
True; every other entry is padding, whose values are ignored but must be finite (0·NaN = NaN). Not the new slots of a zero-padded point, which are real. The contractrepresented tensor (also: dense tensor, the tensor a T3 represents). The
N0 × … × N(d-1)array the cores contract to. Unless a name sayscorewise, every operation is defined on it, and it is never formed. User guideresize (
resize). Change a T3’s shape and ranks: zero-pad cores to grow (the represented tensor is unchanged), truncate cores to shrink. Growing ranks this way gives rank continuation’s warm start. How to use itshape mask (
shape_mask). The(d, N)mask of real entries along each padded mode axis, rebuilt on the host from the staticshapeints rather than stored. Always a prefix: the shape never changes under arithmetic. Canonical form vs working formshare (
x.share(sharing)). Project a T3 onto the shared-factor format: each group’s factor is the dominant subspace of its concatenated matricizations, then grouped T3-SVD rounding. The formatshared Tucker factors (SF-T3; also: shared-factor format; SF-ETT, SF-Tucker in the literature). T3s whose Tucker cores are equal within each sharing group. Not a new class: an ordinary
TuckerTensorTrainwith tied factors. Shared Tucker factorssharing group (also: group; partition). The modes with one sharing label; the groups partition the modes, and a group’s modes need equal sizes. Not a
contractgroup. Shared Tucker factorssharing spec (
sharing=). A length-dtuple of hashable labels, one per mode; equal labels share one Tucker factor.Nonemeans unshared. Shared Tucker factorssquash tails (
squash_tails). Make the boundary bonds 1 by summing them into the end cores; the represented tensor is unchanged. User guidestack (also: stacking, batching). Three meanings: (1) the leading
stack_shapeaxes on one object’s cores; (2)backend/stacking.py’s conversion between a tree of objects and one stacked object; (3) the uniform supercore. Three meaningsstack_shape. The leading batch axes shared by all of an object’s cores,
core.shape = stack_shape + (…);()when unstacked. It is the frame stackC. Glossary of batchingstratum. The fixed-rank manifold a point lies on inside the bounded-rank variety. A uniform element’s masks name its nominal stratum; zero content (a zero-padded point, a numerical deficiency) can put the tensor on a lower one. The representation
supercore (Tucker supercore, TT supercore). The
dpadded cores of one family stacked on a leading axis: Tucker(d,) + stack_shape + (n, N), TT(d,) + stack_shape + (r, n, r). The layoutsweep (left-to-right, right-to-left). A pass along the core chain that carries an accumulated contraction or factorization from one core to the next, written as a scan: orthogonalization sweeps, the T3-SVD sweep, the frame sweep, the rank adjustment sweep. (Test “sweeps” are parameter grids.) Paper ↔ code map
T3 (
TuckerTensorTrain; also: Tucker tensor train, extended tensor train, ETT). A Tucker decomposition whose central core is stored as a tensor train:dTucker cores anddTT cores. User guideT3-SVD (
t3svd, uniformut3svd, denset3svd_dense/dense_t3svd; also: implicit T3-SVD, T4S Algorithm 10; the dense one is Algorithm 9). Orthogonalize, then one left-to-right truncating sweep of SVDs on the cores; returns a left-orthogonal T3 and the Tucker and TT singular values.ut3svdtakes rank caps only. T3-SVD rankstangent stack
K(tangent_stack_shape). A batch of tangent vectors at one frame; it lives on the variation cores only, so a tangent’s stack isK + C.Kmeans nothing else. The three batch blockstied (
TIEDin the contract tables;has_shared_tucker_factors,t3_tie_tucker_factors; also: untied). The Tucker factors of each sharing group are numerically equal. Per-mode operations that treat group modes differently untie them. The formattruncation spec (
max_tucker_ranks,max_tt_ranks,rtol,atol). Rank caps (an int or a per-position sequence) and per-step tolerances, shared byt3svdandt3m. The truncation specTT core (
tt_cores;Gi). Thedorder-3 cores of shapestack_shape + (ri, ni, r(i+1))whose train is the central core. User guideTT rank (
tt_ranks,ri, lengthd+1; also: bond rank, bond). The size of TT bondi: between TT coresi-1andi, withr0andrdthe boundary bonds. User guideTucker core (
tucker_cores;Bi,Diin a frame; also: Tucker factor, Tucker basis, leaf). Thedmatrices of shapestack_shape + (ni, Ni)mapping modeito its Tucker index. User guideTucker rank (
tucker_ranks,ni, lengthd). The size of the edge between Tucker coreiand TT corei. User guideunfolding (
X^⟨k⟩; also: TT unfolding). The matrix formed by cutting a TT–TT edge: the ordered modes split, everything left of the split as the rows, everything right as the columns (TT usage). ForN0 × N1 × N2:1 × (N0N1N2),N0 × (N1N2),(N0N1) × N2,(N0N1N2) × 1, the two vector-shaped ones included or not by convention. Its rank is the minimal TT rank of that bond. Compare matricization. Notationuniform layer (
UniformTuckerTensorTrain,UT3Frame,UT3Variations,UT3Tangent; also: UT3, uniform representation). The padded mirror of the ragged layer: supercores plus host edge masks, so operations run underlax.scanand compile once. Raw.data = (tucker_supercore, tt_supercore, shape, masks). Equivalence contractvarying-rank stack. A uniform stack whose elements have different ranks: allowed along
C, never alongK. The tangent layerzipper (
tt_zipper_left_to_right,tt_zipper_right_to_left; dottedtt_zipper_tangent_*). Thed+1partial contractions of two TT chains over their shared mode indices, accumulated in one direction; it recomputes frame centers exactly, by matrix products only. TheS_imachinery
Frames, tangents and representations#
aligned padded frame (
fv_aligned_padded_frame,ufv_aligned_padded_frame; also: alignment, aligned start). The padded frame refined by a fixed-point iteration so its new directions capture a hint: each pass projects the hint onto the frame’s tangent space and gives every store the leading new directions of its content. The alignmentalignment pass (
T3Tangent.align_padded,tv_align_padded_frame; also: pass, alignment step). One update of the stores named inupdate, a tuple of the store lettersD,U,L,Rin any order; the others are transported. (2026.4.0: the lettersU,O,L,R, withUthe Tucker store, or a string of them.) Returns the new frame and its movement. The alignmentambient projection (
project_ambient). Project an ambient tensor (a T3 or a dense array) onto the tangent space at a frame; applied to an ambient gradient it gives the Riemannian gradient. The geometriesbase point (also: point). The T3 at which a tangent space is attached; the frame encodes it. In the derivative examples, “base points X” are sample locations instead. A tangent is a sum of terms
base-point tangent (
v_X;fv_base_point_tangent). The point written as a gauged tangent at its own frame: all variations zero except the last TT variation, so‖X‖² = ‖L_last‖².dcores,d+1bondsblock layout (split
(Na, Rb)). The uniform alignment’s internal layout: every rank slot is[old block | new block], each padded to one width with its own mask;(Na, Rb)are the old block’s Tucker and bond widths. The uniform layercaptured hint energy (
E = ‖Π_{T(F)} hint‖²). How much of the hint a frame’s tangent space holds. The alignment’s fixed point is stationary for it but not a maximum: a saddle (proved for matrices; on T3s, stationarity and the upward single-store rotations are measured). The alignmentcarrier (
left[d-1],right[0]; also:Ld/R0, frame-internal padding cores, base-point padding). The last left and first right frame cores. They hold the base point, not an edge’s frame; a padded frame keeps their old content only.dcores,d+1bondscompaction (
ufv_compact_frame). Rewrite a block-layout frame at a level’s widths, real slots first with prefix masks, so Newton reuses its compiled programs. The uniform layercompletion (also: orthonormal completion). The orthonormal content of a store’s new block, orthogonal to the old block. Also: the orthonormal vectors an SVD supplies at zero singular values. The padded frame
cone merit (
m_c(F)). The share of the hint’s normal part that the new directions represent on one side of every edge. Measured fixed points of the alignment are strict local maxima of it, one of many. The alignmentCOREWISE(CorewiseGeometry,CorewiseGeometryOps). The Euclidean geometry of the raw cores: corewise frame, identity projection, additive retraction. Its Gauss-Newton Hessian is gauge-singular. Choosing a geometrycorewise frame (
(B, G, G, G);t3_corewise_frame; also: (2026.4.0:(U, G, G, G))). The non-orthonormal frame whose up, left and right cores are the TT coresGand whose down cores are the Tucker coresB, so a tangent is a raw core perturbation.COREWISEuses it. Corewise transposedoubled-rank representation (
T3Tangent.to_t3,tv_to_t3;include_shift). The tangent as one T3 of about twice the frame’s ranks;include_shift=Trueadds the base point. Frame-variationsempty frame (
fv_empty_frame). The frame of a rank-0 T3: every rank axis has width 0 except the boundary bonds, so every slot of a padded frame built from it is a completion. The zero pointfixed point (of the alignment). Every store’s completion spans the leading new directions of its own content, given the others, so a pass moves nothing. Stationary for the captured hint energy but a saddle of it, per store a minimum (proved for matrices); measured to be a strict local maximum of the cone merit. The alignment
frame (
T3Frame,UT3Frame; also: orthogonal frame, orthonormal frame). The four stores of orthonormal frame cores that encode a base point and span its tangent space. Not a basis: at a non-minimal point it is overcomplete. Frame-variationsframe cores (down
Di, upUi, leftLi, rightRi;down_tucker_cores,up_tt_cores,left_tt_cores,right_tt_cores; also: “outer” for up, T4S’s letters (see T4S), (2026.4.0, names reversed: upUi(Tucker), downOiorDi,up_tucker_cores,down_tt_cores)). Down: the orthonormal Tucker factors(nD, N). Up: TT-shaped(rL, nU, rR), the TT core of the Tucker-variation terms (Vivaries in the complement ofDi’s rows). Left/right: the orthogonal TT environments. Each store is named for the side of its edge its cores occupy. Frame-variationsframe-variations format (
frame_variations_format,fv_/tv_; also: frame-variations representation, (frame, variations) pair). A tangent stored as a frame plus variations;fv_treats the pair as indexed pieces,tv_as the sum of its terms. Frame-variationsgauge conditions (
is_gauged,gauge_residual; also: gauged).Di Viᵀ = 0for everyi(code layout), and eachLileft-orthogonal againstHifori < d-1(T4S eqs. 47–48). They make the variations coordinates. Gauge conditionsgauge freedom (also: gauge, up to gauge). The non-uniqueness of a representation: any invertible change on an internal edge, e.g. column signs or rotations at a singular-value tie. Compare gauge-invariant quantities. Gauge-carrying operations
gauge projection (
Π; also: gauge projector). Map raw variations to gauged ones; two kinds. Orthogonal (MANIFOLD.project,tv_orthogonal_gauge_projection): the coordinate-orthogonal projection onto the gauged subspace; it keeps the gauged part and changes the represented tangent, and applied after a bare transpose it gives the Riemannian gradient. Oblique (MANIFOLD.project_oblique,tv_oblique_gauge_projection; also: oblique projection): not orthogonal; it enforces the gauge while preserving the represented tangent, compensating through the up and right cores. (An ambient tensor goes through ambient projection instead.) Notesgeometry (
MANIFOLD,COREWISE,UNIFORM_MANIFOLD,UNIFORM_COREWISE; backend*GeometryOps; protocoloptimizers.Geometry). Where optimization happens: the frame, the projectionΠ, the retraction and the metric, bundled. Choosing a geometrygeometry aux (
precompute,geometry_aux,geom_aux; also: companion). Per-frame data a geometry computes once per local model and hands toproject/retract;Nonefor the plain geometries. The piecesGrasedyck–Kramer metric (also: Grasedyck–Kramer preconditioner, inverse-σ weighting). Tangent-coordinate weights
1/σfrom the base point’s singular values, penalizing poorly determined directions. Edge weightinghint. A tensor whose projection onto the frame’s tangent space the alignment makes large: a T3, a dense array, or anything the
projectcallable accepts.newton_cguses the misfit gradient. The alignmenthint-free start (
T3Frame.padded,UT3Frame.padded;max_passes=0; also: seeded start, hint-free padded frame). The padded frame by a data-independent convention: seed rows completed against the old block by a sign-fixed QR. The padded framemanifold (also: fixed-rank T3 manifold,
M,T_xMits tangent space). The set of T3s with fixed minimal ranks, an embedded submanifold of the dense tensor space. User guideMANIFOLD(ManifoldGeometry,ManifoldGeometryOps). The Riemannian geometry: orthonormal gauged frame, HS metric, gauge projection, T3-SVD retraction. Choosing a geometrymanifold dimension (
manifold_dim,tangent_space_dimension). The dimension of the fixed-rank (or shared) manifold at given ranks; correct for any ranks. Rank machinerymovement (
start_movements,cone_movements). How far a pass turned the new directions: the largest over stores of‖g_old − P⁺P⁺ᵀ g_old‖_F; 0 at a fixed point.ufv_aligned_padded_framereturns a(max_passes,)+Carray, NaN after the last pass; thestatskeys hold one float per pass run. The scheduleold block / new block (also: A-block / P-block, old slots / new slots). In each store of a padded frame, the leading slots holding
x_old’s frame bitwise, and the trailing slots the rank increase adds. The padded frameorthogonal representation (
t3_orthogonal_representations,ut3_…;t3svd_orthogonal_representations). A point factored into an orthonormal frame plus gauged variations (which include the base-point term). Thet3svd_form uses the T3-SVD gauge and also returns the singular values. Frame-variationspadded frame (
fv_padded_frame). A frame ofx0(=x_oldzero-padded) that keepsx_old’s frame bitwise in the old block of every store and fills the new block with an orthonormal completion. The padded framepinned completion (
linalg.pinned_completion; maskedpad_safe_pinned_completion). Thekcolumns that continue a fixed orthonormal block to an orthonormal set, from seeds in order: the sign-fixed Householder QR of[pinned | seeds], with no tolerance. The hint-free start’s completion. Why a QRrepresentation dependence. The hint-free start depends on how
x_old’s frame is represented, slot signs and bases at singular-value ties included, so layers and BLAS builds differ; the aligned frame does not, up totol. Representation dependenceretraction (
retract). Map a base point plus a tangent step back onto the set.MANIFOLD: truncate the shifted doubled-rank T3 to the frame’s ranks by the implicit T3-SVD.COREWISE: add the step to the cores. Choosing a geometrysame-frame (
safety.frames_equal; also: same tangent space,FRAMESin the contract tables, formerlySF). Two tangents share a tangent space iff their frames are numerically equal (identity is a fast path). Checked in safe mode.T3Tangentsame-mask precondition. Uniform tangent add/subtract and weight absorption require equal masks, a structural host-side check, since padding would hide a mismatch. Tangent masks
schedule (
oversampling,oversampled_passes,max_passes,tol,alternate; mirrored bypadded_*,cone_*). Oversampled passes, one truncating pass, then two-colour pairs until both movements of a pair are belowtol(0.05) ormax_passes(10) is reached. The scheduleseed rows (
padded_seed,cone_seed,ZERO_FRAME_SEED; also: keyed Gaussian stream, slot-indexed seeds). New slotsof a store is seeded by rowsof a Gaussian stream keyed by seed, store and mode (or a group’s first mode). The padded frameshared geometry (
shared(geometry, sharing),shared_manifold,shared_corewise;SharedGeometry). Any of the four geometries restricted to tied Tucker factors: projections land on the tied tangent subspace. Optimizing over shared factorsslack (Tucker slack, TT slack; also: excess rank). Rank requested beyond what the network supports, carried as differences between the stores’ ranks. Geometrically inert; the first retraction collapses it. Four rank stores
store (
down_ranks,up_ranks,left_ranks,right_ranks; also: rank store, orthogonal-representation ranks, (2026.4.0, names reversed:up_ranks(Tucker),down_ranks(TT-shaped))). One of the frame’s four core families, named for the side of its edge its cores occupy, with the TT chain drawn on top: left and right of every TT bond, up (the TT-shaped cores) above and down (the Tucker factors) below every Tucker edge. Each is orthonormal in its own matricization or unfolding, over the indices on its side. Its ranks are set by the orthogonalization sweep (down, left, right over the left chain, then up); the differences are the slack. Four rank storesstore transport. In an alignment pass, a store not named in
updatekeeps its completion, re-expressed in the new coordinates. Unrelated to vector transport. Internalsstructurally zero (also: zero point). A T3 with some Tucker rank or interior TT rank 0, hence the zero tensor. Its frame is the empty frame. The zero point
T3-SVD gauge. The frame whose Tucker bases are the T3-SVD’s singular bases, as
t3svd_orthogonal_representationsreturns it with its singular values.T3FrameWeightstangent (
T3Tangent,UT3Tangent,tv_; also: tangent vector). A (frame, variations) pair representing a sum of2dterms, each with one variation core in place of a frame core (T4S eq. 46). A tangent is a sum of termstangent cone. At a point of lower rank than the target ranks (the zero tensor, a zero-padded point), the first-order directions into the tensors of at most those ranks: a union of linear spaces, not one tangent space. The cone merit and the cone reference are named for it. The math note
tangent metric (
T3FrameWeights,UT3FrameWeights). Diagonal weights on a tangent’s coordinates (down,up,left,right, each lengthd), absorbed into the variations but batched with the frame stackC.T3FrameWeightstied projection (
Π_sh;SharedGeometry.project). The projection onto the tied tangent subspace in the geometry’s own metric: a tilted post-pass on the manifold, the per-group mean on corewise. Optimizing over shared factorstwo-colour pass (
('D', 'L'),('U', 'R');alternate=True). A pass updating the down and left stores, then one updating the up and right stores, the other colour transported; avoids the period-2 cycle of simultaneous updates. The schedulevariation masks (
ufv_variation_masks; also: gauge-shifted masks). A uniform tangent’s variation masks, derived from the frame’s as(down, up, left[:-1], right[1:]); tangent+/−/scale leave them unchanged. Tangent masksvariations (
T3Variations,UT3Variations;tucker_variationsVi,tt_variationsHi; also: variation cores, T4S’s letters (see T4S)). The cores that fill the frame’s holes and encode a tangent’s direction. Gauged, they are orthonormal coordinates. Frame-variationsvector transport (
MANIFOLD.transport). Move a tangent to the tangent space at another frame by projection. The geometrieszero-point frame (
fv_zero_point_frame; also: canonical zero-point frame). The fixed frame at the zero tensor: seeded Haar (uniformly random orthonormal) Tucker cores, one per sharing group, and identity-prefix TT cores. The'zero'reference uses it. The zero-point frame
Fitting and sampling#
ambient transpose (
*_ambient_transpose). The adjoint of a sampling operation on the full tensor space, returned as CP factors; static and frame-free. Transposesapply (
apply,t3_apply,tv_apply). The multilinear formX(w0, …, w(d-1)): every mode contracted with a vector, one scalar per sample. The three operationsassembly (also: variation-gradient assembly). The transpose stage that forms the variation gradients from the edge-variable jets; its memory is linear in
|W|, whichchunk_sizebounds. Where the memory goesback-projection. A sampling adjoint applied to a residual, e.g.
c · (w0 ⊗ … ⊗ w(d-1))forapply. Transposesbare Jacobian (
𝒥,𝒥ᵀ; the tangententries/apply/probeand their transposes; also:𝒥⁽ˢ⁾, “Riemannian Jacobian” in older pages). The tangent sampling map applied to variations, with no gauge projection. Noteschunk_size('auto',estimate_chunk_size,max_chunk_size_within; also: chunking, W-chunking). Compute the probe-derivative transpose’s assembly in slices of that many probes: the same numbers, a lower peak memory on the uniform + jax path. Whatchunk_sizedoescontainment (
probe ⊃ apply ⊃ entries).applyisprobewith the free mode contracted too;entriesisapplywith one-hot vectors. How they relatecorewise transpose (
*_corewise_transpose). The gradient of a sampling operation with respect to a T3’s own cores, as a raw(tucker_grads, tt_grads)tuple; for Adam or L-BFGS. Transposesdata (
data=;y, alsob). The observed measurements, laid out like the forwardS(x). Not the.dataraw tuple. Drive a library optimizerdraw (
draw(rng),flat_draw; also: minibatch). A user functionrng → (sample_B, data_B)called each step bymc_sgd/adam; the default drawsbatchmeasurements uniformly from the flattenedW. Custom minibatchingedge variables (
xi,mu,nu,eta; tangentsigma,tau,dxi,deta; adjoint*_tilde). The partial contractions of a sample through the network, one per edge:ξup the Tucker cores,μ/νalong the left/right TT sweeps,ηcombined at each free mode. Paper ↔ code mapentries (
entries,index). Read offX[i0, …, i(d-1)]at multi-indicesindexof shape(d,) + W; a scalar per index. Fitting from entries is tensor completion. The three operationsframe sweep (
sweep,SamplingKind.precompute,*_from_sweep; lean(xi, mu), full(xi, mu, nu, eta)). The frame’s edge variables for a sample, computed once per local model and reused by everyJ/Jᵀ. Frame-sweep reuseJacobian (
J = 𝒥 ∘ Π,Jᵀ = Π ∘ 𝒥ᵀ). The Riemannian forward and adjoint of a fit: the bare Jacobian composed with the gauge projection.Jᵀris the Gauss-Newton gradient. The one ideajet (order axis
t;order). The order-stacked derivatives(y⁽⁰⁾, …, y⁽ᵒʳᵈᵉʳ⁾)on a leading axis of lengthorder + 1; order 0 is the plain operation. The maximum order is spelledorder, neverK. Index lettersmeasurement space. Where residuals live: one scalar per sample for
entries/apply,dvectors per sample forprobe, with the plain sum-of-products inner product. Measurement spacesmisfit. The data term of the objective,
½‖ω ⊙ (S(x) − y)‖². Regularizationmultilinear extension (also: Taylor data, grid corner).
entries_derivativesreturns the Taylor data of the represented tensor’s multilinear extension at the grid cornerindex: the jet ofapply(e_index + sP). Symmetric directional derivativesobjective (
f). The misfit plus the optional regularizer,½‖ω ⊙ r‖² + ρ(x); the history splits it asobj = misfit + reg. Regularizationone-hole / two-hole sweep (
corewise_hessian,t3_<kind>_corewise_hessian). One-hole: leave one core out (the corewise transpose). Two-hole: its derivative along a core direction, a second core replaced by its direction; the exact Hessian’s sampling term. Math noteperturbation vectors (
pp; also: directionsP, perturbation directions). Thedvectors along which the derivatives are taken, one direction per sample, on the same stackWaswworindex. Symmetric directional derivativesprobe (
probe,t3_probe,tv_probe). Contract all modes but one, for each mode in turn:dvectors per sample. “A probe” also means one sample row. The three operationsprobe vectors (
ww,w_i; also: test vectors, measurement vectors, probe rows). A length-dlist of arraysW + (Ni,)thatapplyandprobecontract with. Notationpushthrough / combine (jet kernels). Pushthrough carries a jet across one core in a sweep (the
μ,νjets); combine forms a free mode’s output from left and right jets (η). Both are binomial jet products. Math noteregularizer (
regularizer=,ρ(x);IdentityRegularizer(λ),Regularizer). An optional objective term.IdentityRegularizeris½λ‖x‖²: an HS ridge onMANIFOLD, weight decay onCOREWISE; scaled bybatch/nin minibatch steps. Regularizationresidual (
r).r = S(x) − y, unweighted; a list ofdarrays for probe kinds, jets for derivative kinds. Not a checker’s_residual. Measurement spacesresidual weight (
weight=,ω; per-order, per-mode). A per-(mode, order)scaling in the misfit½‖ω ⊙ r‖²; a bare vector is per-order. Unrelated to edge weights (weights,*Weights). The residual weightsample (
sample=; also: measurement). The measurement inputs:wworindex, or(ww, pp)/(index, pp)for derivative kinds. Their stack isW. Drive a library optimizersampling kind (
kind,'apply'…'probe_derivatives';SamplingKind; also: kind). What a fit measures. A kind implements six operations:precompute,forward(bare𝒥),transpose(bare𝒥ᵀ),point_forward(S(x)),take(a minibatch gather) andcorewise_hessian(exact Hessian only), plus norm reductions. The piecessampling operations (
entries,apply,probe). The three ways to evaluate the represented tensor without forming it, by contraction with vectors in all or all-but-one modes. Entries, applies, probessum_over_probes. Transpose flag.False(default) keepsWas an output stack;Truesums over it, giving the Gauss-Newton gradientJᵀr. Transposes andsum_over_probessymmetric directional derivatives (
*_derivatives,'*_derivatives'kinds).y⁽ᵗ⁾ = dᵗ/dsᵗ op(X + sP)ats = 0, fort = 0..order, in one repeated directionP; returned as a jet. Symmetric directional derivativestangent transpose (
T3Tangent.*_transpose; also:𝒥ᵀ). Back-project a residual into a tangent at a frame, without gauge projection. Transposestrs(also: binomial convolution tensor;_trstwins; banded recurrence, order scan).trs[t,r,s] = C(t,r)·[r+s=t], the jet product rule. Shipped kernels never contract it (a banded recurrence or an order scan); dense_trstwins live in the tests. Semantic markers
Optimization#
adam. Adam over the cores, for the corewise geometry; onMANIFOLDit runs but warns, since its moments are gauge-dependent. Drive a library optimizerArmijo line search (
step_control='line_search',c_armijo,on_line_search_failure). Halve the step untilf(retract(αp)) ≤ f + c_armijo·α·⟨g, p⟩, for up to 40 trials innewton_cgand 50 ingradient_descent.'stop'ends the run when all fail;'accept'takes the last trial. Practical guidanceCauchy step. The step length
α = ‖g‖² / ‖𝒥g‖²that minimizes the Gauss-Newton quadratic along−g;gradient_descentstarts from it andmc_sgdtakes it. Drive a library optimizercone reference (
g0_reference='cone';cone_*options).‖Π_{T(F)} g(0)‖: the misfit-gradient norm at the zero tensor ofx0’s ranks, on the frame aligned with that gradient.cone_max_passes=0uses the hint-free start there, a different frame from'zero'’s, so the two values differ. In the optimizerscontinuation_ranks(compute_continuation_ranks;tau,n_chunk,max_grow,kappa_guard; also: condition-number continuation). Propose the next ranks from the iterate’s spectra, growing edges withκiat least a factortaubelow the worst; the current ranks mean stop. The ideacountable step (switch mode). A Gauss-Newton-phase step that took the full model step: accepted, not the
−gfallback, and either an accepted trust-region trial or an Armijo step withα = 1. Only these can add to the count; a rejected trial, a backtrack, the fallback or a forced step resets it. The switchcurvature damping (
curvature_damping,ε;lift_eps). The lift’s damping relative to‖X‖_HS(default1e-6): directions with lift singular value well above it get the exact curvature, smaller ones are damped toward Gauss-Newton. A solver option, not a geometry field. The exact Hessiancurvature term (
curvature_hessian; also: Weingarten term). The exact Hessian’s addition to Gauss-Newton,Π Lᵀ(K_{Aᵀω²r} − K_{grad f}) L Π: the residual’s normal part paired with the manifold’s second fundamental form. It can be negative. The exact Hessianedge condition number (
κi,ranks.edge_condition_numbers; groupκ_g). For an edge of structural rank r, the ratio σ₁/σ_r of the matrix cut at that edge (a matricization for a Tucker–TT edge, an unfolding for a TT–TT edge), over its first r singular values only: the cut matrix has at most r nonzero ones, so the ordinary condition number would be infinite. It is a property of the representation, not of the tensor: the same tensor carried at a larger r has σ_r = 0 and an infinite edge condition number.ranks.edge_condition_numbersexact Hessian (
hessian='exact'; also: exact Riemannian Hessian, exact model). Gauss-Newton plus the curvature term; indefinite away from a minimizer, so it defaults to the trust region, and gives a superlinear tail when the residual does not vanish.hessian='switch'starts in Gauss-Newton and changes to it within one call (switch). The exact Hessianflat slot (also: maximal-rank slot). A slot at its rank ceiling (Tucker rank = mode size, or TT rank = product of its neighbours); the curvature term has no component there. At
d = 1every slot is flat. The exact Hessianforcing term (
η;cg_forcing_power,switch_cg_forcing_power). CG stops at relative residualη = min(0.5, (‖g‖/‖g0‖)^power); the default power is 0.5, and 1.0 makes the exact Hessian’s tail q-quadratic (the error squares each step). In switch modecg_forcing_poweris the Gauss-Newton phase’s andswitch_cg_forcing_power(default 1.0) the exact phase’s. Practical guidanceg0 reference (
g0_reference:None,'zero','warm_start','cone';g0norm_newton,g0norm_cg; also: Newton reference,‖g0‖). The gradient norm the relative stop and forcing term divide by.Noneis the geometry’s own:'zero'on manifold geometries,'warm_start'on corewise ones. Explicitg0norm_*values win. Practical guidanceGauss-Newton model (
hessian='gauss_newton';gn_hessian,gn_quadratic).m(p) = c + gᵀp + ½pᵀHpwithH = Π𝒥ᵀω²𝒥Π(plus the regularizer’s); exact on the tangent space, positive semidefinite. The Gauss-Newton modelGauss-Newton view (switch mode;
_gauss_newton_view, the callback’sinfo.lm). Each Gauss-Newton-phase point is built once, in exact mode; CG, the step control and the row use that build with its curvature dropped, so they are the pure Gauss-Newton run’s. The switch, Model-level rulesgradient_descent. Steepest descent with a Cauchy initial step and an Armijo line search; eager only, the reference optimizer. Drive a library optimizergtol_rel(also: relative stop).newton_cgandgradient_descentstop when‖g‖ ≤ gtol_rel · ‖g0‖(default1e-8); there is nogtol. Practical guidancehistory (
stats['history'],NewtonInfo). One record per Newton iteration: objective split, gradient norm, CG and step-control outcome, reference kinds, trust-region and curvature fields, andhessian, the model that solved the row’s step. Switch mode adds fiveswitch_*fields.NewtonInfo.timingis not a history field. Drive a library optimizerladder (also: continuation ladder). The sequence of levels of one rank-continuation run. Rank continuation
least_squares_problem(LeastSquaresSetup:.problem,.x0_cores,.rewrap). Build the backendProblemfrom the frontend vocabulary, as the four optimizers do. The pieceslevel (also: rank level, continuation level). One fixed-rank fit within rank continuation, at one rank set. Rank continuation
lift (
L;tv_corewise_lift,LiftFactors,fv_lift_factors;lift_sigma_min). Map gauged frame coordinates to raw core directions of the base point,θ̂ = L v, through damped pseudo-inverses;lift_sigma_minis the smallest singular value it inverts. The exact Hessianlocal model (
fitting.LocalModel,backend.optimizers.LocalModel; formerlyGaussNewtonModel). The objective’s model at a base point, over one geometry: value, gradient, Hessian actions and retraction, with the frame sweep computed once. Built by the*_modelfactories. It has one Hessian, so'switch'is anewton_cgoption only. Build the local modelmc_sgd(also: Manifold Cauchy SGD, MC-SGD). Each step draws a minibatch, takes the Cauchy step along the gradient, and retracts; tuning-free (T4S §5.3.2). Drive a library optimizermodel errors (
e_GN,e_N; row fieldsswitch_e_gn,switch_e_n; also: hit, miss). How far each quadratic model missed the actual change of the objective along the steps:e_GN = |Δf − m_GN(s)|,e_N = |Δf − m_N(s)|. A hit ise_N < τ·e_GNon a countable step. The switchnewton_cg(also: inexact Riemannian Newton-CG). Each step builds the local model, solvesHp = −gby CG to the forcing tolerance, then a line search or trust region.hessian=picks Gauss-Newton (default), exact or the switch. Drive a library optimizeroversampled ranks (
oversampled_ranks; also: working ranks). The ranks pluspon every Tucker rank and interior bond, made structurally minimal and never below the input: the alignment’s ranks before truncation. The schedulepadded start (
newton_cg(padded_from=x_old),padded_*options,start_frame=; backendpadded_start). Iteration 0’s frame: the aligned padded frame ofx_oldwith the misfit gradient as hint, or a givenstart_frame. In the optimizersphase timing (
newton_cg(timing=True);PhaseSeconds,NewtonTiming,stats['timing']; also: phase, window, one-offs, compile wait, compile column). Splits each row’swall_timewindow into phases (the model build’s parts, the gradient, the reference, CG, the step’s forms, the trials, the tracking product, the remainder), with jax’s compile wait beside each, plus the run’s one-offs. Changes no number; on jax its waits serialize the run. Timing a Newton runProblem(backendoptimizers.Problem). The least-squares oracle(geometry, kind, sample, data);local_model(x)linearizes at a point. The piecesrank continuation. Fit at small ranks, grow the ranks, re-fit warm-started, and stop when more rank stops helping. The library proposes the ranks; the user drives the loop. Rank continuation
rounding gate (switch mode). A tracked step counts only if the larger model error,
max(e_GN, e_N), is above a hundred times the trust region’sobjective_floorthreshold; both at the floor resets the count, ande_Nat the floor withe_GNabove it is a hit. In float32 few steps pass, so enable jax x64. The switchstacked point (also: stacked optimization). A point with a frame stack
C: the local model accepts it; the four optimizers raiseNotImplementedError. Stacked pointsstats (
newton_steps,newton_accepted,stop_reason,history,losses;start_frame,start_movements,cone_movements;hessian,switch_track,switched_atin switch mode;timingwithtiming=True). The dict an optimizer returns.newton_stepscounts CG solves,newton_acceptedsteps taken. Drive a library optimizerstep control (
step_control:'line_search','trust_region'). How a Newton step is accepted: Armijo backtracking (Gauss-Newton default) or a trust region (exact and switch default); either works with any Hessian. The exact Hessianstop reason (
'gradient','max_newton','line_search','objective_floor','trust_region_floor'). Whynewton_cgstopped.'objective_floor'is not a failure: the predicted change fell below the objective’s floating-point resolution. Drive a library optimizerswitch (
hessian='switch';switch_tau=τ,switch_k=k,switch_cg_forcing_power,switch_track; also: Gauss-Newton-to-exact switch).newton_cgstarts in Gauss-Newton and moves to the exact Hessian for good afterkconsecutive hits,e_N < τ·e_GN(defaults 0.25 and 2). Each call starts afresh; trust region by default. The switchswitched_at(stats['switched_at']; row fieldswitch_fired). The index of the first history row whose model is exact:len(history)when the switch fired on the last row,0withswitch_k=0,Noneif it never fired. The switchtied lift (
fv_tied_lift_factors). The lift on a shared point: each group’s coordinates lift to one raw factor direction; a per-mode lift is not a tied direction. Optimizing over shared factorstracking product (
switch_pKp;switch_track:'countable'(default),'all'). The one curvature product per tracked Gauss-Newton-phase step,⟨p, Lᵀ K_N L p⟩, that gives the exact model’s predictionm_N; reported apart from the row’spHp. Its seconds are thetrackingphase. The switchtrust region (Steihaug–Toint CG;
tr_radius0=Δ0; ratioρ). CG inside‖p‖ ≤ Δ, then one trial retraction accepted iffρ = Δf / (gᵀp + ½pᵀHp) > 0.1;Δ0defaults to the Gauss-Newton Cauchy length. The exact Hessianuniform continuation. Growing every Tucker rank and TT bond together; the baseline the condition-number scheme improves on. Unrelated to the uniform layer. Why not grow every rank together?
useless-rank removal. Make proposed ranks non-degenerate from shapes and ranks alone. (The uniform bump, a separate step, is the fallback growth when every edge is comparably conditioned.) The idea
verbose display (
verbose=True,callback,make_newton_display,val_sample/val_data). A per-iteration block with a per-(mode, order)relative-error table, train and validation;callback(NewtonInfo)replaces it. Switch mode adds theswsegment (e_N / e_GN, the count,⇒ exact);timing=Trueatimeline per row and a closing table. Drive a library optimizerwarm start (also: zero-padded start, padded restart, continuation restart, zero-padded rank increase). Starting a level from the previous level’s point zero-padded to the new ranks by
resize: the same tensor, numerically rank deficient. (The'warm_start'g0 reference,‖g(x0)‖, is named after it.) How to use itx0(also: initial guess, start point). The starting point; its class picks the layer, and the geometry must match. A zero start is fine on the manifold, not onCOREWISE. A zero start
Conventions and testing#
aux_data(also: static structure; vs pytree leaf). The static part of a jax pytree, part of the jit cache key: masks, geometries, kinds. Leaves are traced data: cores, sweeps, samples, a tangent’s frame. jax pytrees andvmapbackend (
t3toolbox.backend.*). Stateless functions on raw.datatuples (plus classes that only bind parameters), imported by submodule and never re-exported; a first-class surface that can do everything the frontend does. Naming conventionsbackend razor (also: the razor). Put logic in the backend when it is nontrivial and easy to get wrong, judged from a user who works only on raw
.data; trivial logic may stay in the frontend. Backend-firstbackend rule (also: plain data, basic types; parameters are fields, behaviour is methods). Backend functions implement the math on plain data; backend classes only bind parameters and name roles, and every line of math in a method is also a standalone function. The backend rule
body-local suffix (
mu_WCa,C_aib). A local variable’s name ends in its axis layout: capitals for groups, lowercase for single axes, a leadingdfor the supercore or derivative axis. Shape-notation legendcapability-honest tails (
ut3_full_sum,ut3_norm_orthogonalized). A uniform twin keeps a different name when it supports less than the ragged one. Semantic markerschecker (
is_*/has_*; backend<family>_<subject>_<predicate>; paired_residual). A non-enforcing predicate returning a verdict per stack element; safe mode raises at the call site that uses it. Semantic markerscontract(backend.contractions.contract; also: grouped einsum, grouped contraction,len_<G>=). An einsum whose uppercase letters each stand for a group of zero or more axes, solved from the operand shapes;len_<G>=pins a split the string cannot. No reshape ever happens. Grouped contractionsconverters (
from_t3,to_t3,from_ut3,to_ut3,from_t3frame,to_t3tangent, …). On uniform classest3names the ragged layer andut3the same layer; on ragged classesfrom_t3/to_t3are same-layer. Converterscorewise (marker;
COREWISE,corewise_dot,sum_stack_corewise). Coordinate-space math on the core arrays, never Hilbert–Schmidt.corewise_dot/corewise_normcollapse every axis, stacks included. Semantic markers.data(also: raw tuple). The raw tuple a frontend object wraps:(tucker_cores, tt_cores); a frame’s(down, up, left, right);(tucker_variations, tt_variations); uniform(supercores…, shape, masks). Naming conventionsdispatch (
get_backend→xnp,xmap,xscan;tree_contains_jax; also: inferred dispatch). numpy vs jax is inferred from the input arrays at the lowest level, and ragged vs uniform from the operand types; nouse_jaxon operations. NumPy and JAXdispatch test (
tests/test_dispatch.py; dispatch rows). Numerical tests run on numpy only; this file jit-compiles each public op (a straynp.*on a tracer raises) and checks compile counts. Testing strategydoctest (also: reproducible example). Docstring and doc-page examples are run in CI, so they must reproduce exactly; they teach, coverage belongs in
tests/. Doctest styleeager jax. Running jax operations outside
jit: each new structure compiles op by op, slowly and with many memory mappings. With jax inputs, passuse_jit=True. Jit or eagerequality is explicit (
allclose,corewise_equal;ExplicitEquality).==raises on the runtime classes;allclosecompares what objects represent, per stack element;corewise_equalcompares stored bits. Equality is explicitexact output-mask assertion / garbage-padded inputs (also: tautology trap). The two uniform test tools: assert output masks against an independent derivation, and fill padding with large finite garbage and require the same result. The two tools
family prefix (
t3_,ut3_,tv_,utv_,fv_,ufv_,tt_,dense_; brand namest3svd,t3m). The prefix naming a backend function’s primary operand;umarks uniform-specific logic. The family prefix grammarframe-as-leaf. A tangent’s frame is a pytree leaf, not
aux_data, so a new frame each Newton step does not recompile; the same-frame guard is numerical. Decision historyfrontend (
import t3toolbox). Frozen dataclasses holding only the cores, whose methods delegate to the backend and re-wrap; they validate structure on construction. Naming conventionsHISTORICAL(tests/test_contractions_interpreter.py). The frozen table giving, for every librarycontractstring, whichlen_*supplement it requires; a new string must be added by hand. The evidence structureHOST tag (
HOST bool, static). A shape-comment tag: the array must be host numpy, never jax or traced, because it is static structure (the masks). The decode tableimport-graph test (
tests/test_import_graph.py). Checks that the backend import graph is acyclic and thatbackend/optimizers.pyimports onlycommon,regularizationandcorewise. The optimizer seamintended asymmetries. Places where the uniform layer deliberately offers less (no
to_vector, nortol/atoltruncation, …); not TODOs. Intended asymmetriesjax-absent policy (
common.jax_or_warn). A request for jax (use_jax=True,to_jax,use_jit=True) without jax installed runs on numpy and warns; it never raises. jit composesmask-once (also: mask on entry; re-mask on exit). Zero the padding once on entry, then run mask-free, since
0 × finite garbage = 0; re-mask after a step that writes into padding. The mask-once mechanismmask-representation contract (
prefix_mask,ValueHashedMasks,require_concrete_masks). Every uniform mask is a concrete host array, value-hashed, with prefix as its canonical form. Cataloged exceptionsnamed contraction functions (
WCa_Caib_WCi_to_WCb, retired). The ~104 functions whose names spelled their subscripts, replaced in 2026.1.0 bycontract. Where it came fromnumerical contracts. The op-by-op statement of what each operation requires and guarantees, and what safe mode checks. Numerical contracts
options are not parameters. A value that changes what is computed is a hashed field of a geometry or kind; one that changes only how a solver proceeds stays a keyword argument. Options are not parameters
oracle sweeps (
tests/test_oracle_sweep.py,tests/oracle_sweeps/;T3TOOLBOX_SLOW_TESTS=1). Dense ground-truth checks of fitting and Hessian quantities across kinds, geometries and layers, in an always-on and a slow tier. Testing strategyparameters are fields, not closures (
ValueHashedFields). Geometries, kinds and local models are frozen dataclasses whose parameters are fields, so they hash and compare by value as jit cache keys. Parameters are fieldsphantom rank. A too-permissive mask that claims rank where the supercore is zero; dense comparisons pass, so only exact output-mask assertions catch it. The blind spot
polymorphic op (also: the ragged name is the polymorphic name). A backend function that takes ragged or uniform operands under its unprefixed ragged name; ops returning a T3-like object get a
ut3_/utv_twin instead. Polymorphismprecondition / caveat. A precondition is needed for a correct result and is checked in safe mode; a caveat only governs what a result means and is never checked. The classification rule
safe mode / unsafe mode (
t3toolbox.safe(),t3toolbox.unsafe(),SafetyTolerances). An ambient setting; safe (the default) checks numerical preconditions and raises, unsafe and any jax trace skip them. The numbers are identical. Numerical contractsscan-body principles. Prefer module-level bodies for
xscan/xmap/xwhile, deriving what they need from their arguments (or a memoized specialization); a value that changes between calls rides in the loop state, or a cached program silently reuses the old one. The principlesseam. A boundary where two parts of the library hand data across in a fixed form: the ragged/uniform seam (
t3_to_ut3,ut3_to_t3), the splitprecompute→*_from_sweepseam, the optimizer seam (geometry members). The optimizer seamsemantic markers (
corewise,numerically_,_trs,_hessian,_tangent,_from_sweep,lift). Name parts that separate same-looking near-twins with different math;corewiseandnumerically_are rename-invariant. Semantic markersshape comment (
# len=d, elm_shape=…,shape=). The trailing comment on each signature line, stating what Python types cannot: shapes, lengths, constraints. Reading signaturesstack matrix. The standard parametrization of uniform tests: no stack,
C,K,K + C, forced padding, multi-axis stacks, varying rank acrossC. The stack matrixstructural vs numerical. Structural problems (shapes, ranks, masks, options) always raise, in both modes and under jit; numerical preconditions are checked only in safe mode. User guide
T4S. The paper Alger, Christierson, Chen & Ghattas (2026), “Tucker Tensor Train Taylor Series” (arXiv:2603.21141); citations use the arXiv numbering. 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). arXivtwin (uniform twin, backend twin, frontend twin,
_trs/ test twin, dotted twin). The same operation at another layer or level, or a reference implementation of it. Naming conventionsuse_jax. The flag on pure constructors with no array input (randn,zeros,ones,loadand backend twins), choosing the output type; operations infer instead. NumPy and JAXuse_jit. Opt in to jit onmc_sgd,adam,newton_cg(its inner CG and alignments) and the alignment loops: numpy inputs move to jax (float32 unless x64) and the result is jax-backed. Without jax it warns and runs eager. jit composesvalue-hashed (
ValueHashedFields,ValueHashedMasks; jit cache key). Hashing and equality by content, so a rebuilt but identical object is the same jit cache key and does not recompile. Uniform jit recipe
Symbols#
Uppercase C, W, K are reserved for the batch blocks in shape comments and contraction strings; lowercase
letters are single axes. A frame’s stores are written D, U, L, R (down, up, left, right), with widths nD
(the down store’s: the Tucker factor’s rows), nU (the up store’s: the up core’s mode leg), rL and rR; a T3’s own
cores are B (Tucker) and G (TT). Before 2026.5.0 the words up and down, and with them nU and nD, named the
other store (Four rank stores). The letters
below also carry other meanings on some pages.
symbol |
meanings, and the pages that use each |
|---|---|
|
the frame stack (batching, shape comments, every backend signature); the central core ( |
|
mode size |
|
Tucker rank |
|
TT rank |
|
the tangent stack (batching, naming conventions, shape comments); the curvature operators |
|
the probe stack (batching, shape comments); a |
|
the derivative direction ( |
|
the left frame cores |
|
the TT variations |
|
the sampling operator |
|
the down frame core |
|
the up frame core |
|
the edge condition number |
|
the regularizer |
|
the continuation’s threshold |
|
|
|
the gauge projection on variations ( |
|
the padded-frame messages and products ( |
|
the T3 iterate; the sample location of a derivative measurement (derivative examples, “probe vectors X” in derivative-model docstrings) |
|
the frame factors |
|
the number of modes; the leading supercore axis (uniform layer); a leading |
|
the jet shift: forward |
|
the maximum derivative order in |
|
the lift damping ( |