UT3Tangent.gauge_residual#

t3toolbox.uniform_manifold.UT3Tangent.gauge_residual()#
def gauge_residual(self) -> NDArray:  # shape = variation stack K+C (scalar/0-d when unstacked); cached

Max gauge-condition violation relative to the tangent’s scale, per stack element (shape = variation stack K+C; atol-independent; cached). The expensive part of is_gauged() – a fixed tangent reused across an inner loop (e.g. the safe-mode GAUGE precondition of the manifold inner product) is contracted once. See utv_gauge_residual().

The scale is the ragged twin’s (T3Tangent.gauge_residual): a tangent built by +/-/scalar * / stack_tangents() is measured against its operands’ scale (max(||a||, ||b||), |c| ||a||, per stack element, as a floor under its own norm), so a near-cancelling difference of gauged tangents passes the safe-mode check; any other tangent – and one rebuilt by a jax pytree round-trip, or built under safety.unsafe()/a trace – is measured against its own norm.

Return type:

NDArray