DedalusProject / eigentools

The Eigentools package for Dedalus
GNU General Public License v3.0
11 stars 10 forks source link

Feature request: matrix of all the good eigenvectors #11

Open afraser3 opened 2 years ago

afraser3 commented 2 years ago

Sometimes I want to do matrix manipulations that involve using a matrix whose columns are various eigenvectors from the EVP solver. A good example can be found here in calc_ps(), specifically lines 399, 402, and 414. If I just do EP.solver.eigenvectors, then those eigenvectors don't necessarily match up with the eigenvalues in EP.evalues, which are the eigenvalues of EP.hires_solver (assuming reject=True). This can cause unintended behavior.

It would be great if I could just get EP.evectors and have that be the eigenvectors that correspond to EP.evalues whether reject=True or reject=False. And in case it's True, I'm thinking it would be great for EP.evectors to be the higher-resolution eigenvectors, but maybe other users have a reason why they'd also want access to the lower-resolution eigenvectors.

afraser3 commented 2 years ago

I have used eigenvectors = ((EP.solver.eigenvectors.T)[EP.evalues_index]).T in the past, which I believe reliably sorts the low-res solver's eigenvectors to line up with EP.evalues. Perhaps this is all there is to it. I guess I'm still worried about differences between the low-res and high-res solvers.