# EXTFPMD SCF Convergence Suggestion

**URL:** <https://discourse.abinit.org/t/extfpmd-scf-convergence-suggestion/3162>\
**Category:** Developing Abinit\
**Created:** [August 15, 2022, 4:53pm UTC](https://discourse.abinit.org/t/extfpmd-scf-convergence-suggestion/3162 "2022-08-15T16:53:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tdaworld](https://discourse.abinit.org/letter_avatar_proxy/v4/letter/t/67e7ee/32.png) [@tdaworld](https://discourse.abinit.org/u/tdaworld)\
**Post date:** [August 15, 2022, 4:53pm UTC](https://discourse.abinit.org/t/extfpmd-scf-convergence-suggestion/3162/1 "2022-08-15T16:53:35Z")

</div>

Hello,

I have been trying out the new [EXTFPMD](https://www.sciencedirect.com/science/article/abs/pii/S0010465521003271) method in abinit v9.6.2. I have noticed that the convergence of the SCF cycle can be difficult for the potential residual when using the method. I would usually converge the potential residual with _tolvrs 1.0d-8_ or _1.0d-9_. But, with the method as implemented the convergence can take a very large number of steps (\>100 sometimes), or sometimes the convergence fails. I implemented the [Zhang 2016](https://aip.scitation.org/doi/10.1063/1.4947212) method in my local copy of abinit v8.10.3 a couple of years ago (equivalent to _useextfpmd 3_). When testing it, I ran into similar convergence problems in the SCF cycle. However, I also found there was a simple solution by using a band buffer (_bdbuff_). One needs to set the occupation numbers of states with _iband \> nband - bdbuff_ to zero. The orbital-free integral contributions then pick up from the eigenenergy of _nband - bdbuff_. Both _nband_ and _bdbuff_ should be stated in the input file as the value of _bdbuff_ for an easy convergence varies a bit depending on the situation, but it’s only be a few bands. If this change is made, then the testing I’ve done suggests the potential residual would converge down as far as it will in a regular crystal calculation (_tolvrs\<1.0d-12_) in much fewer steps, which might be useful for some applications.

I’ve attached the log file and output files files for AE calculations of fcc Al at 200 eV with 100 bands.  
[log\_100b.txt](https://discourse.abinit.org/uploads/short-url/3ECHQTAEAP0CeukIrhVTSDpoXog.txt) (618.3 KB)  
[al100b.abo](https://discourse.abinit.org/uploads/short-url/xasYitA5YYOcPWMowmAoS70xChC.abo) (110.1 KB)  
It compares the convergence (_tolvrs 1.0d-8_) with and without the buffer bands, with the same number of KS states contributing to the quantities. This is the input file for these simulations:  
[al\_conv.in](https://discourse.abinit.org/uploads/short-url/pyzUwgSrP7BGISlvqQuke0UwH6T.in) (1.7 KB)  
I borrowed the input variable _nbdbuf_ for _bdbuff_ for my quick implementation in abi v9.

- Without the buffer, the calculation does not actually converge to the desired degree within 100 steps. The _deltaE(h)_ and _residm_ also reach a limit on how well they can converge.
- In contrast, with the band buffer the convergence is quick (11 steps). _deltaE(h)_ and _residm_ also converge very quickly too.

I also did a second calculation at 300 bands (  
[log\_300b.txt](https://discourse.abinit.org/uploads/short-url/g02z7To56zlkHZiziILfbJ6kCqW.txt) (639.7 KB)  
[al300b.abo](https://discourse.abinit.org/uploads/short-url/7VYuehp7veHoVtNbCQCclUZgg1y.abo) (222.4 KB)  
This time without the band buffer, the calculation did converge in 48 steps. With the buffer, the calculation converged in 10 steps.

If this might be useful for you, I can provide the modified files. (E: thomas.gawne [AT] [physics.ox.ac.uk](http://physics.ox.ac.uk))

Tom

- For clarity, _bdbuff_ is distinct from _extfpmd\_nbcut_, if the latter were to be used.

---

<div class="post-metadata">

**Author:** ![augstb](https://discourse.abinit.org/user_avatar/discourse.abinit.org/augstb/32/732_2.png) [@augstb](https://discourse.abinit.org/u/augstb)\
**Post date:** [September 6, 2022, 12:26pm UTC](https://discourse.abinit.org/t/extfpmd-scf-convergence-suggestion/3162/2 "2022-09-06T12:26:47Z")

</div>

Dear Thomas Gawne,

First of all, thank you very much for your feedback on the implementation of the extended FPMD method in ABINIT. Indeed, as you are pointing at, I already have been confronted to thit kind of SCF convergency issues in the past, even using ` toldfe` convergence criteria.

I successfully implemented your very kind suggestion to bypass this problem, and this should be available with the release of ABINIT v9.10 (as v9.8 is already on its way to release in the next few days). I named the band buffer input variable `extfpmd_nbdbuf`, and added appropriate documentation.

Speaking about this convergence issue, I don’t really understand what is making fluctuating the electron density through successive SCF iterations. I can guess this is due to the U\_0 residual potential (evaluated integrating local part of the KS potential) evaluation also fluctuating with iterations. Maybe we could bypass this issue by slightly modifying the density mixing but this is only a guess.

Finally, I found your proposition can also be useful when trying to simulate orbital free Fermi gas, just by setting `extfpmd_nbdbuf` = `nband`. This can be useful to get the high temperature limit where all electrons are ionized.

Thank you again for your suggestion.  
Best wishes,  
Augustin Blanchet

---

<div class="post-metadata">

**Author:** ![tdaworld](https://discourse.abinit.org/letter_avatar_proxy/v4/letter/t/67e7ee/32.png) [@tdaworld](https://discourse.abinit.org/u/tdaworld)\
**Post date:** [November 9, 2022, 3:09pm UTC](https://discourse.abinit.org/t/extfpmd-scf-convergence-suggestion/3162/3 "2022-11-09T15:09:03Z")

</div>

Hello Augustin,

Thank you for looking into this! Sorry for the long wait for a reply, it’s been a very busy time. I would have to dig through my log books, but if I remember correctly the convergence problem was to due E\_c and U\_0 fluctuating. It’s only an issue when enough electrons are treated as a Fermi gas as the shifting U\_0 will change the electron density and the functionals. That in turn affects the eigenvalues of the upper bands, which in turn affects E\_c and U\_0, etc. However, rather than converging like an SCF cycle, it seems to be unstable, hence the convergence of the calculation is very slow or not possible in some cases. By using this band buffer, the bands that are treated are much more stable. I think this is akin to why _nbdbuf_ is necessary for certain calculations.

I’m glad this was useful and that you’ve managed to find another use for the method.  
Best wishes,  
Tom

---

<div class="post-metadata">

**Author:** ![augstb](https://discourse.abinit.org/user_avatar/discourse.abinit.org/augstb/32/732_2.png) [@augstb](https://discourse.abinit.org/u/augstb)\
**Post date:** [June 28, 2023, 9:47am UTC](https://discourse.abinit.org/t/extfpmd-scf-convergence-suggestion/3162/4 "2023-06-28T09:47:30Z")

</div>

Hello Thomas,

Your suggestion for the band buffer convergence’s fix is now available with the [release of ABINIT 9.10.1](https://www.abinit.org/packages), and is documented in the [ExtFPMD topic](https://docs.abinit.org/topics/ExtFPMD/).  
You are kindly acknowledged in the [release notes](https://docs.abinit.org/about/release-notes/).

Best wishes,  
Augustin
