linalg#

Dense linear-algebra primitives shared by the orthogonalization and SVD sweeps.

truncated_svd, the directional left/right/up_svd and *_svd_pair factorizations (directions match the core matricization/unfolding conventions), pad_safe_svd (the mask-aware SVD of a zero-padded matrix – the uniform layer’s replacement for a black-box SVD), the clipped and damped reciprocal of a spectrum with its pseudo-inverse (filtered_reciprocal, damped_pseudo_inverse), the pinned completions (pinned_completion, pinned_leading_columns: orthonormal columns continuing a fixed orthonormal block, tolerance-free), and pad_or_truncate. Pure array-in, array-out helpers with no T3 semantics.

Functions#

pad_or_truncate(array, pad_width[, mode])

Pad and/or truncate an array per axis, using signed (before, after) widths.

truncated_svd(A[, min_rank, max_rank, rtol, atol])

Compute (truncated) singular value decomposition of matrix A.

left_svd(G0_i_a_j[, min_rank, max_rank, rtol, atol])

Compute (truncated) singular value decomposition of 3-tensor left unfolding.

right_svd(G0_i_a_j[, min_rank, max_rank, rtol, atol])

Compute (truncated) singular value decomposition of 3-tensor right unfolding.

up_svd(G0_i_a_j[, min_rank, max_rank, rtol, atol])

Compute (truncated) singular value decomposition of a 3-tensor's up matricization (middle index as rows).

left_svd_pair(G0_i_a_j, G1_j_b_k[, min_rank, ...])

Compute (truncated) singular value decomposition of G0, pushing non-orthogonal remainder onto G1.

right_svd_pair(G0_i_a_j, G1_j_b_k[, min_rank, ...])

Compute (truncated) singular value decomposition of G1, pushing non-orthogonal remainder onto G0.

up_svd_pair(G_i_a_j, B_a_o[, min_rank, max_rank, ...])

Compute (truncated) singular value decomposition of G, pushing non-orthogonal remainder onto B.

down_svd_pair(G_i_a_j, B_a_o[, min_rank, max_rank, ...])

Compute (truncated) singular value decomposition of B, pushing non-orthogonal remainder onto G.

pad_safe_svd(A, row_mask, col_mask)

SVD of a zero-padded matrix whose null-space vectors are forced OFF the padding.

filtered_reciprocal(s, eps[, rcond])

The clipped, optionally damped reciprocal of a spectrum: f(s) = s / (s^2 + eps^2).

damped_pseudo_inverse(M, eps[, rcond])

The damped pseudo-inverse M^{+eps} = V f(S) U^T of a (stack of) matrices, and its spectrum.

pinned_completion(pinned, seeds, k)

The k columns that continue pinned to an orthonormal set, taken from seeds in order: the

pinned_leading_columns(pinned, A, k)

The pinned truncated SVD: the leading k left singular directions of A projected off

pad_safe_pinned_completion(pinned, pinned_mask, seeds, ...)

pinned_completion() of the real block of a padded matrix, for any mask pattern: the