Page 1 of 1

The eror from the trial wave function from Quantum espresso

Posted: Tue Oct 18, 2016 6:27 am
by Nguyen_Oanh
Dear all user!
I am studying about 2H-TaSe2 that using Casino program to calculate binding energy and charge density or structure factor. I have problems in running. I hope that you can help me.
I test for 4x4x1 cell.
1. Problem from the mismatch kinetic energy from the trial wave function ( Probably some kind of state occupation problem
(inevitable if using fractional occupation in the DFT)) -- have I create the wrong blip funtion? kpoint 4x4x1.
2. ERROR : CHECK_KPOINTS
The k vectors should lie on a grid of simulation-cell reciprocal lattice
vectors, where the grid may be offset from the origin. But k vectors 1 and 7
are not separated by a simulation-cell reciprocal-lattice vector. Please
check that the NPCELL block in the input file is set to specify the
appropriate simulation supercell. .
how to fix these errors?
3. I want to calculate for structure factor and density of charge , I read in manual, but I don't understand. How to the way to determine these value?
Your sincerely!

Re: The eror from the trial wave function from Quantum espre

Posted: Tue Oct 18, 2016 8:06 am
by Katharina Doblhoff
Dear Nguyen_Oanh,

concerning 1.), you are right: the smearing can have a considerable influence. Which code are you using to generate your wavefunction? Pwscf?
For this and other reasons, I use a private version of the PW/src/pw2casino_write.f90 (see below -the fixes are for pwscf 3.1, which actually, without some of the fixes, gives nonsense)
now to 2.): What k-point grid do you use? How do you generate it? This sounds as if your k-point grid was nonsense.

Code: Select all


30c30
<    USE io_files, ONLY: nd_nmbr, nwordwfc, iunwfc, prefix, tmp_dir, seqopn
---
>    USE io_files, ONLY: nd_nmbr, nwordwfc, iunwfc, prefix, tmp_dir, seqopn, psfile
54c54
<    REAL(DP) :: ek, eloc, enl
---
>    REAL(DP) :: ek, eloc, enl, ek_nosmearing
55a56,57
>    CHARACTER (len=2), EXTERNAL :: atom_name
>    CHARACTER(len=1), external :: lowercase
339a342
>       ek_nosmearing = 0.d0
366c369,372
<             CALL get_buffer (evc, nwordwfc, iunwfc, ikk )
---
>             !changed by KDD 2014-12-15 from
>             !CALL get_buffer (evc, nwordwfc, iunwfc, ikk )
>             !to the following according to instructions from Mike Towler
>             IF ( nks > 1 ) CALL get_buffer (evc, nwordwfc, iunwfc, ikk )
390a397,408
>                !
>                ! Calculate kinetic energy without smearing for comparison in vmc (round to full occup)
>                !
>                DO j = 1, npw
>                   IF(gamma_only)THEN !.and.j>1)then
>                      ek_nosmearing = ek_nosmearing +  2*conjg(evc(j,ibnd)) * evc(j,ibnd) * &
>                                     g2kin(j) * dble(nint(wg(ibnd,ikk)))
>                   ELSE
>                      ek_nosmearing = ek_nosmearing +  conjg(evc(j,ibnd)) * evc(j,ibnd) * &
>                                     g2kin(j) * dble(nint(wg(ibnd,ikk)))
>                   ENDIF
>                ENDDO
436a455,456
>       CALL mp_sum( ek_nosmearing,    intra_pool_comm )
>       CALL mp_sum( ek_nosmearing,    inter_pool_comm )
441a462
>       ek_nosmearing = ek_nosmearing * tpiba2
466a488
>       WRITE (stdout,*) 'Kinetic energy disregarding smearing  ', ek_nosmearing/e2, ' au  =  ', ek_nosmearing, ' Ry'
620c642
<       ENDDO ! k
---
>       ENDDO ! k
634a657,691
>       INTEGER :: typion(ntyp)
>       CHARACTER (len=2) :: atname
>       CHARACTER (len=11) :: casname="xxx_pp.data"
>
>       typion=0
>       DO nt = 1, ntyp
>          DO j = 1, nt-1
>             IF (atomic_number(trim(atm(j))).eq.atomic_number(trim(atm(nt)))) typion(nt)=typion(nt)+1000
>             IF (typion(nt).ge.10000) THEN
>                WRITE(stdout,*) "Too many different atomtypes for one atomic number."
>                WRITE(stdout,*) "Cannot convert correctly to casino format."
>                RETURN
>             ENDIF
>          ENDDO
>       ENDDO
>
>       WRITE(stdout, *) "Assign the ",ntyp, " PPs used in casino the following way:"
>       WRITE(stdout, *) "type",char(9), "filename of pwscf PP", char(9), "filename of corresponding casiono PP"
>       WRITE(stdout,*) "------------------------------------------------------------------------"
>       DO nt=1,ntyp
>          atname=atom_name(atomic_number(trim(atm(nt))))
>          atname(1:1)=lowercase(atname(1:1))
>          atname(2:2)=lowercase(atname(2:2))
>          IF (int(typion(nt)).ne.0)  THEN
>             casname(1:2)=atname(1:2)
>             WRITE(casname(3:3), '(I1.1)') int(typion(nt)/1000)+1
>          ELSE
>             WRITE(casname(1:1), *) " "
>             casname(2:3)=atname(1:2)
>          ENDIF
>          WRITE(stdout, *) trim(atm(nt)),char(9), trim(psfile(nt)), char(9), casname
>       ENDDO
>       WRITE(stdout,*)
>
>
707c764
<             (atomic_number(trim(atm(ityp(na)))),na=1,nat) ,&
---
>             (atomic_number(trim(atm(ityp(na))))+typion(ityp(na))+200,na=1,nat),&
790c847
<          WRITE(io,'(i6,3f20.14)') at_num, (alat*tau(j,na),j=1,3)
---
>          WRITE(io,'(i6,3f20.14)') at_num+typion(nt)+200, (alat*tau(j,na),j=1,3)

