[Pw_forum] convergence for CaMg2

Giovanni Cantele giovanni.cantele at spin.cnr.it
Tue Nov 3 16:33:35 CET 2015


The issue of what are the best, computationally affordable parameters where to stop convergence tests has to be taken with care, because it depends on what property you need. Indeed, there are some properties that are much more sensitive to wave function / charge density cutoffs and/or k-point grid than others.

Usually, a safe value for the total energy where to stop is at variations <= 1.0D-4 Ry, but maybe some larger ones might be acceptable. Total energy differences (like those used to calculate the cohesive energy of a crystal of surface energy for a slab) converge much more rapidly, whereas other properties (e.g. bulk modulus, phonon frequencies, etc.) might require tighter choices of the parameters. 


Just to give you an idea, I resumed an old convergence test on some pseudo potential, and applied it to Mg.pw91-np-van.UPF (if you try to study the total energy convergence of the two pseudos you use, you realise that the critical one is that of Mg!). What I did is :

i) make scf run of an isolated Mg atom and get the total energy E

ii) make scf (not relax !) of a fictitious isolated Mg2 molecule, with Mg-Mg distance = 2 A) and get total energy E’ and total force F’ (the latter to check convergence of forces).

In the attached plot the first row concerns the variation of the total energy E with respect to the value calculated at ecutrho=16, ecutwfc=150 Ry (E-E0), the yellow rectangle corresponds to the convergence threshold on the total energy I mentioned, that is, 1.0D-4 Ry ~ 1.3 meV.  As you increase ecutrho, you get rid of the oscillations you found and retrieve the expected monotonic behaviour.

The second row concerns the fictitious Mg2 molecule formation energy, that is, [ E(Mg2) - 2 * E(Mg) ] / 2, you can see how such a quantity converges much more rapidly.

The last row concerns the total force of the two Mg atoms in the Mg2 run. The yellow rectangle corresponds to the pw.x convergence threshold on forces (1.0D-3 au, notice that the scale is * 1000), so in this case almost all the ecutwfc values with ecutrho=12, 16 seem to be good candidates.

Of course, I did not check any convergence with respect to the k-point grid, because my results concern isolated atom/molecule (K_POINTS gamma).

Giovanni

PS even though different pseudo potentials are never comparable and might give convergence results at completely different values of ecutwfc/ecutrho, just to give you an idea the pseudo Mg.pw91-spn-rrkjus_psl.1.0.0.UPF included in pslibray 1.0.0 suggests as minimum ecutwfc and ecutrho the values 97 Ry and 398 Ry ~ 4 * 97 Ry respectively





> On 25 Oct 2015, at 14:35, adwait mevada <adwait.mevada at gmail.com> wrote:
> 
> Dear Giovanni,
> As per your suggestion I performed calculations with ecutrho 8 times ecutwfc, obtaining following results
> 30     -932.77949435      1314.9516     40   459.04   7m51.69s  
> 40     -932.78411921      1314.9516     40   459.17  12m10.64s  
> 50     -932.78290292      1314.9516     40   458.79  16m20.76s  
> 60     -932.78405904      1314.9516     40   458.76  20m21.45s  
> 70     -932.78361561      1314.9516     72   458.85  57m33.02s  
> 80     -932.78379443      1314.9516     40   458.68  32m52.95s  
> 90     -932.78384952      1314.9516     40   458.90  39m24.40s  
> 100     -932.78383671      1314.9516     40   458.73  43m 3.29s  
> 110     -932.78386666      1314.9516     40   458.83  47m23.76s  
> 120     -932.78385073      1314.9516     40   458.81  58m39.28s  
> 130     -932.78388792      1314.9516     40   458.74      1h 5m  
> 140     -932.78391298      1314.9516     40   458.82      1h12m  
> 150     -932.78388192      1314.9516     40   458.80      1h21m  
> The fluctuations are still there but now less in comparisions (see graph)
> Right now I am testing for 10x to see if fluctations reduce.
> From graph of 8x plot I feel ecutwfc=70 Ry and ecutrho=560 Ry seems
> a good candidate for convergence. But it has higher number of Kpoints
> compared to ecutwfc=80 Ry and also consumes more time
> what do you suggest or will data from 10x run be more conclusive?
> 
> Thanks for your help.
> 
> Adwait Mevada,
> Ph.D. Student,
> Gujarat University,
> Gujarat, India.
> 
> On Fri, Oct 23, 2015 at 9:09 PM, adwait mevada <adwait.mevada at gmail.com> wrote:
> Dear Giovanni,
> Thanks for the prompt response, I will do as you suggested.
> The above data was obtained without fixing ecutrho to480 (it was commented) . I felt that may be a lower kpoint grid or wrong smearing might be the source.
> I will do as you suggested and get back to you.
> Thanks again.
> Adwait
> Ph.D. Student,
> Gujarat University,
> Gujarat, India.
> 
> On 23-Oct-2015 8:56 pm, "Giovanni Cantele" <giovanni.cantele at spin.cnr.it> wrote:
> one of the problems that you might be running across is that you keep ecutrho fixed. That means that with ecutwfc=30, ecutrho/ecutwfc=16, whereas with ecutwfc=120, the same ratio is 4. The latter is definitely too small for ultrasoft pseudo potentials, that you are including in your calculation. In other words, you might be comparing values of the total energies with different convergence levels with respect to ecutrho, which can be the origin (or a partial explanation) of the oscillations you find.
> 
> I would try (maybe this will not solve your problem!) to retry the test as a function of ecutwfc, as you did, but keeping the ecutrho/ecutwfc ratio (rather than the ecutrho variable) constant, to a more or less safe value (e.g. 8).
> 
> Giovanni
> 
> > On 23 Oct 2015, at 17:05, adwait mevada <adwait.mevada at gmail.com> wrote:
> >
> > Dear All,
> > I am trying to find optimal ecutwfc for CaMg2.
> > As a first step i varied ecutwfc from 30-150 but i found that
> > energy was fluctuating
> > I cannot decide what to set for ecutrho if my ecutwfc is fluctuating
> > , what can be the reason for this? any help in this regard is appreciated.
> >
> > note : i am not finding ecutwfc for equilibrium volume.
> >
> > I am attaching png output of gnuplot for it.
> >
> > data for various ecutwfc
> > ecut    energy                 vol              kpoints  stress  time.
> > 30     -932.78387473      1314.9516     40   459.00   7m 4.75s
> > 40     -932.78292968      1314.9516     40   458.52  10m35.69s
> > 50     -932.78368793      1314.9516     40   458.74  14m22.97s
> > 60     -932.78388413      1314.9516     40   458.90  17m48.05s
> > 70     -932.78547210      1314.9516     40   457.91  25m37.98s
> > 80     -932.78563717      1314.9516     40   459.77  29m17.84s
> > 90     -932.78419457      1314.9516     40   459.42  35m28.98s
> > 100     -932.78387315      1314.9516     40   458.78  37m40.76s
> > 110     -932.78425940      1314.9516     40   458.38  41m34.44s
> > 120     -932.78459959      1314.9516     40   458.94  52m35.88s
> > 130     -932.78422725      1314.9516     72   459.24      2h 0m
> > 140     -932.78394222      1314.9516     72   458.91      2h 3m
> > 150     -932.78396419      1314.9516     72   458.69      2h30m
> > my input file is:
> > C=9
> > A=5
> > for ECUT in 30 40 50 60 70 80 90 100 ; do
> > cat > camg2e$ECUT.in << EOF
> >  &control
> >     calculation = 'scf'
> >     prefix='camg2e$ECUT',
> >     tstress = .true.
> >     tprnfor = .true.
> >  /
> >  &system
> >     ibrav=4, a=$A ,c=$C ,nat=12, ntyp=2,
> >     ecutwfc=$ECUT ! ,ecutrho=480,
> >     occupations='smearing',smearing="mv",degauss=0.02,
> >  /
> >  &electrons
> >     diagonalization='david'
> >     mixing_mode = 'plain'
> >     mixing_beta = 0.7
> >     conv_thr =  1.0d-8
> >  /
> > ATOMIC_SPECIES
> >  Mg  24.305  Mg.pw91-np-van.UPF
> >  Ca  40.078  Ca.pw91-nsp-van.UPF
> > ATOMIC_POSITIONS crystal
> > Ca      0.3333333   0.6666667   0.0668052
> > Ca      0.3333333   0.6666667   0.4331948
> > Ca      0.6666667   0.3333333   0.5668053
> > Ca      0.6666667   0.3333333   0.9331947
> > Mg      0.0000000   0.0000000   0.0000000
> > Mg      0.0000000   0.0000000   0.5000000
> > Mg      0.3397683   0.1698842   0.2500000
> > Mg      0.8301158   0.6602317   0.2500000
> > Mg      0.1698842   0.8301158   0.7500000
> > Mg      0.8301158   0.1698842   0.2500000
> > Mg      0.1698842   0.3397683   0.7500000
> > Mg      0.6602317   0.8301158   0.7500000
> > K_POINTS automatic
> > 8 8 4 1 1 1
> > EOF
> > mpirun -np 4   pw.x -in camg2e$ECUT.in > camg2e$ECUT.out
> >    ENERGY=`grep ! camg2e$ECUT.out | cut -b 33-49`
> >    VOL=`grep volume camg2e$ECUT.out | cut -b 33-45 `
> >    KP=`grep points= camg2e$ECUT.out | cut -b 25-31`
> >    TIME=`grep "PWSCF  " camg2e$ECUT.out | cut -b 37-47`
> >    STRESS=`grep "total   stress" camg2e$ECUT.out | cut -b 72-78`
> >    FOR=`grep "Total force  " camg2e$ECUT.out`
> >    echo "$ECUT $ENERGY $ALAT $VOL $KP $STRESS $TIME $FOR"
> > sleep 60
> >    echo "$ECUT $ENERGY $ALAT $VOL $KP $STRESS $TIME $FOR" >> camg2r480.dat
> > done
> >
> > Thank you for your help in advance
> >
> > --
> > -Adwait
> > Ph.D. Student,
> > Gujarat University,
> > Gujarat, India.
> > <camg2ecut.png>_______________________________________________
> > Pw_forum mailing list
> > Pw_forum at pwscf.org
> > http://pwscf.org/mailman/listinfo/pw_forum
> 
> --
> 
> Giovanni Cantele, PhD
> CNR-SPIN
> c/o Dipartimento di Fisica
> Universita' di Napoli "Federico II"
> Complesso Universitario M. S. Angelo - Ed. 6
> Via Cintia, I-80126, Napoli, Italy
> e-mail: giovanni.cantele at spin.cnr.it
> Phone: +39 081 676910
> Skype contact: giocan74
> 
> ResearcherID: http://www.researcherid.com/rid/A-1951-2009
> Web page: http://people.na.infn.it/~cantele
> 
> 
> 
> _______________________________________________
> Pw_forum mailing list
> Pw_forum at pwscf.org
> http://pwscf.org/mailman/listinfo/pw_forum
> 
> 
> 
> -- 
> -Adwait 
> 'I Wonder!...The Empty Cup'
> 
> On Fri, Oct 23, 2015 at 9:09 PM, adwait mevada <adwait.mevada at gmail.com> wrote:
> Dear Giovanni,
> Thanks for the prompt response, I will do as you suggested.
> The above data was obtained without fixing ecutrho to480 (it was commented) . I felt that may be a lower kpoint grid or wrong smearing might be the source.
> I will do as you suggested and get back to you.
> Thanks again.
> Adwait
> Ph.D. Student,
> Gujarat University,
> Gujarat, India.
> 
> On 23-Oct-2015 8:56 pm, "Giovanni Cantele" <giovanni.cantele at spin.cnr.it> wrote:
> one of the problems that you might be running across is that you keep ecutrho fixed. That means that with ecutwfc=30, ecutrho/ecutwfc=16, whereas with ecutwfc=120, the same ratio is 4. The latter is definitely too small for ultrasoft pseudo potentials, that you are including in your calculation. In other words, you might be comparing values of the total energies with different convergence levels with respect to ecutrho, which can be the origin (or a partial explanation) of the oscillations you find.
> 
> I would try (maybe this will not solve your problem!) to retry the test as a function of ecutwfc, as you did, but keeping the ecutrho/ecutwfc ratio (rather than the ecutrho variable) constant, to a more or less safe value (e.g. 8).
> 
> Giovanni
> 
> > On 23 Oct 2015, at 17:05, adwait mevada <adwait.mevada at gmail.com> wrote:
> >
> > Dear All,
> > I am trying to find optimal ecutwfc for CaMg2.
> > As a first step i varied ecutwfc from 30-150 but i found that
> > energy was fluctuating
> > I cannot decide what to set for ecutrho if my ecutwfc is fluctuating
> > , what can be the reason for this? any help in this regard is appreciated.
> >
> > note : i am not finding ecutwfc for equilibrium volume.
> >
> > I am attaching png output of gnuplot for it.
> >
> > data for various ecutwfc
> > ecut    energy                 vol              kpoints  stress  time.
> > 30     -932.78387473      1314.9516     40   459.00   7m 4.75s
> > 40     -932.78292968      1314.9516     40   458.52  10m35.69s
> > 50     -932.78368793      1314.9516     40   458.74  14m22.97s
> > 60     -932.78388413      1314.9516     40   458.90  17m48.05s
> > 70     -932.78547210      1314.9516     40   457.91  25m37.98s
> > 80     -932.78563717      1314.9516     40   459.77  29m17.84s
> > 90     -932.78419457      1314.9516     40   459.42  35m28.98s
> > 100     -932.78387315      1314.9516     40   458.78  37m40.76s
> > 110     -932.78425940      1314.9516     40   458.38  41m34.44s
> > 120     -932.78459959      1314.9516     40   458.94  52m35.88s
> > 130     -932.78422725      1314.9516     72   459.24      2h 0m
> > 140     -932.78394222      1314.9516     72   458.91      2h 3m
> > 150     -932.78396419      1314.9516     72   458.69      2h30m
> > my input file is:
> > C=9
> > A=5
> > for ECUT in 30 40 50 60 70 80 90 100 ; do
> > cat > camg2e$ECUT.in << EOF
> >  &control
> >     calculation = 'scf'
> >     prefix='camg2e$ECUT',
> >     tstress = .true.
> >     tprnfor = .true.
> >  /
> >  &system
> >     ibrav=4, a=$A ,c=$C ,nat=12, ntyp=2,
> >     ecutwfc=$ECUT ! ,ecutrho=480,
> >     occupations='smearing',smearing="mv",degauss=0.02,
> >  /
> >  &electrons
> >     diagonalization='david'
> >     mixing_mode = 'plain'
> >     mixing_beta = 0.7
> >     conv_thr =  1.0d-8
> >  /
> > ATOMIC_SPECIES
> >  Mg  24.305  Mg.pw91-np-van.UPF
> >  Ca  40.078  Ca.pw91-nsp-van.UPF
> > ATOMIC_POSITIONS crystal
> > Ca      0.3333333   0.6666667   0.0668052
> > Ca      0.3333333   0.6666667   0.4331948
> > Ca      0.6666667   0.3333333   0.5668053
> > Ca      0.6666667   0.3333333   0.9331947
> > Mg      0.0000000   0.0000000   0.0000000
> > Mg      0.0000000   0.0000000   0.5000000
> > Mg      0.3397683   0.1698842   0.2500000
> > Mg      0.8301158   0.6602317   0.2500000
> > Mg      0.1698842   0.8301158   0.7500000
> > Mg      0.8301158   0.1698842   0.2500000
> > Mg      0.1698842   0.3397683   0.7500000
> > Mg      0.6602317   0.8301158   0.7500000
> > K_POINTS automatic
> > 8 8 4 1 1 1
> > EOF
> > mpirun -np 4   pw.x -in camg2e$ECUT.in > camg2e$ECUT.out
> >    ENERGY=`grep ! camg2e$ECUT.out | cut -b 33-49`
> >    VOL=`grep volume camg2e$ECUT.out | cut -b 33-45 `
> >    KP=`grep points= camg2e$ECUT.out | cut -b 25-31`
> >    TIME=`grep "PWSCF  " camg2e$ECUT.out | cut -b 37-47`
> >    STRESS=`grep "total   stress" camg2e$ECUT.out | cut -b 72-78`
> >    FOR=`grep "Total force  " camg2e$ECUT.out`
> >    echo "$ECUT $ENERGY $ALAT $VOL $KP $STRESS $TIME $FOR"
> > sleep 60
> >    echo "$ECUT $ENERGY $ALAT $VOL $KP $STRESS $TIME $FOR" >> camg2r480.dat
> > done
> >
> > Thank you for your help in advance
> >
> > --
> > -Adwait
> > Ph.D. Student,
> > Gujarat University,
> > Gujarat, India.
> > <camg2ecut.png>_______________________________________________
> > Pw_forum mailing list
> > Pw_forum at pwscf.org
> > http://pwscf.org/mailman/listinfo/pw_forum
> 
> --
> 
> Giovanni Cantele, PhD
> CNR-SPIN
> c/o Dipartimento di Fisica
> Universita' di Napoli "Federico II"
> Complesso Universitario M. S. Angelo - Ed. 6
> Via Cintia, I-80126, Napoli, Italy
> e-mail: giovanni.cantele at spin.cnr.it
> Phone: +39 081 676910
> Skype contact: giocan74
> 
> ResearcherID: http://www.researcherid.com/rid/A-1951-2009
> Web page: http://people.na.infn.it/~cantele
> 
> 
> 
> _______________________________________________
> Pw_forum mailing list
> Pw_forum at pwscf.org
> http://pwscf.org/mailman/listinfo/pw_forum
> 
> 
> 
> -- 
> -Adwait 
> 'I Wonder!...The Empty Cup'
> _______________________________________________
> Pw_forum mailing list
> Pw_forum at pwscf.org
> http://pwscf.org/mailman/listinfo/pw_forum

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/users/attachments/20151103/aa624b83/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Mg.pw91-np-van.UPF.convergence.png
Type: image/png
Size: 92868 bytes
Desc: not available
URL: <http://lists.quantum-espresso.org/pipermail/users/attachments/20151103/aa624b83/attachment.png>


More information about the users mailing list