# Crystalline silicon
# Calculation of the GW corrections
# Dataset 1: ground state calculation and of the kss file for 10 k-points in IBZ
# Dataset 2: calculation of the screening (epsilon^-1 matrix for W)
# Dataset 3: calculation of the Self-Energy matrix elements (GW corrections)

ndtset      3

# Definition of parameters for the calculation of the KSS file
nbandkss1   -1         # Number of bands in KSS file (-1 means the maximum possible)
nband1      9         # Number of (occ and empty) bands to be computed
istwfk1     10*1

# Calculation of the screening (epsilon^-1 matrix)
optdriver2  3        # Screening calculation
getkss2     -1       # Obtain KSS file from previous dataset
nband2      17       # Bands to be used in the screening calculation
ecutwfn2    2.1      # Cut-off energy of the planewave set to represent the wavefunctions
ecuteps2    3.6      # Cut-off energy of the planewave set to represent the dielectric matrix
ppmfrq2    16.7 eV  # Imaginary frequency where to calculate the screening

# Calculation of the Self-Energy matrix elements (GW corrections)
optdriver3  4        # Self-Energy calculation
getkss3     -2       # Obtain KSS file from dataset 1
getscr3     -1       # Obtain SCR file from previous dataset
nband3      30       # Bands to be used in the Self-Energy calculation
ecutwfn3     5.0     # Planewaves to be used to represent the wavefunctions
ecutsigx3     6.0     # Dimension of the G sum in Sigma_x
                     # (the dimension in Sigma_c is controlled by npweps)
nkptgw3      1                # number of k-point where to calculate the GW correction
kptgw3                       # k-points
  -0.125    0.000    0.000
bdgw3       4  5             # calculate GW corrections for bands from 4 to 5


# Data common to the three different datasets

# Definition of the unit cell: fcc
acell  3*10.217        # This is equivalent to   10.217 10.217 10.217
rprim  0.0  0.5  0.5   # FCC primitive vectors (to be scaled by acell)
       0.5  0.0  0.5   
       0.5  0.5  0.0

# Definition of the atom types
ntypat  1         # There is only one type of atom
znucl 14          # The keyword "znucl" refers to the atomic number of the 
                  # possible type(s) of atom. The pseudopotential(s) 
                  # mentioned in the "files" file must correspond
                  # to the type(s) of atom. Here, the only type is Silicon.
                         
# Definition of the atoms
natom 2           # There are two atoms
typat  1 1        # They both are of type 1, that is, Silicon.
xred              # Reduced coordinate of atoms
      0.0  0.0  0.0
      0.25 0.25 0.25


# Definition of the k-point grid
kptopt  1            # Option for the automatic generation of k points,
nkpt    10
ngkpt   4 4 4  
nshiftk 4
shiftk  0.5 0.5 0.5  # These shifts will be the same for all grids
        0.5 0.0 0.0
        0.0 0.5 0.0
        0.0 0.0 0.5

# Use only symmorphic operations
symmorphi 0

# Definition of the planewave basis set (at convergence 16 Rydberg 8 Hartree)
ecut 8.0          # Maximal kinetic energy cut-off, in Hartree

# Definition of the SCF procedure
nstep   10        # Maximal number of SCF cycles
toldfe  1.0d-6    # Will stop when this tolerance is achieved on total energy
diemac  12.0      # Although this is not mandatory, it is worth to
                  # precondition the SCF cycle. The model dielectric
                  # function used as the standard preconditioner
                  # is described in the "dielng" input variable section.
                  # Here, we follow the prescription for bulk silicon.


# This line added when defaults were changed (v5.3) to keep the previous, old behaviour
  iscf 5
