feynlag.vacuum.diagonalize.diagonalize_svd

feynlag.vacuum.diagonalize.diagonalize_svd(M, left_fields, right_fields, new_left, new_right, method='auto', dps=50)[source]

Singular-value decomposition for a Dirac mass matrix.

Finds rotations new = R·old with R_L M R_R† = diag(m_i ≥ 0) (rows of M = left/bar legs, columns = right legs; for real orthogonal R_R this is R_L M R_Rᵀ). The bar legs rotate with R* — use Rotation.bar() to build that rotation.

Parameters:
  • method – "symbolic" diagonalizes M Mᵀ/Mᵀ M exactly through SymPy (real M only; it raises on an explicit I) and returns orthogonal rotations, right-handed rows sign-fixed so the masses are non-negative. "numeric" uses mpmath’s complex SVD at dps digits, returns unitary rotations and orders the rows by increasing mass; it needs a square matrix without free symbols. "auto" (default) is numeric for a numeric matrix that is complex, floating-point or larger than 2×2 and symbolic otherwise — the exact route stalls on a generic N > 2 matrix and cannot represent a complex one.

  • dps – working precision of the numeric route (a quark-mass hierarchy spans ~5 orders of magnitude, so keep it well above double).

Returns:

(rot_left, rot_right) Rotation objects (ψ_L → R_L ψ_L, ψ_R → R_R ψ_R).