Problems with bfgs for vc-relax

For a vc-relax (cell_dofree=‘xy') calculation with bfgs optimizer for both ion_dynamics and cell_dynamics, I find that after the 1st scf step, each iteration of the next scf cycle takes too long and the initial estimated scf accuracy of 2nd scf cycle is very bad. For example, here is an output file showing the grep result for estimated scf accuracy:

cat vcrelax-r4.out |grep scf
     estimated scf accuracy    <      12.54418348 Ry
     estimated scf accuracy    <       2.63577135 Ry
     estimated scf accuracy    <       0.94992322 Ry
     estimated scf accuracy    <       0.46945351 Ry
     estimated scf accuracy    <       0.05674024 Ry
     estimated scf accuracy    <       0.01646379 Ry
     estimated scf accuracy    <       0.00326482 Ry
     estimated scf accuracy    <       0.00089067 Ry
     estimated scf accuracy    <       0.00014641 Ry
     estimated scf accuracy    <       0.00004318 Ry
     estimated scf accuracy    <       0.00001006 Ry
     estimated scf accuracy    <       0.00000204 Ry
     estimated scf accuracy    <       0.00000044 Ry
     estimated scf accuracy    <       0.00000017 Ry
     estimated scf accuracy    <       0.00000004 Ry
     estimated scf accuracy    <       0.00000001 Ry
     estimated scf accuracy    <          4.4E-09 Ry
     number of scf cycles    =   1
     estimated scf accuracy    <   51392.78055336 Ry

This problem does not arise with damped dynamics whose initial estimated scf accuracy is better for the 2nd step than the 1st step. I am wondering if there is a problem initializing the charge density/potential/wavefunction for the next scf cycle while using bfgs. In general, I also find that bfgs optimizer takes much large steps (e.g. in one case the celldm(1) increased from 12.48 to 12.59 A in one bfgs step, while using the default trust_radius_max) compared to damped dynamics.

This problem occurs

  • in both 6.6 and 6.4 versions
  • even when I don’t use dipole correction
  • regardless of whether ‘pot_extrapolation’ is none or atomic
  • even when trust_radius_max is set to half the default value
  • not because of a wrong restart, I checked with a fresh outdir directory

I am still investigating this if I can generate a simple example for this error. The input and verbose output files of my case are here: https://gitlab.com/ahzeeshan/qe-issues/-/tree/master/vcrelax-scf

Edited by Zeeshan Ahmad