Closed pkozlows closed 1 year ago
it becomes slower than numpy when I ask it to calculate 10 eig value though. my guess space of vectors is as large as the number of eig values I ask it to compute.
Yup when you increase the total number of eigenvalues you want from the matrices it won't be as efficient as a full diagonalization. It can still be useful, when you ask 10 eigenvalues from e.g. 10,000-dimension matrix.
Hi, again :) Recently, I have been realizing that I need to learn more about the Davidson algorithm, because I am getting a correct lowest eigenvalue, as you probably already know, but when I ask for more eigenvalues, they are not the same as numpy. this is something that I overlooked initially, because I was getting the correct lowest eigenvalue, and I didn't see a deeper problem. Admittedly, trying to implement the Davidson algorithm and then tabbing through its suggestions was not the best learning experience, but then again, you live and you learn.
I need to look at my Davidson implementation before I can ask more pointed questions about it, but The main question that I have been stumped about rn, is regarding your code, where you add the numeral 1 to your guess space, which you call the iteration vectors or search space. Why do you do this if later on the numpy decomposition makes them orthonormal ?
Final question, as I work on the Davidson algorithm. What kind of things should I look for in the sense that I know I can use it to compute the few lowest eigenvalues faster than numpy. But what other things should I look for? My understanding is that it is worth understanding how this algorithm works pretty comprehensively as it is used fairly extensively in quantum chemistry.
I would imagine that if you get the correct lowest eigenvalues, you had a correct implementation, but just the search space or number of iterations is not enough to converge to the correct ones. If it still doesn’t work, well, then we can only make a thorough check on the code and see if they have faithful representation of the original algorithm.
I wouldn’t be really looking into Davidson algorithm or its generalized forms, as there are more critical things in quantum chemistry. It’s not like “I don’t think Davidson algorithm is important”, but at the end of the day we would just resort on some libraries / packages of these algorithms that are implemented even faster, so not a priority anyway.
Does this look about like the time deference you get for a Davidson diagonalization? This is FCI matrix, by the way, and I was just using that Davidson algorithm to solve for the lowest eigenvalue. should I be solving for more than the lowest eigenval? 0.04114818572998: Davidson 0.0952908992767334: Numpy
If you're wondering why this took me so little time, it did take me a bit to read up on the theory behind Davidson, but the actual implementation was very short. A few months ago, when I didn't know what the fuck I was doing, GitHub Copilot probably wasted my time instead of helping me, but now that I've learned to cue it pretty effectively, it is becoming helpful. :)