Re: The error from the trial wave function from Quantum espr

Posted: Tue Oct 18, 2016 8:51 am
by Nguyen_Oanh
Dear Katharina!
Thank you for your quick response. Yes, i use PWscf for calculating the trial wave function with smearing.
I create k-point automatically from the PW calculation, I supply grid in input file of QE (4x4x1).
Here is the input file that I used in QE and the out file from QE.
So, How can I fix these problem?
Thank you! Sorry because I can not attach input file.

" &control
calculation = 'scf',
restart_mode = 'from_scratch',
prefix = '2H-TaSe2',
pseudo_dir = '/home/__others/onguyen/espresso-5.4.0/pseudo/',
outdir='/home/__others/onguyen/espresso-5.4.0/OUT/',
/
&system
ibrav = 4,
celldm(1) = 6.48,
celldm(3) = 6.74,
nat = 3,
ntyp = 2,
ecutwfc =50,
nbnd = 10,
occupations = 'smearing',
smearing = 'gaussian',
degauss = 0.001,
starting_magnetization(1) = 0.1d0,
exxdiv_treatment = 'none'
ecutvcut = 0.0,
x_gamma_extrapolation = .FALSE.
/
&electrons
diagonalization='cg'
mixing_beta = 0.7,
conv_thr = 1.0d-6,
electron_maxstep = 500,
/
ATOMIC_SPECIES
Ta 180.94 Ta.pbe-hgh.UPF
Se 78.97 Se.pbe-hgh.UPF
ATOMIC_POSITIONS {angstrom}
Ta 0 0 0.25000000
Se 0.33333333 0.33333333 0.62500000
Se 0.33333333 0.33333333 0.27500000
K_POINTS AUTOMATIC
4 4 1 1 1 1"

Re: The eror from the trial wave function from Quantum espre

Posted: Tue Oct 18, 2016 8:53 am
by Katharina Doblhoff
When you are at it, could you also attach the input file for casino and possibly the pwscf output file (or at least the section where it outputs the k points)

Re: The eror from the trial wave function from Quantum espre

Posted: Tue Oct 18, 2016 9:10 am
by Nguyen_Oanh
Here is input file in CASINO and the output file in QE.
You can see below

Re: The eror from the trial wave function from Quantum espre

