ufv_operations#

Stateless stack/unstack for the uniform frame-variations layer (UT3Frame / UT3Variations).

Mirror of ut3_operations.ut3_unstack / ut3_stack for the bv .data layout (*supercores, shape, masks), generic over the supercore count (4 for a frame, 2 for variations; both carry the SAME 4-tuple of rank masks). The stack lives at axes 1 .. len(stack_shape) (axis 0 is the mode index d, NOT a stack axis); the supercores and all four masks unstack along it, while the int-tuple shape is shared and woven onto every leaf. The masks’ differing leading axis (d vs d+1) is irrelevant – only axes 1..k are sliced.

Functions#

ufv_leaf_structure(d, n_supercores)

Template marking one bv .data leaf (*supercores, shape, masks) for the tree machinery.

ufv_unstack_axes(data, n_supercores, axes)

Unstack a bv .data tuple along the GIVEN array axes (a sub-run of the stack), leaving the rest.

ufv_stack_axes(xx, n_supercores, axes_start)

Stack an array-like tree of bv .data leaves onto a CONTIGUOUS run of array axes starting at

ufv_unstack(data, n_supercores)

Unstack a (stacked) bv .data tuple into an array-like tree of unstacked ones (the WHOLE stack).

ufv_stack(xx, n_supercores)

Stack an array-like tree of bv .data leaves into one (the WHOLE stack at axes 1 ..). Inverse

ufv_variations_sum_stack(data[, axis])

Sum a UT3Variations over stack axes (a batch of tangents -> their sum; corewise == tangent sum by

ufv_frame_reverse(data)

Reverse the mode order of a UT3Frame .data. The left/right supercores and their masks

ufv_variations_reverse(data)

Reverse the mode order of a UT3Variations .data: the tucker-variation supercore reverses; the

ufv_save(file, data)

Save a bv .data tuple to a .npz (3 families: the supercores, the rank masks, the shape

ufv_load(file[, use_jax])

Load a bv .data tuple saved by ufv_save(). The supercores follow use_jax; the

ufv_frame_orthogonality_residual(data)

Max deviation of the four masked frame supercores from orthonormality, per stack element (shape

ufv_absorb_weights(variations, weights)

Absorb the four-family metric weights into the VARIATION supercores -- the uniform twin of

ufv_weights_consistent(variations, weights)

True iff the four weight families fit variations (non-raising): padded widths match, the weight

ufv_weights_from_ut3_weights(weights)

Build uniform frame weights (a tangent metric) from uniform base-point edge weights -- the twin of

ufv_reciprocal_weights(weights)

Elementwise 1/w on the real slots of all four families (masks unchanged); the padding stays a

ufv_sqrt_weights(weights)

Elementwise sqrt on the real slots of all four families; the padding stays a canonical, finite

ufv_concatenate_weights(weights_A, weights_B)

Per-edge concatenation of two frame-weight 4-tuples (the + combine; ranks add). Supercores and

ufv_kronecker_weights(weights_A, weights_B)

Per-edge Kronecker product of two frame-weight 4-tuples (the Hadamard combine; ranks multiply).