########################################################
# Crystalline EuO
#  Computation of phonon at Gamma
#  Computation of dielectric tensor
########################################################

   ndtset 4
#  ngfft 120 120 120
   ixc 7

#Set 1 : ground state self-consistency

  rfphon1   0            # Cancel default
  getwfk1   0            # Cancel default
    nqpt1   0            # Cancel default
  kptopt1   1            # Automatic generation of k points with symmetries
  tolvrs1   1.0d-15      # SCF stopping criterion (modify default)

#Set 2 : Response function calculation of d/dk wave function

  rfphon2   0          # Cancel default
  rfelfd2   2          # Calculate d/dk wave function only
  kptopt2   2          # Use time-reversal symmetry for k-points
    iscf2   -3         # Need this non-self-consistent option for d/dk

#Set 3: Response function calculation to electric field

  rfphon3   0          # Cancel default
  rfelfd3   3          # Response to electric field only
   rfdir3   1 1 1      # Do all directions (symmetry will be used)
  getwfk3   1          # Use GS wave functions from dataset 1
  getddk3   2          # Use DDK wave functions from dataset 2
  kptopt3   2          # Use time-reversal symmetry for k-points

#Set 4 : Response function calculation of Q=0 phonons

  rfphon4   1          # Do phonon response
 rfatpol4   1 2        # Treat displacements of all atoms
   rfdir4   1 1 1      # Do all directions (symmetry will be used)
  getwfk4   1          # Use GS wave functions from dataset 1
  kptopt4   2          # Use time-reversal symmetry for k-points


#Defaults for all datasets)

   rfphon   1          # Do phonon response
  rfatpol   1 2        # Treat displacements of all atoms
    rfdir   1 1 1      # Do all directions (symmetry will be used)
   getwfk   1          # Use GS wave functions from dataset 1
   kptopt   3          # Need full k-point set for finite-Q response



#Incomplete set of symmetry-inequivalent qpt chosen to be commensurate
# with kpt mesh so that only one set of GS wave functions is needed.
     nqpt   1
     qpt2   0.00000000E+00  0.00000000E+00  0.00000000E+00
     qpt3   0.00000000E+00  0.00000000E+00  0.00000000E+00
     qpt4   0.00000000E+00  0.00000000E+00  0.00000000E+00


#######################################################################
#Common input variables

#Definition of the unit cell
    acell 3*9.80
    rprim   0.0  0.5  0.5
            0.5  0.0  0.5
            0.5  0.5  0.0
#Definition of the atom types
   ntypat   2
    znucl   63 8
#Definition of the atoms
    natom   2
    typat   1 2
     xred   0.0  0.0  0.0
            0.5  0.5  0.5
#Number of band
    nband   20
#Definition of the planewave basis set
     ecut   30
#Definition of the k-point grid
    ngkpt   2 2 2
  nshiftk   4
   shiftk   0.0 0.0 0.5
            0.0 0.5 0.0
            0.5 0.0 0.0
            0.5 0.5 0.5
#Definition of the SCF procedure
    nstep   25
   diemac   9.0
   tolvrs   1.0d-8
#PAW parameters
pawecutdg  120

#DFT+U
usepawu   1
lpawu   3  -1
upawu   7.5   0.0  eV
jpawu   0.6   0.0  eV

#Magnetism
 nsppol 2
 spinat 0 0 7
        0 0 0
 occopt 7
 tsmear 0.001


#%%<BEGIN TEST_INFO>
#%% [setup]
#%% executable = abinit
#%% [files]
#%% files_to_test = 
#%%   t44.out, tolnlines=   0,   tolabs=  0.0,      tolrel= 0.0
#%% psp_files = Eu_GGA_27e_10p.pawps, O_GGA-rc12_xc0.paw
#%% [paral_info]
#%% max_nprocs = 4
#%% [extra_info]
#%% authors = 
#%% keywords =  PAW
#%% description = 
#%%    EuO rock salt structure. Ferromagnetic insulator. PAW+U+DFPT.
#%%    27-electron PAW pseudo (4f and 4d are explicitly treated as semi-core : 4d10 4f7 5s2 5p6 (5d0) 6s2 )
#%%    THIS TEST IS NOT ACTIVATED, AS IT IS TOO MUCH TIME-CONSUMING.
#%%    The results for the Born effective charge, and for the phonon frequencies do not fulfill the
#%%    charge neutrality sum rule and the acoustic sum rule.
#%%    When debugged, the computation of dielectric tensor and Born effective charges might be kept and activated.
#%% topics = DFT+U, DFPT
#%%<END TEST_INFO>
