utv_gauge_residual#

t3toolbox.backend.utv_operations.utv_gauge_residual(frame_data, variations_data)#
def utv_gauge_residual(
        frame_data,       # UT3Frame .data
        variations_data,  # UT3Variations .data
) -> NDArray:  # shape = variation stack (K+C); per stack element (scalar/0-d when unstacked)

Max violation of the gauge conditions for a uniform tangent vector, per stack element (the uniform mirror of tv_operations.tv_gauge_residual()).

Each Tucker variation must be orthogonal to its up-core (U^T dU = 0) and each left-interior TT variation orthogonal to its left-core ((P^L)^T dG^L = 0). Mask-once, then the gauge grams vectorized over d, max-abs reduced over the gram axes (keeping the stack), then the max over all checks (the last TT core is excluded – the [:-1] boundary). A caller thresholds it (<= atol).

Return type:

NDArray