# Orthorhombic Al, for test of frozen-phonon in the metallic case
# It shows that the varying and fixed occupation cases are very different !
ndtset 10
#Input that is common to most datasets, but not all
acell 5.20 5.05 5.05
getden 3
getwfk 3
kptopt 3
natom 1
nband 3
nkpt 8
nqpt 1
occopt 4
tsmear 0.04 # to ensure good portability of the test
typat 1
xred 0.0 0.0 0.0
#Dataset 1 : SCF with small number of k points
getden1 0
getwfk1 0
kptopt1 1
nkpt1 1
nqpt1 0
prtden1 1
tolvrs1 1.0d-14
#Dataset 2 : non-SCF for all k points
getden2 1
getwfk2 1
iscf2 -2
nqpt2 0
tolwfr2 1.0d-22
#Dataset 3 : SCF with large number of k points
# This operation is rather rapid, since all the wavefunctions are already
# known. Thus, nstep=1 is imposed.
# Usually, this is not needed,
# but here, one has to generate the occupation numbers for each k point,
# in order to show the effect of varying or fixing the occupation numbers.
getden3 0
getwfk3 2
nqpt3 0
prtden3 1
tolvrs3 1.0d-14
#Dataset 4 : non-SCF at q=1/2 0 0
iscf4 -2
qpt4 0.5d0 0.d0 0.d0
tolwfr4 1.0d-22
#Dataset 5 : RF at q=1/2 0 0 , varying occupation number case
getwfq5 4
qpt5 0.5d0 0.0d0 0.0d0
rfatpol5 1 1
rfdir5 1 0 0
rfphon5 1
toldfe5 1.0d-8
#Dataset 6 : supercell calculation
ngfft6 24 12 12
acell6 10.40 2*5.05
getden6 0
getwfk6 0
kptopt6 0
nkpt6 1
kpt6 0.5d0 2*0.25d0
wtk6 1
natom6 2
nband6 6
nqpt6 0
toldfe6 1.0d-12
typat6 1 1
xred6 3*0.0d0
0.5d0 2*0.0d0
#Dataset 7 : frozen-phonon supercell calculation , varying occupation number case
ngfft7 24 12 12
acell7 10.40 2*5.05
getden7 0
getwfk7 6
kptopt7 0
nkpt7 1
kpt7 0.5d0 2*0.25d0
wtk7 1
natom7 2
nband7 6
nqpt7 0
toldfe7 1.0d-12
typat7 1 1
xred7 3*0.0d0
0.501d0 2*0.0d0
#Dataset 8 : RF at q=1/2 0 0 , fixed occupation number case
#These input variables allow to take the occupation numbers from
#the output of dataset 3, and consider them as fixed
getocc8 3
occopt8 2
nband8 8*3
getwfq8 4
qpt8 0.5d0 0.0d0 0.0d0
rfatpol8 1 1
rfdir8 1 0 0
rfphon8 1
toldfe8 1.0d-8
#Dataset 9 : frozen-phonon supercell calculation , fixed occupation number case
#These input variables allow to take the occupation numbers from
#the output of dataset 6, and consider tham as fixed
getocc9 6
occopt9 2
nband9 6
ngfft9 24 12 12
acell9 10.40 2*5.05
#Should be very fast, since output of dataset 6 should give perfect wfs
getden9 0
getwfk9 6
kptopt9 0
nkpt9 1
kpt9 0.5d0 2*0.25d0
wtk9 1
natom9 2
nqpt9 0
toldfe9 1.0d-12
typat9 1 1
#Unperturbed atomic positions
xred9 3*0.0d0
0.5d0 2*0.0d0
#Dataset 10 : frozen-phonon supercell calculation , fixed occupation number case
getocc10 6
occopt10 2
nband10 6
ngfft10 24 12 12
acell10 10.40 2*5.05
getden10 0
getwfk10 6
kptopt10 0
nkpt10 1
kpt10 0.5d0 2*0.25d0
wtk10 1
natom10 2
nqpt10 0
toldfe10 1.0d-12
typat10 1 1
xred10 3*0.0d0
0.501d0 2*0.0d0
#Common data
amu 26.96
ecut 4
enunit 2
ixc 1
nbdbuf 0
#This is needed to avoid boxcut lower than two in RF calculations
ngfft 3*12
ngkpt 2 2 2
nsym 8
nstep 40
ntypat 1
rprim 1 0 0 0 1 0 0 0 1
symrel 1 0 0 0 1 0 0 0 1
1 0 0 0 -1 0 0 0 1
1 0 0 0 1 0 0 0 -1
1 0 0 0 -1 0 0 0 -1
1 0 0 0 0 1 0 1 0
1 0 0 0 0 -1 0 1 0
1 0 0 0 0 1 0 -1 0
1 0 0 0 0 -1 0 -1 0
tnons 24*0.0d0
znucl 13.0
## After modifying the following section, one might need to regenerate the pickle database with runtests.py -r
#%%
#%% [setup]
#%% executable = abinit
#%% [files]
#%% files_to_test =
#%% t11.out, tolnlines = 1, tolabs = 1.001e-09, tolrel = 2.000e-08
#%% psp_files = 13al.981214.fhi
#%% [paral_info]
#%% max_nprocs = 1
#%% [extra_info]
#%% keywords = NC, DFPT
#%% authors = Unknown
#%% description =
#%% Orthorhombic Al system, q(1/2 0 0), partial occupation numbers.
#%% Compares with frozen-phonon calculations. Examine two cases:
#%% varying occupation numbers, and fixed occupation numbers.
#%% A. Varying occupation numbers (occopt=4):
#%% RF calculation in dataset 5 gives
#%% 2DE equal to -3.812577 Ha, while finite difference of "TOTAL"
#%% energy (datasets 6 and 7, including entropy term) gives -3.812230 Ha
#%% (the agreement could be better with better finite difference)
#%% B. Fixed occupation numbers (occopt=2):
#%% RF calculation in dataset 8 gives
#%% 2DE equal to +5.431807 Ha, while finite difference of total
#%% energy (no entropy term is present with occopt=2) gives +5.431857 Ha
#%% (the agreement could be better with better finite difference)
#%%