<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="input_xx.xsl"?>
<!-- FILE AUTOMATICALLY CREATED: DO NOT EDIT, CHANGES WILL BE LOST -->
    
<input_description distribution="Quantum ESPRESSO" package="KCW" program="kcw.x" >
   <toc>
   </toc>
   <intro>
<b>Input data format:</b> { } = optional, [ ] = it depends, # = comment

<b>Structure of the input data:</b>
===============================================================================

<b>&amp;CONTROL</b>
   ...
<b>/</b>

<b>&amp;WANNIER</b>
   ...
<b>/</b>

<b>&amp;SCREEN</b>
   ...
<b>/</b>

<b>&amp;HAM</b>
   ...
<b>/</b>

<b>K_POINTS</b> { tpiba | automatic | crystal | gamma | tpiba_b | crystal_b | tpiba_c | crystal_c }
if (gamma)
   nothing to read
if (automatic)
   nk1, nk2, nk3, k1, k2, k3
if (not automatic)
   nks
   xk_x, xk_y, xk_z,  wk
if (tpipa_b or crystal_b in a &apos;bands&apos; calculation) see Doc/brillouin_zones.pdf
   </intro>
   <namelist name="CONTROL" >
      <var name="prefix" type="CHARACTER" >
         <default> &apos;pwscf&apos;
         </default>
         <info>
Prepended to input/output filenames; must be the same
used in the previous PW calculations.
         </info>
      </var>
      <var name="outdir" type="CHARACTER" >
         <default>
current directory (&apos;./&apos;)
         </default>
         <info>
Directory containing input, output, and scratch files;
must be the same as specified in the calculation of
previous PW calculation.
         </info>
      </var>
      <var name="calculation" type="CHARACTER" >
         <default> &apos; &apos;
         </default>
         <options>
            <info>
Specify the KCW calculation to be done
Possible choices:
            </info>
            <opt val="'wann2kcw'" >
Pre-processing to prepare KCW calculation.
Read previous PWSCF and possibly W90 outputs and prepare the KCW
calculation
            </opt>
            <opt val="'screen'" >
Perform the calculation of KCW screening coefficient using a
LR approach as described here <link>https://doi.org/10.1021/acs.jctc.7b01116</link>
and <a href="https://arxiv.org/abs/2202.08155">arXiv:2202.08155</a>
            </opt>
            <opt val="'ham'" >
Perform the calculation interpolation and diagonalization of the KI hamiltonian
            </opt>
            <opt val="'cc'" >
Computes the (estimated) q+G=0 contribution to the bare and screened KC corrections.
A report on this quantities is printed on output and can be used to correct a
posteriori a &quot;screen&quot; calculation performed without any corrective scheme (<ref>l_vcut</ref>=.false.)
avoiding the need of re-doing a &quot;screen&quot; calculation.
            </opt>
         </options>
      </var>
      <var name="kcw_iverbosity" type="INTEGER" >
         <default> 1
         </default>
         <info>
= 0 : minimal output
= 1 : as above + performs additional checks.
&gt; 1 : as above + additional infos on all the steps.
         </info>
      </var>
      <var name="kcw_at_ks" type="LOGICAL" >
         <default> .TRUE.
         </default>
         <info>
If true the KS canonical orbitals are used instead of Wannier
functions. It makes sense for isolated system only.
         </info>
      </var>
      <var name="read_unitary_matrix" type="LOGICAL" >
         <default> .FALSE.
         </default>
         <info>
If true read the Unitary matrix written by Wannier90.
Implicitely means a previous wannier90 calculation was
performed and a KCW calculation will be performed starting
from MLWF. Requires &apos;write_hr = .true.&apos; in wannier90.
         </info>
      </var>
      <var name="spread_thr" type="REAL" >
         <default> 0.0001 Ry
         </default>
         <info>
HARD-CODED FOR NOW. Two or more Wannier functions are considered
identical if their spread (self-hartree) differ by less than spread_thr.
Requires <ref>check_spread</ref> = .true.
         </info>
      </var>
      <var name="homo_only" type="LOGICAL" >
         <default> FALSE
         </default>
         <info>
If <ref>kcw_at_ks</ref> = .TRUE. only the screening paramenter for the HOMO is
calculated. Mainly for a perturbative calculation of the first Ionization
Potential in isolated systems.
         </info>
      </var>
      <var name="l_vcut" type="LOGICAL" >
         <default> FALSE
         </default>
         <info>