Posted: Tue Oct 18, 2016 9:13 am
by Nguyen_Oanh
Sorry because I can't attach file. I don't understand why!
You can see below[/quote]
" #-------------------#
# CASINO input file #
#-------------------#

# 2H-TaSe2 (Gaussian basis)

# SYSTEM
neu : 144 #*! Number of up electrons (Integer)
ned : 128 #*! Number of down electrons (Integer)
periodic : T #*! Periodic boundary conditions (Boolean)
atom_basis_type : blip #*! Basis set type (Text)
%block npcell
4 4 1
%endblock npcell
psi_s : slater #*! Type of [anti]symmetrizing wfn (Text)
complex_wf : F #*! Wave function real or complex (Boolean)

# RUN
runtype : vmc_opt #*! Type of calculation (Text)
newrun : T #*! New run or continue old (Boolean)
testrun : F #*! Test run flag (Boolean)

# VMC
vmc_equil_nstep : 10000 #*! Number of equilibration steps (Integer)
vmc_nstep : 10000 #*! Number of steps (Integer)
vmc_nblock : 1 #*! Number of checkpoints (Integer)
vmc_nconfig_write : 10000 #*! Number of configs to write (Integer)

# DMC
dmc_equil_nstep : 2000 #*! Number of steps (Integer)
dmc_equil_nblock : 1 #*! Number of checkpoints (Integer)
dmc_stats_nstep : 10000 #*! Number of steps (Integer)
dmc_stats_nblock : 1 #*! Number of checkpoints (Integer)
dmc_target_weight : 1000.d0 #*! Total target weight in DMC (Real)
dtdmc : 0.01 #*! DMC time step (Real)
use_tmove : F #*! Casula nl pp for DMC (Boolean)

# RMC

# OPTIMIZATION
opt_method : varmin #*! Opt method (varmin/madmin/emin/...)
opt_cycles : 6 #*! Number of optimization cycles (Integer)
opt_jastrow : T #*! Optimize Jastrow factor (Boolean)
opt_det_coeff : F #*! Optimize determinant coeffs (Boolean)
opt_backflow : F #*! Optimize backflow parameters (Boolean)
opt_orbitals : F #*! Optimize orbital parameters (Boolean)

# GENERAL PARAMETERS
use_jastrow : T #*! Use a Jastrow function (Boolean)
backflow : F #*! Use backflow corrections (Boolean)
expot : F #*! Use external potential (Boolean)
timing_info : F #*! Activate subroutine timers (Boolean)
esupercell : F #*! Energy/supercell in output (Boolean)
neighprint : 0 #*! Neighbour analysis (Integer)
mpc_cutoff : 30.d0 hartree #*! G vector cutoff for MPC (Physical)
interaction : ewald #*! Interaction type (Text)
finite_size_corr : F #*! Eval. finite size correction (Boolean)
forces : F #*! Evaluate forces on atoms (Boolean)
checkpoint : 1 #*! Checkpoint level (Integer)

# EXPECTATION VALUES
density : F #*! Accumulate density (Boolean)
spin_density : F #*! Accumulate spin densities (Boolean)
pair_corr : F #*! Accumulate rec. space PCF (Boolean)
pair_corr_sph : F #*! Accumulate sph. real space PCF (Boolean)
loc_tensor : F #*! Accumulate localization tensor (Boolean)
structure_factor : F #*! Accumulate structure factor (Boolean)
struc_factor_sph : F #*! Accumulate sph. struc. factor (Boolean)
onep_density_mat : F #*! Accumulate 1p density matrix (Boolean)
twop_density_mat : F #*! Accumulate 2p density matrix (Boolean)
cond_fraction : F #*! Accumulate cond fraction (Boolean)
dipole_moment : F #*! Accumulate elec. dipole moment (Boolean)
expval_cutoff : 30.d0 hartree #*! G vector cutoff for expval (Physical)
permit_den_symm : F #*! Symmetrize QMC charge data (Boolean)
qmc_density_mpc : F #*! Use QMC density in MPC int (Boolean)
int_sf : F #*! Calc ee int from strucfac (Boolean)

# BLOCK INPUT:"


OUTPUT FILE in QE:

bravais-lattice index = 4
lattice parameter (alat) = 6.4800 a.u.
unit-cell volume = 1588.2379 (a.u.)^3
number of atoms/cell = 3
number of atomic types = 2
number of electrons = 17.00
number of Kohn-Sham states= 10
kinetic-energy cutoff = 50.0000 Ry
charge density cutoff = 200.0000 Ry
convergence threshold = 1.0E-06
mixing beta = 0.7000
number of iterations used = 8 plain mixing
Exchange-correlation = SLA-PW-PBX-PBC ( 1 4 3 4 0 0)

celldm(1)= 6.480000 celldm(2)= 0.000000 celldm(3)= 6.740000
celldm(4)= 0.000000 celldm(5)= 0.000000 celldm(6)= 0.000000

crystal axes: (cart. coord. in units of alat)
a(1) = ( 1.000000 0.000000 0.000000 )
a(2) = ( -0.500000 0.866025 0.000000 )
a(3) = ( 0.000000 0.000000 6.740000 )

reciprocal axes: (cart. coord. in units 2 pi/alat)
b(1) = ( 1.000000 0.577350 -0.000000 )
b(2) = ( 0.000000 1.154701 0.000000 )
b(3) = ( 0.000000 -0.000000 0.148368 )


PseudoPot. # 1 for Ta read from file:
/home/__others/onguyen/espresso-5.4.0/pseudo/Ta.pbe-hgh.UPF
MD5 check sum: d86187a174bb4e4a24bfb0d13cb15c9b
Pseudo is Norm-conserving, Zval = 5.0
Generated in analytical, separable form
Using radial grid of 1273 points, 6 beta functions with:
l(1) = 0
l(2) = 0
l(3) = 1
l(4) = 1
l(5) = 2
l(6) = 2

PseudoPot. # 2 for Se read from file:
/home/__others/onguyen/espresso-5.4.0/pseudo/Se.pbe-hgh.UPF
MD5 check sum: a812865db1ed48c7d994420a0cbeb5fd
Pseudo is Norm-conserving, Zval = 6.0
Generated in analytical, separable form
Using radial grid of 1211 points, 6 beta functions with:
l(1) = 0
l(2) = 0
l(3) = 0
l(4) = 1
l(5) = 1
l(6) = 2

atomic species valence mass pseudopotential
Ta 5.00 180.94000 Ta( 1.00)
Se 6.00 78.97000 Se( 1.00)

No symmetry found



Cartesian axes

site n. atom positions (alat units)
1 Ta tau( 1) = ( 0.0000000 0.0000000 0.0729061 )
2 Se tau( 2) = ( 0.0972081 0.0972081 0.1822653 )
3 Se tau( 3) = ( 0.0972081 0.0972081 0.0801967 )

number of k points= 24 gaussian smearing, width (Ry)= 0.0010
cart. coord. in units 2pi/alat
k( 1) = ( 0.1250000 0.2165064 -0.0741840), wk = 0.0833333
k( 2) = ( 0.1250000 0.5051815 -0.0741840), wk = 0.0833333
k( 3) = ( 0.1250000 -0.3608439 -0.0741840), wk = 0.0833333
k( 4) = ( 0.1250000 -0.0721688 -0.0741840), wk = 0.0833333
k( 5) = ( 0.3750000 0.6495191 -0.0741840), wk = 0.0833333
k( 6) = ( 0.3750000 -0.2165064 -0.0741840), wk = 0.0833333
k( 7) = ( -0.1250000 0.2165064 0.0741840), wk = 0.0833333
k( 8) = ( 0.2500000 -0.0000000 -0.0741840), wk = 0.0833333
k( 9) = ( -0.1250000 0.5051815 0.0741840), wk = 0.0833333
k( 10) = ( -0.3750000 0.3608439 -0.0741840), wk = 0.0833333
k( 11) = ( 0.5000000 0.1443376 -0.0741840), wk = 0.0833333
k( 12) = ( -0.3750000 -0.3608439 0.0741840), wk = 0.0833333
k( 13) = ( 0.5000000 -0.1443376 0.0741840), wk = 0.0833333
k( 14) = ( -0.1250000 -0.3608439 0.0741840), wk = 0.0833333
k( 15) = ( 0.3750000 -0.0721688 -0.0741840), wk = 0.0833333
k( 16) = ( -0.2500000 -0.2886751 -0.0741840), wk = 0.0833333
k( 17) = ( 0.3750000 0.0721688 0.0741840), wk = 0.0833333
k( 18) = ( -0.2500000 0.2886751 0.0741840), wk = 0.0833333
k( 19) = ( -0.1250000 -0.0721688 0.0741840), wk = 0.0833333
k( 20) = ( 0.0000000 -0.1443376 -0.0741840), wk = 0.0833333
k( 21) = ( -0.3750000 0.6495191 0.0741840), wk = 0.0833333
k( 22) = ( 0.7500000 -0.0000000 -0.0741840), wk = 0.0833333
k( 23) = ( -0.3750000 -0.2165064 0.0741840), wk = 0.0833333
k( 24) = ( 0.0000000 -0.4330127 -0.0741840), wk = 0.0833333
....................................................
total energy = 86.58827635 Ry
Harris-Foulkes estimate = 86.58827386 Ry
estimated scf accuracy < 0.00000853 Ry

iteration # 11 ecut= 50.00 Ry beta=0.70
CG style diagonalization
ethr = 5.02E-08, avg # of iterations = 5.4

total cpu time spent up to now is 726.9 secs

End of self-consistent calculation

k = 0.1250 0.2165-0.0742 ( 9474 PWs) bands (ev):

-26.6285 -24.5436 -23.6927 -23.4855 -19.7635 -14.8774 -3.5972 -1.7529
0.8286 1.6801

k = 0.1250 0.5052-0.0742 ( 9482 PWs) bands (ev):

-26.0903 -24.7071 -23.7637 -23.2930 -19.5719 -14.6340 -4.7380 -1.3294
-0.1509 1.6252

k = 0.1250-0.3608-0.0742 ( 9478 PWs) bands (ev):

-26.2885 -24.6986 -23.7907 -23.4496 -19.6971 -14.4517 -4.1485 -2.6191
0.2608 1.9122

k = 0.1250-0.0722-0.0742 ( 9520 PWs) bands (ev):

-26.8568 -24.5352 -23.7286 -23.5601 -19.8694 -14.6993 -3.9788 -2.1791
0.5673 2.4613

k = 0.3750 0.6495-0.0742 ( 9472 PWs) bands (ev):

-25.9145 -24.7275 -23.6566 -23.3456 -19.7621 -14.6914 -5.1043 -1.9766
-0.0228 1.6693

k = 0.3750-0.2165-0.0742 ( 9492 PWs) bands (ev):

-26.1742 -24.7205 -23.8217 -23.2892 -19.8388 -14.4827 -5.6231 -2.3458
1.3064 1.9350

k =-0.1250 0.2165 0.0742 ( 9474 PWs) bands (ev):

-26.6224 -24.6125 -23.7852 -23.5132 -19.8011 -14.5483 -3.5727 -3.1212
0.8704 1.9624

k = 0.2500-0.0000-0.0742 ( 9474 PWs) bands (ev):

-26.6238 -24.5452 -23.6758 -23.4596 -19.8748 -14.8796 -3.6935 -2.5876
0.6242 2.4467

k =-0.1250 0.5052 0.0742 ( 9482 PWs) bands (ev):

-26.0711 -24.7392 -23.7693 -23.3546 -19.6031 -14.4824 -4.7536 -1.7995
-0.1777 1.7711

k =-0.3750 0.3608-0.0742 ( 9482 PWs) bands (ev):

-26.0101 -24.7622 -23.7969 -23.3098 -19.8012 -14.4314 -5.7925 -1.8885
0.5813 1.5637

k = 0.5000 0.1443-0.0742 ( 9482 PWs) bands (ev):

-26.0587 -24.5789 -23.5422 -23.2241 -19.7487 -15.2757 -3.8282 -1.9980
-0.2392 1.8886

k =-0.3750-0.3608 0.0742 ( 9482 PWs) bands (ev):

-26.0643 -24.5763 -23.5712 -23.2178 -19.6868 -15.2729 -3.6783 -2.0088
-0.1493 1.7164

