Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZDRM: Support for Eigenvalue Decomposition #93

Open
rstrauss-logyx opened this issue Oct 3, 2020 · 1 comment
Open

ZDRM: Support for Eigenvalue Decomposition #93

rstrauss-logyx opened this issue Oct 3, 2020 · 1 comment

Comments

@rstrauss-logyx
Copy link

How do I get complex eigen values and vectors, like MatLab creates?

I tried using SimpleMatrix, but it assumes the matrix is either double or float.
Can this be fixed, quickly?
Or can you recommend another library? (jblas also doesn't have this)
thx...

getEigen(int n, ZMatrixRMaj hamiltonian) {
SimpleMatrix s = new SimpleMatrix(hamiltonian);
eigens = s.eig();

java.lang.ClassCastException: org.ejml.data.ZMatrixRMaj cannot be cast to org.ejml.data.FMatrixRMaj
org.ejml.dense.row.decomposition.eig.SwitchingEigenDecomposition_FDRM.decompose(SwitchingEigenDecomposition_FDRM.java:36)
at org.ejml.simple.SimpleEVD.(SimpleEVD.java:56)
at org.ejml.simple.SimpleBase.eig(SimpleBase.java:949)

@lessthanoptimal
Copy link
Owner

Unfortunately Eigenvalue Decomposition is not fully implemented yet for complex matrices. I did update the code so that it gives a slightly more informative error message.

It's very rare that I need to mess with complex matrices so I'm not sure what others might support it. I believe the C++ library Eigen supports it, so maybe check JEigen?

@lessthanoptimal lessthanoptimal changed the title can't get complex eigenvector and eigenvalues ZDRM: Support for Eigenvalue Decomposition Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants