I have a nonsymmetric real matrix that I want to calculate the eigenvalues and matrices for. I use the torch.eig() method which works.
But my eigenvalues are complex and I am unsure of how to handle this.
I am using the following to go from eigenvalues/vectors and back.
X = torch.rand(20,20)
D,T = torch.eig(X, eigenvectors=True)
T.mm(torch.diag(D)).mm(T.t())

But because D consists of complex eigenvalues, and in PyTorch a complex value is a vector of two values, I am unable to calculate the original matrix again using matrix multiplication. How will I be able to do that? I know torch.diag(D) results in a vector because D is a matrix, but how are you supposed to multiple a complex matrix in PyTorch?