feynlag.vacuum.diagonalize.diagonalize_svd

feynlag.vacuum.diagonalize.diagonalize_svd(M, left_fields, right_fields, new_left, new_right)[source]

Singular-value decomposition for a Dirac mass matrix.

Finds rotations with U_L M U_Rᵀ = diag(m_i ≥ 0): U_L diagonalizes M Mᵀ and U_R diagonalizes Mᵀ M (real M; complex Yukawas can be handled numerically at export time). Right-handed rows are sign-fixed so the masses come out non-negative.

Returns:

(rot_left, rot_right) Rotation objects (ψ_L → U_L ψ_L, ψ_R → U_R ψ_R).