简体   繁体   English

复杂矩阵的Schur分解

[英]Schur decomposition of a complex matrix

I don't understand why the Schur's decomposition doesn't work on a complex matrix. 我不明白为什么Schur分解不能在复杂矩阵上进行。 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 ? 这样Q*T*Q^{-1}不会以真正的复数形式返回M ...请问我缺少什么代码/指令?

As said in @Eldioo's comment, Matrix::Schur deals only with real matrices. 如@Eldioo的评论中所述, Matrix::Schur仅处理真实矩阵。 For complex matrices, you can use the QZ package: 对于复杂矩阵,可以使用QZ包:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM