# Input for Positron tutorial
# Fourth step of the tutorial on electron-positron annihilation
# Positron lifetime calculation within PAW
# Si monovacancy, relaxation effect

#To perform a self-consistent electron-positron calculation, we need only one dataset

#-------------------------------------------------------------------------------
#Definition of variables specific to electron-positron calculation

#TC-DFT Self-consistent cycle
positron   -10    # We perform automatic calculation of electrons and positron densities
                  #   in the two-component DFT context (storing wavefunctions in memory)
posnstep    20    # Maximum number of electon and positron steps
postoldfe 1d-5    # We will repeat the electon and positron steps
                  #   until the energy difference is lower than 1d-5


ixcpositron  1    # We are using the Boronski and Nieminen parametrization

posocc     1.0    # Occupation number for the positron
                  #   (we have only one positron in the cell)

#-------------------------------------------------------------------------------
#Definition of variables specific to atomic relaxation

ionmov   2        # We now include the effect of the atomic relaxation
                  #   (BFGS relaxation algorithm)

ntime    4        # We will perform only 4 steps of relaxation
                  #   in reality more steps are required

optforces 1       # Forces computation done at each (electronic or positronic) SCF step


#-------------------------------------------------------------------------------

#Definition of the unit cell
acell 3*5.43 angstrom  # Lengths of the primitive vectors (exp. param. in angstrom)
rprim             # 3 orthogonal primitive vectors (FCC lattice, non primitive cell)
  0.0 1.0 1.0
  1.0 0.0 1.0
  1.0 1.0 0.0
chkprim 0         # Do not stop if cell is not primitive

#Definition of the atom types and pseudopotentials
ntypat 1          # There is only one type of atom
znucl 14          # Atomic number of the possible type(s) of atom. Here silicon.
pp_dirpath "$ABI_PSPDIR"              # Path to the directory were
                                      #   pseudopotentials for tests are stored
pseudos "Pseudodojo_paw_pw_standard/Si.xml" # Name and location of the pseudopotential
                         
#Definition of the atoms
natom 15          # There are 15 atoms
typat 15*1        # They all are of type 1, that is, Silicon
xred              # Location of the 15 atoms (one triplet per atom):
  0.0   0.0   0.0
  0.0   0.0   0.5
  0.0   0.5   0.0
  0.5   0.0   0.0
  0.0   0.5   0.5
  0.5   0.0   0.5
  0.5   0.5   0.0
  0.5   0.5   0.5
  0.125 0.125 0.125
  0.125 0.125 0.625
  0.125 0.625 0.125
  0.625 0.125 0.125
  0.125 0.625 0.625
  0.625 0.125 0.625
  0.625 0.625 0.125
# 0.625 0.625 0.625  # We remove one Si atom

#Definition of bands and occupation numbers
nband 36          # Compute 36 bands
occopt 1          # Automatic generation of occupation numbers, as a semiconductor

#Numerical parameters of the calculation : planewave basis set and k point grid
ecut 8.           # Maximal plane-wave kinetic energy cut-off, in Hartree
pawecutdg 15.     # Max. plane-wave kinetic energy cut-off, in Ha, for the PAW double grid
kptopt 1          # Automatic generation of k points, taking into account the symmetry
ngkpt 2 2 2       # This is a 2 2 2 grid based on the primitive vectors of the recip. space
nshiftk 1         # We do not shift the grid in order to have Gamma point in it
shiftk 0. 0. 0.

#Parameters for the SCF procedure
nstep 500         # Maximal number of SCF cycles. We increase it!
toldfe 1.0d-8     # Will stop when, twice in a row, the difference 
                  # between two consecutive evaluations of energy
                  # differ by less than toldfe

#Miscelaneous parameters
prtwf 0           # Do not print wavefunctions
prtden 0          # Do not print density (electronic and/or positronic)
prteig 0          # Do not print eigenvalues
optstress 0       # Stress tensor computation is not relevant here


##############################################################
# This section is used only for regression testing of ABINIT #
##############################################################
#%%<BEGIN TEST_INFO>
#%% [setup]
#%% executable = abinit
#%% [files]
#%% files_to_test =
#%%   tpositron_4.abo, tolnlines= 48, tolabs= 3.0e-2, tolrel= 8.0e-1, fld_options= -easy
#%% [paral_info]
#%% max_nprocs = 10
#%% [extra_info]
#%% authors = J. Wiktor
#%% keywords = POSITRON,PAW
#%% description =
#%%   Input for Positron tutorial
#%%   Fourth step of the tutorial on electron-positron annihilation
#%%   Positron lifetime calculation within PAW
#%%   Si monovacancy, relaxation effect
#%%<END TEST_INFO>