If .TRUE. the Gygi-Baldereschi scheme is used to deal with
the q-&gt;0 divergence of the Coulomb integral (bare and screened).
Improves the convergence wrt k/q-point sampling.
Requires to correctly set <ref>eps_inf</ref> for the calculation of
the screened interaction.

Use it only for periodic system.
For isoleted system use <ref>assume_isolated</ref>, instead.
         </info>
      </var>
      <var name="assume_isolated" type="CHARACTER" >
         <default> &apos;none&apos;
         </default>
         <options>
            <info>
Used to perform calculation assuming the system to be
isolated (a molecule or a cluster in a 3D supercell).

Currently available choices:
            </info>
            <opt val="'none'" > (default): regular periodic calculation w/o any correction.
            </opt>
            <opt val="'martyna-tuckerman', 'm-t', 'mt'" >
Martyna-Tuckerman correction
to both total energy and scf potential. Adapted from:
G.J. Martyna, and M.E. Tuckerman,
&quot;A reciprocal space based method for treating long
range interactions in ab-initio and force-field-based
calculation in clusters&quot;, J. Chem. Phys. 110, 2810 (1999),
<a href="https://doi.org/10.1063/1.477923">doi:10.1063/1.477923</a>.
            </opt>
         </options>
      </var>
      <var name="spin_component" type="INTEGER" >
         <default> 1
         </default>
         <info>
Which spin channel to calculate (only collinear calculation).
1 = spin up channel
2 = spin down channel
It has to be consistent with the previous Wannier90
calculation (see &apos;spin&apos; keyword in Wannier90 documentation)
         </info>
      </var>
      <vargroup type="INTEGER" >
         <var name="mp1" >
         </var>
         <var name="mp2" >
         </var>
         <var name="mp3" >
         </var>
         <default> -1,-1,-1
         </default>
         <info>
Parameters of the Monkhorst-Pack grid (no offset).
Same meaning as for nk1, nk2, nk3 in the input of pw.x.
It has to coincide with the regular mesh used for the
wannier90 calculation.
         </info>
      </vargroup>
      <var name="lrpa" type="LOGICAL" >
         <default> .FALSE.
         </default>
         <info>
If .true. the response function is computed neglecting xc
effects both in the kernel and in the response function (RPA).
         </info>
      </var>
      <var name="io_sp" type="LOGICAL" >
         <default> .FALSE.
         </default>
         <info>
If .true. write wannier orbital densities in single-precision.
         </info>
      </var>
      <var name="io_real_space" type="LOGICAL" >
         <default> .FALSE.
         </default>
         <info>
If .true. write Wannier orbital densities and Wannier functions in real space.
         </info>
      </var>
      <var name="irr_bz" type="LOGICAL" >
         <default> .FALSE.
         </default>
         <info>
If .true. compute and use the symmetries of the Wannier orbital densities
to reduce the number of k and q points for the BZ sampling.
         </info>
      </var>
      <var name="use_wct" type="LOGICAL" >
         <default> .FALSE.
         </default>
         <info>
If .true. allow to use symmetries that send the Wannier orbital density into
the Wannier translated by a lattice vector (wcf= wannier center translation)
to further reduce the number of q points
         </info>
      </var>
   </namelist>
   <namelist name="WANNIER" >
      <var name="seedname" type="CHARACTER" >
         <default> wann
         </default>
         <info>
The seedname of the previous Wannier90 calculation for occupied states.
NOTA BENE: the code implicitely assumed that the seedname for empty
state is the same as that for occupied state with &quot;_emp&quot; appended.
Keep this in mind when set up the wannier90 inputs.

For example:
wann.win         is the wannier90 input file for the occupied states.
wann_emp.win     is the wannier90 input file for the empty states.
         </info>
      </var>
      <var name="num_wann_occ" type="INTEGER" >
         <default> 0
         </default>
         <info>
The number of wannier function for the occupied manifold.
It has to coincide with the number of occupied KS orbitals.
The whole KS manifold has to be wannierised (no &apos;exclude_band&apos;
option for occupied state, at the moment).
         </info>
      </var>
      <var name="num_wann_emp" type="INTEGER" >
         <default> 0
         </default>
         <info>
The number of wannier function for the empty manifold.
It has to coincide with the number of empty wannier function
from the previous wannier90 calculation
         </info>
      </var>
      <var name="have_empty" type="LOGICAL" >
         <default> FALSE
         </default>
         <info>
If true empty state are computed. Require a previous wannier90
calculation for the empty manifold. The code search for the
unitary matrices in the wannier90 file seedname_emp_u.mat
         </info>
      </var>
      <var name="has_disentangle" type="LOGICAL" >
         <default> FALSE
         </default>
         <info>
