Closed jonas-pueschel closed 8 months ago
Good catch! With small differences the eigenvalues might not be sorted because they are recomputed after the Rayleigh-Ritz. Does https://github.com/JuliaMolSim/DFTK.jl/pull/964/files fix it?
It seems to work yes! I was not sure if sorting directly here would break something elsewhere :smile:
I don't see what it would break? This is a bit of a hack, a better solution would be to not recompute the eigenvalues but get them from the Rayleigh Ritz
Good catch! With small differences the eigenvalues might not be sorted because they are recomputed after the Rayleigh-Ritz. Does https://github.com/JuliaMolSim/DFTK.jl/pull/964/files fix it?
Yes, this fixes my problem. Thank you very much :)
Hi all,
I currently have a problem using non converging SCF. I'm using ~1-3 steps of SCF in order to improve an initial guess for an iterative method. The problem here is, that the dimensions of
ψ1
andψ2
sometimes differ, making the method fail. This happens around ~30% of the time even for fixedψ1
.Here is a minimal working example.
I've consulted with @gkemlin and he came to the following conclusion: In this case, there is an additional occupied state in the last kpoint of
ψ2
. Inscfres_start.occupation
, we have the following :Here we can see, that 4th state is 0 and the 5th state is filled. This is because the two eigenvalues in
scfres.eigenvalues[7][4:5]
are very close, as seen here:Now for the randomness of this occuring, if you do just one iteration of the SCF, the eigenvalues are sometimes not sorted.
Is this intended behaviour? And if it is, is there any way to avoid this in order to always get a "working"
ψ2
? As the method I'm using is a Riemannian scheme, it is unfortunately not possible to introduce a very small numerical temperature to allow for fractional occupation number, as this destroys the manifold structure of the problem (at least as far as I know).Thanks for your help and best regards, Jonas