k = 0.5000-0.1443 0.0742 ( 9482 PWs) bands (ev):

-26.0255 -24.7302 -23.7689 -23.2486 -19.8322 -14.5885 -5.8018 -1.6698
0.6391 1.4713

k =-0.1250-0.3608 0.0742 ( 9478 PWs) bands (ev):

-26.3161 -24.6256 -23.7482 -23.3483 -19.6397 -14.7999 -4.0299 -1.6673
0.2135 1.8493

k = 0.3750-0.0722-0.0742 ( 9478 PWs) bands (ev):

-26.2867 -24.6356 -23.7284 -23.3053 -19.8641 -14.7883 -4.7764 -2.4239
0.8793 2.2491

k =-0.2500-0.2887-0.0742 ( 9478 PWs) bands (ev):

-26.3005 -24.5600 -23.6454 -23.3228 -19.6998 -15.1126 -3.5599 -1.2693
-0.5920 1.7067

k = 0.3750 0.0722 0.0742 ( 9478 PWs) bands (ev):

-26.2906 -24.5647 -23.5999 -23.3193 -19.8314 -15.1180 -3.8257 -2.0130
-0.0273 1.8412

k =-0.2500 0.2887 0.0742 ( 9478 PWs) bands (ev):

-26.2680 -24.7057 -23.8082 -23.4177 -19.7896 -14.4323 -4.7400 -2.7998
0.7407 2.2432

k =-0.1250-0.0722 0.0742 ( 9520 PWs) bands (ev):

-26.8543 -24.5073 -23.6299 -23.6150 -19.8585 -14.8316 -3.9250 -1.5166
0.7555 1.8148

k = 0.0000-0.1443-0.0742 ( 9520 PWs) bands (ev):

-26.8572 -24.5358 -23.7257 -23.5789 -19.8281 -14.6998 -3.9504 -1.7952
0.9369 1.8701

k =-0.3750 0.6495 0.0742 ( 9472 PWs) bands (ev):

-25.9460 -24.6486 -23.5688 -23.2913 -19.7091 -15.0454 -3.8528 -2.8979
0.2339 2.0999

k = 0.7500-0.0000-0.0742 ( 9472 PWs) bands (ev):

-25.9448 -24.7169 -23.6676 -23.3493 -19.6490 -14.7122 -4.3591 -2.5731
0.0456 1.9520

k =-0.3750-0.2165 0.0742 ( 9492 PWs) bands (ev):

-26.2007 -24.5431 -23.5624 -23.2571 -19.7450 -15.2991 -3.5899 -1.2661
-0.5539 1.5171

k = 0.0000-0.4330-0.0742 ( 9492 PWs) bands (ev):

-26.2294 -24.7007 -23.7971 -23.3523 -19.5994 -14.5268 -4.5834 -1.7418
0.5875 1.8140

the Fermi energy is 0.4232 ev

! total energy = 86.58826138 Ry
Harris-Foulkes estimate = 86.58826124 Ry
estimated scf accuracy < 0.00000045 Ry

The total energy is the sum of the following terms:

one-electron contribution = -604.23719153 Ry
hartree contribution = 302.01542735 Ry
xc contribution = -15.53859549 Ry
ewald contribution = 404.34862105 Ry
smearing contrib. (-TS) = -0.00000000 Ry

convergence has been achieved in 11 iterations

Re: The eror from the trial wave function from Quantum espre

Posted: Tue Oct 18, 2016 9:28 am
by Katharina Doblhoff
Hi!
I think there are several errors in your input files:
1.) You need to specity no use of symmetry in the pwscf file. (in system add
nosym = .true.
noinv = .true.
)
2.) unless you are twist averaging (which will require a different input), I would center the grid at gamma. I haven't looked at the symmetry of your system, but the fact that a 4x4 k-point mesh produces 25 k-points when using inversion symmetry and symmetry strongly suggests to me that not centering on Gamma is a weird idea.
I would set 4 4 1 0 0 0 in the k-point definition

Katharina

Re: The eror from the trial wave function from Quantum espre

Posted: Tue Oct 18, 2016 10:46 am
by Nguyen_Oanh
Thank you very much. I will test again.