Specify if a disentangle unitary matrix needs to be read. Requires
a consisten calcuation from the previous wannier90 run.
         </info>
      </var>
      <var name="check_ks" type="LOGICAL" >
         <default> FALSE
         </default>
         <info>
Specify if a diagonalization of the KS matrix build using the wannier
function in input has to be performed. This is mainly for debugging purpose.
         </info>
      </var>
      <var name="alpha_mix(niter)" type="REAL" >
         <default> alpha_mix(1)=0.7
         </default>
         <info>
Mixing factor (for each iteration) for updating
the scf potential:

vnew(in) = alpha_mix*vold(out) + (1-alpha_mix)*vold(in)
         </info>
      </var>
   </namelist>
   <namelist name="SCREEN" >
      <var name="niter" type="INTEGER" >
         <default> maxter=100
         </default>
         <info>
Maximum number of iterations in a scf step. If you want
more than 100, edit variable &quot;maxter&quot; in PH/phcom.f90
         </info>
      </var>
      <var name="nmix" type="INTEGER" >
         <default> 4
         </default>
         <info> Number of iterations used in potential mixing.
         </info>
      </var>
      <var name="tr2" type="REAL" >
         <default> 1e-14
         </default>
         <info> Threshold for self-consistency.
         </info>
      </var>
      <var name="i_orb" type="INTEGER" >
         <default> -1
         </default>
         <info>
Perform the screening calculation for a particular orbital.
If i_orb = -1 (default) all the orbitals are computed.
Assumes values between 1 and the total number of wannier
functions.
         </info>
      </var>
      <var name="eps_inf" type="REAL" >
         <default> 1.d0
         </default>
         <info>
The macroscopic dielectric constant. Needed for the Gygi-Baldereschi
scheme if <ref>l_vcut</ref> = .TRUE.
Typically from exp or from a ph.x calculation.

NOTA BENE: This would be equivalent to a Makov-Payne correction. It works well
for cubic systems. Less well for anisotropic systems.

ANISOTROPIC SYSTEMS: In this case a generalization of the GB scheme is implemented
based on Nano Lett.,9, 975 (2009). It requires the full dielectric tensor to be provided.
The code searches (in the working dir) for a file named &quot;eps.dat&quot; containing the macrospocic
dielectric tensor. If it does not find it, the value <ref>eps_inf</ref> provided in input will be
used (isotropic approximation). If not even <ref>eps_inf</ref> is provided in input no correction
is applied to the screened KC correction.
         </info>
      </var>
      <var name="check_spread" type="LOGICAL" >
         <default> .FALSE.
         </default>
         <info>
If .TRUE. the spread (self-hartree) of the Wannier functions is
checked and used to decide whether two or more Wannier functions
can be considered &quot;identical&quot; or not. Two Wannier functions are
considered identical if their spread (self-hartree) differ by less
than 1e-4 Ry (Hard coded for now, see <ref>spread_thr</ref>).
         </info>
      </var>
   </namelist>
   <namelist name="HAM" >
      <var name="do_bands" type="LOGICAL" >
         <default> .FALSE.
         </default>
         <info>
If .true. the interpolated band structure is computed along
a path specified with the K_POINTS card ( see PW documentation
<link>https://www.quantum-espresso.org/Doc/INPUT_PW.html#K_POINTS</link> )
         </info>
      </var>
      <var name="use_ws_distance" type="LOGICAL" >
         <default> .TRUE.
         </default>
         <info>
If .true. the position of the Wannier function inside the cell is used
to set the proper distance and to have a smoother interpolation. Requires
seedname_centres.xyz to be printed by the previous Wannier90 run. If the
file is not found it is automatically switched to .FALSE. and only the
distance between the cells is used (see also Wannier90 documentation)
         </info>
      </var>
      <var name="write_hr" type="LOGICAL" >
         <default> .TRUE.
         </default>
         <info>
If .true. the KCW hamiltonain in the Wannier basis and in real spase H(R)_m_n
is printed to file. Usefull for furhter post-processing.
         </info>
      </var>
      <var name="on_site_only" type="LOGICAL" >
         <default> .FALSE.
         </default>
         <info>
If .true. only the on-site and diagonal elements of the KCW hamiltonain
are computed (R=0 and n=m).
         </info>
      </var>
   </namelist>
   <card name="K_POINTS" >
      <message> see <link>https://www.quantum-espresso.org/Doc/INPUT_PW.html#K_POINTS</link>
      </message>
   </card>
</input_description>
