Closed jacobdwatters closed 8 months ago
This has been partially fixed. However, some real symmetric matrices will still converge to block diagonal form unless the complex Schur form is computed. To avoid this, it should be checked if a 2x2 block on the diagonal can be deflated to real eigenvalues. If so, then deflate the block, otherwise, leave it as a 2x2 block.
With further research, this is not an issue. Using a variant of the QR algorithm for general matrices may cause convergence to block-triangular form even if all eigenvalues are real.
If the true eigenvalues are wanted, the new method com.flag4j.linalg.decompositions.schur.RealSchurDecomposition.real2ComplexSchur()
may be used to obtain a properly upper triangular matrix for the Schur decomposition.
The Schur decomposition sometimes converges to a block triangular form instead of a upper triangular form even when the eigenvalues are real. This block form does appear to be correct but the matrix needs to be deflated to that it is in upper triangular form.
For instance, the following matrix converges to a block diagonal form despite the fact it is symmetric (hence it has real eigenvalues and should converge to a proper diagonal matrix):