First, what I call a orthogonal-like matrix is a matrix which verifies $A^T \times A = diag(n_0,n_1,...,n_k)$ where $n_i$ are real constants. For example, this matrix : $$\left(\begin{array}{ccc} 0 & 5 & 0\\ 0 & 0 & 2\\ 3 & 0 & 0\end{array}\right)$$
I'm currently using QR algorithm to find all eigenvalues of a matrix, but there is a problem with "orthogonal-like" ones : the iterative solution will not converge.
Here is a python script of the QR algorithm :
import numpy as np
a = np.array(((
(0,5,0),
(0,0,2),
(3,0,0)
)))
while 1:
q,r=np.linalg.qr(a)
a = r@q
print('Iterative sol :\n',a.round(6))
input('Hit [Enter] to continue')
So i'm trying to find another solution : either a different algorithm, or a trick to modify this algorithm in order to get an expected solution matrix (with a maximum size of 2 for sub-matrix on the diagonal - representing the complex solution).
All I know for now (not sure, but seems like to me) :
- the R matrix is always diagonal for such matrices.
Thank you for your help!
P.S. An expected solution matrix (for QR algorithm) is for example :
21.3589 -5.6678 10.0809 -2.3429 -5.0900
0 -1.9810 8.7273 -6.2583 -3.8582
0 -5.1169 -1.9810 -0.3539 -1.8999
0 0 0 1.2580 -0.3232
0 0 0 0 4.3450