The README example currently computes the spectral radius of matrix A using:
A.max().item()
This is mathematically incorrect. The spectral radius ρ(A) is defined as the maximum absolute value of the eigenvalues of A, not the maximum element of the matrix.
Expected Behavior
The spectral radius should be computed as:
The spectral radius rho(A) is defined as the maximum absolute value of the eigenvalues of A i.e rho(A) = max |lambda_i|
Proposed Fix
Update the computation to:
rho = torch.linalg.eigvals(A).abs().max().item()
Impact
- Prevents misleading stability diagnostics in the example
- Aligns documentation with the stated condition ρ(A)<1
- Improves correctness for users referencing the README
The README example currently computes the spectral radius of matrix A using:
A.max().item()
This is mathematically incorrect. The spectral radius ρ(A) is defined as the maximum absolute value of the eigenvalues of A, not the maximum element of the matrix.
Expected Behavior
The spectral radius should be computed as:
The spectral radius rho(A) is defined as the maximum absolute value of the eigenvalues of A i.e rho(A) = max |lambda_i|
Proposed Fix
Update the computation to:
rho = torch.linalg.eigvals(A).abs().max().item()
Impact