1

I don't understand why the Schur's decomposition doesn't work on a complex matrix. My program for testing is :

M <- matrix(data=c(2-1i,0+1i,3-1i,0+1i,1+0i,0+1i,1+0i,1+1i,2+0i), nrow=3, ncol=3, byrow=FALSE)
M 
S <- Schur(M)
S
(S$Q)%*%(S$T)%*%(solve(S$Q))

Results are :

> M 
     [,1] [,2] [,3]
[1,] 2-1i 0+1i 1+0i
[2,] 0+1i 1+0i 1+1i
[3,] 3-1i 0+1i 2+0i
> 
> S <- Schur(M)
Warning message:
In Schur(M) : imaginary parts discarded in coercion
> 
> S
$Q
     [,1]  [,2]   [,3]
[1,]    0 0.500 -0.866
[2,]    1 0.000  0.000
[3,]    0 0.866  0.500

$T
     [,1]  [,2]    [,3]
[1,]    1 0.866  0.5000
[2,]    0 3.732 -2.0000
[3,]    0 0.000  0.2679

$EValues
[1] 1.0000 3.7321 0.2679

> 
> (S$Q)%*%(S$T)%*%(solve(S$Q))
     [,1] [,2] [,3]
[1,]    2    0    1
[2,]    0    1    1
[3,]    3    0    2

So that Q*T*Q^{-1} does not give M back in its true complex form... What code/instructions am I missing, please ?

Andrew
  • 926
  • 2
  • 17
  • 24
  • The function help says that `Schur()` needs `numerical` square matrices. However, you are using it on a `cplx` square matrix, which is then coerced to a numeric one - simply discarding the imaginary part. – Eldioo Nov 11 '17 at 12:18
  • Surely there is a solution to this ; that's what I am inquiring... – Andrew Nov 11 '17 at 14:09

1 Answers1

0

As said in @Eldioo's comment, Matrix::Schur deals only with real matrices. For complex matrices, you can use the QZ package:

library(QZ)
M <- matrix(data=c(2-1i,0+1i,3-1i,0+1i,1+0i,0+1i,1+0i,1+1i,2+0i), 
            nrow=3, ncol=3, byrow=FALSE)
schur <- qz(M)


> all.equal(M, schur$Q %*% schur$T %*% solve(schur$Q))
[1] TRUE
> all.equal(M, schur$Q %*% schur$T %*% t(Conj(schur$Q)))
[1] TRUE
Stéphane Laurent
  • 75,186
  • 15
  • 119
  • 225