Page 1 of 1
SCDM projections + exclude_bands
Posted: Thu Oct 24, 2024 9:37 am
by PatrickJTaylor
Dear VASP developers,
I have just seen (via the "Known Issues" page on the wiki) that the SCDM method currently does not function correctly with the exclude_bands tag in Wannier90.
I assume this means that, regardless of how NUM_WANN and exclude_bands are set, the full density matrix is always considered?
This behavior would explain a lot of the problems I have previously encountered using this methodology. For example, in spin-polarised calculations in which there are more unoccupied spin-down states than unoccupied spin-up states, the SCDM projections for the occupied spin-down states are always worse than those for the occupied spin-up states (presumably because the additional unoccupied spin-down states are being implicitly included via the density matrix).
Is this bug likely to be fixed in a new release anytime soon? If not, is there any chance of a simple patch being provided in the meantime? My FORTRAN knowledge is not really good enough to figure this out myself, but I am keen to get SCDM working with exclude_bands as this is very much required for my use case.
Thanks in advance,
Patrick
Re: SCDM projections + exclude_bands
Posted: Fri Oct 25, 2024 9:31 am
by manuel_engel1
Dear Patrick,
Thanks for reaching out. Unfortunately, you are correct in your assumptions. We currently always consider the full density matrix. I also find it quite likely that the issues you are facing are a direct consequence of this.
This feature is sadly a bit too complex for a simple patch. It requires a refactoring of the SCDM routine and proper testing. However, I have now put it on my to-do list for the upcoming release.
Re: SCDM projections + exclude_bands
Posted: Fri Oct 25, 2024 10:37 am
by PatrickJTaylor
Hi Manuel,
Fair enough, I did think that a hotfix patch was relatively unlikely.
Thank you for putting this on the to-do list for the next release anyway
P.S. Might it be worth updating the wiki in the meantime to explicitly warn users of this behaviour e.g. on the page for the LSCDM tag?
Re: SCDM projections + exclude_bands
Posted: Fri Oct 25, 2024 11:07 am
by manuel_engel1
I will consider the wiki inclusion and see how we usually handle these things. Thanks for the feedback.
Re: SCDM projections + exclude_bands
Posted: Mon Nov 11, 2024 10:16 am
by PatrickJTaylor
Hi Manuel,
If you don't mind, I have another question strongly related to the above:
Even if one cannot formally select a subset of bands via the exclude_bands flag in Wannier90, should it not be possible to achieve the same result by carefully selecting an appropriate (hard) cutoff on the quasi-density matrix?
For example, if I was to:
1. Converge a standard static calculation
2. Rerun with:
LWANNIER90 = .TRUE.
LSCDM = .TRUE.
NUM_WANN = X
CUTOFF_TYPE = num_wann
WANNIER90_WIN = "
...
dis_num_iter = 0
...
"
where X is the number of occupied states in the spin-down channel
3. Run Wannier90 using the mmn, amn and eig files for the spin-down channel (i.e. wannier90.x wannier90.2).
I just tried this method, expecting that this should effectively give me the same result as if I had formally excluded the unoccupied spin-down bands via exclude_bands. Unfortunately, the initial spread after SCDM is still very high, suggesting that there is another problem that I am not picking up on.
To summarise:
1. Am I right in thinking that this workaround is possible and should in theory accomplish the desired result (in my case, effectively excluding the unoccupied states from the Wannierisation)?
2. If I am right, do you have any thoughts on why this method is not working in my case? I am happy to provide my inputs for proper troubleshooting, but I thought it best to check if my understanding is correct before further wasting your time.
Re: SCDM projections + exclude_bands
Posted: Mon Nov 11, 2024 10:58 am
by manuel_engel1
No worries. This is a very good follow-up question. With CUTOFF_TYPE=num_wann, you should indeed be able to introduce the desired cutoff. However, there are a few caveats.
In order to do this consistently for each spin channel, make sure that you do not touch the Kohn-Sham (KS) orbitals when loading the data from the standard self-consistent calculation. To do this, you can read the preconverged KS orbitals from the WAVECAR file and set ALGO=None. This should allow you to get consistent results from LSCDM=True for spin up and spin down in separate runs.
CUTOFF_TYPE=num_wann sets the position of the cutoff function to the energy of the X-th state (where X is the number of occupied states. A short while ago, this was not correctly documented on the wiki. Sorry for any confusion this may have caused). In order to obtain a hard cutoff, you also need to set CUTOFF_SIGMA to a small value.
However, if your occupied and unoccupied states are not well-separated by a band gap (e.g. in case of a metal), a hard cutoff can severely affect the quality of the Wannier orbitals. It's recommended to play around with the CUTOFF_SIGMA parameter in this case.
Re: SCDM projections + exclude_bands
Posted: Mon Nov 11, 2024 2:02 pm
by PatrickJTaylor
Okay great, thank you for getting back to me so quickly
I have just attempted to implement the methodology you outlined above and unfortunately am still running into problems (namely that the SCDM projections are still very bad i.e. highly delocalised).
I have attached the basic inputs/outputs for both the standard scf calculation and the attempted SCDM for the spin-down channel (minus the WAVECARs etc, as these are very large) so that you can see exactly what I have done. It's worth noting that this material does have a band gap, so these problems are definitely not a result of entanglement with unoccupied states.
One problem I have already found myself is that the second calculation (SCDM of the spin-down channel) reports a different energy than the original converged scf calculation, even though I am setting ALGO = None. This would seem to imply that the SCDM calculation is somehow not able to correctly read in the wave functions of the original scf calculation, even though VASP is reportedly doing this according to the OUTCAR.
I would really appreciate some help troubleshooting this as I am at a bit of a dead end.
(If it would be helpful for me to provide any additional information, please let me know.)
Re: SCDM projections + exclude_bands
Posted: Wed Nov 13, 2024 8:47 am
by manuel_engel1
Hi Patrick,
Good news! I ran a simplified version of your calculation and it revealed an underlying bug in the SCDM routine for the ISPIN=2 case. The fix is super simple, so I provide a patch for you to try out. It is attached to this forum post (inside a zip archive, because the forum does not allow me to upload the patch directly). With this fix, I expect the result to be much better, even if exclude_bands is not supported yet.
To apply the patch, navigate to your VASP 6.4.3 root directory and run the following command:
Code: Select all
git apply path-to-patch/scdm.patch
where path-to-patch is where the patch file is located. Afterwards, recompile VASP to incorporate the change made by the patch.
Thanks again for the report. This will make it into the next release.
Re: SCDM projections + exclude_bands
Posted: Wed Nov 13, 2024 3:23 pm
by PatrickJTaylor
Hi Manuel,
Amazing! I just recompiled with the patch and sure enough, problem solved.
Thanks again for all of your help troubleshooting this
Patrick