Page 1 of 1

ISTART=2 plane wave coefficients changed error

Posted: Mon Oct 18, 2010 6:35 pm
by bernstei
I'm using VASP 5.2.8, trying to do a sequence of calculations (each single point, energy, force, stress), with slightly different unit cell vectors, starting from the previous one's WAVECAR. I want them all to use the same basis (so I can do finite differences accurately), so I'm trying to use ISTART=2, but I get a "plane wave coefficients changed" error.

I've looked through the source code, and I think I can trace the problem to the fact that GEN_INDEX uses the original lattice (BI) to calculate which plane waves are within the cutoff and compute WDES%NPLWKP (wave.F line 1974), while REPAD_INDEX_ARRAY compares that number to NP_ with it calculates using the current lattice B (it separately computes NPI_ using BI). This looks like it will break practically any attempt to use ISTART=2 between different runs of the program (within the MD/minimization loop things are somewhat different).

Am I right, and this is a bug? Any ideas on how to fix it?

thanks,
Noam Bernstein

ISTART=2 plane wave coefficients changed error

Posted: Fri Oct 29, 2010 11:15 am
by admin
ISTART = 2 requrires absolutenly compatible basis functions, including the unit cell (--> lengths of the basis vectors in the reciprocal cell and hence the number of vectors in the cutoff sphere).
if your cell has changed (even slightly), please start from ISTART =1 or set NGX,... explicitely (please note that this will however slightly change the level of accuracy)

ISTART=2 plane wave coefficients changed error

Posted: Tue Nov 30, 2010 8:26 pm
by bernstei
In that case, what's the point of ISTART=2? As the manual says, if the cell hasn't changed, ISTART=1 and ISTART=2 give exactly the same result.

In any case, I now have a patch that implements my changes (changing nothing if ISTART=1), and seems to work fine for me. Shall I post it?

Also, there's definitely a clear (and related) bug in main.F. It passes ISTART, which isn't even a real variable, to INWAV_FAST(), instead of passing INFO%ISTART.

ISTART=2 plane wave coefficients changed error

Posted: Thu Dec 30, 2010 1:18 pm
by admin
if ISTART = 1, the coefficents of of WAVECAR are adjusted to a possibly different unit cell, which is NOT the case for ISTART = 2
(hence, for absolutely consistent cell shapes and sizes, the results have to be the same for both, 1 and 2, because no readjustment has to be done, even for ISTART =1 )

ISTART=2 plane wave coefficients changed error

Posted: Wed Jan 05, 2011 5:14 pm
by bernddoser
I have a similar problem with istart=2. I'm using VASP 5.2.11 calculating energies and forces and use an external minimizer for structure optimizations. Therefore the istart=2 option is very important to circumvent discontinuously energy changes. Using dft functionals without exact exchange the restart works fine. But using exact exchange, e.g. PBE0, the error message "number of G-vectors changed" occurs.
<span class='smallblacktext'>[ Edited Thu Jan 06 2011, 08:22AM ]</span>

Re: ISTART=2 plane wave coefficients changed error

Posted: Sat Jun 13, 2015 5:07 pm
by avdw
I am using vasp 5.3 and I have also noticed that the ISTART=2 option does not work as described in the manual.
I looked at the source code and it seems that VASP is trying to do some sophisticated repadding even for ISTART=2. The code is also checking if the number of plane waves is the same within the energy cutoff with the old and new unit cell. This can only happen if the cell size has not changed! But then, as someone else pointed out, what is the point of ISTART=2? For the same cell, ISTART=1 and ISTART=2 would do the same!

ISTART=2 should simply reload the existing WAVECAR and continue with the same basis set even if the "sphere" of all included plane wave is now an ellipsoid.
I would really like this to be possible because I am using an outside optimizer and would really like the energies to be a smooth function of lattice parameters.
Thanks for any help you could provide!

(P.S. I have been using vasp for over 15 years. It is a great code, but the quirk above is currently preventing me from using it for my current project.)

Re: ISTART=2 plane wave coefficients changed error

Posted: Sat Jun 13, 2015 11:18 pm
by avdw
Hi: I am also experiencing problems with ISTART=2 . The point of this option should be to allow one to restart the code when the cell size has changed and keep the same (although distorted) choice of planewaves as in the WAVECAR. Looking at the code, it seems that even with ISTART=2, the code attempts to perform some sophisticated repadding instead of just reading in the WAVECAR data as it is. The repadding routine returns an error code as soon as the maximum kinetic energies of the planewaves differ between the WAVECAR and current re-optimized planewaves. This would occur almost every time the cell shape changes. If ISTART=2 only works for constant cell shape, then it is equivalent to ISTART=1!

Would it be possible to allow for the easy-to-implement behavior of just reading the WAVECAR without trying to repad?
Has anyone done this?

(P.S. I have been a vasp user for 15 years. I found it very useful, but this issue is currently stopping me: I am using an external optimizer and the constant-basis set restart is essential.)

Re: ISTART=2 plane wave coefficients changed error

Posted: Fri Jun 19, 2015 3:22 pm
by avdw
I have found a work-around for this problem: Use ISTART = 1 but force the values of NGX NGY NGZ to be the same as the previous run (you can grep them from the OUTCAR). There is small penalty upon re-reading (because the code attempts to do sophisticated re-padding that is actually not necessary), but the solution achieves the main desired effect: the energies will be a smooth function of strain. FYI, I have included a script that automates this in the ATAT software package
http://alum.mit.edu/www/avdw/atat/
The ezvasp script will intercept ISTART = 2 and replace it by ISTART=1 and set NGX NGY NGZ to the value of the available OUTCAR.
Enjoy,
-Axel