input_description -distribution {Quantum Espresso} -package turboEELS -program turbo_eels.x {

    toc {}

    intro {
    	  Input data format: { } = optional, [ ] = it depends.

	  All quantities whose dimensions are not explicitly specified are in
	  RYDBERG ATOMIC UNITS

	  BEWARE: TABS, DOS <CR><LF> CHARACTERS ARE POTENTIAL SOURCES OF TROUBLE

          Comment lines in namelists can be introduced by a "!", exactly as in 
          fortran code. Comments lines in ``cards'' can be introduced by 
          either a "!" or a "#" character in the first position of a line.

	  Structure of the input data:
	  ===============================================================================

	  &lr_input
	    ...
	  /

	  &lr_control
	    ...
	  /	    

    }

    namelist lr_input {

	label { This namelist is always needed ! }

	var prefix -type CHARACTER { 
	    default { 'pwscf' }
	    info {
		Sets the prefix for generated and read files. The files 
		generated by the ground state pw.x run must have this 
		same prefix.
	    }
	}

	var outdir -type CHARACTER { 
	    default { './' }
	    info {
		The directory that contains the run critical files, which 
		include the files generated by ground state pw.x run.
	    }
	}

	var restart -type LOGICAL {
	    default {.false.}
	    info {
		When set to .true., turbo_eels.x will attempt to restart 
		from a previous interrupted calculation. (see @ref restart_step 
		variable).
		Beware, if set to .false. turbo_eels.x will OVERWRITE any
		previous runs.
	    }
	}

	var restart_step -type INTEGER {
	    default {itermax}
	    info {
		The code writes restart files every restart_step iterations.
		Restart files are automatically written at the end of 
		itermax Lanczos steps.
	    }
	}

	var lr_verbosity -type INTEGER {
	    default {1}
	    info {
		This integer variable controls the amount of information 
		written to standard output.
	    }
	}

	var disk_io -type CHARACTER {
	    default { 'default' }
	    info {
    		Fine control of disk usage. Currently only 'reduced' is 
		supported where no restart files are written, apart from 
		the 'default' mode.
	    }
	}
    }
    namelist lr_control {

        var approximation -type CHARACTER {
            default { 'TDDFT' }
            options {
                info {A string describing a level of theory:}
                opt -val 'TDDFT' {
                         Time-Dependent Local Density Approximation or
                         Time-Dependent Generalized Gradient Approximation
                         (depending on the XC functional)
                }
                opt -val 'IPA'   {
                         Independent Particle Approximation (IPA)
                }
                opt -val 'RPA_with_CLFE' {
                         Random Phase Approximation (RPA) with
                         Crystal Local Field Effects (CLFE)
                }
            }
        }

        vargroup -type REAL {
            var q1
            var q2
            var q3
            default { 1.0, 1.0, 1.0 }
            info {
                The values of the transferred momentum q = (q1, q2, q3)
                in Cartesian coordinates in units of 2pi/a, where 
                "a" is the lattice parameter.
            }
        }

        var calculator -type CHARACTER {
            default {'lanczos'}
            options {
                info {
                   Variable that controls which algorithm is used to compute EELS spectra.
                }
                opt -val 'lanczos'     {
                         corresponds to the Lanczos recursive algorithm
                         }
                opt -val 'sternheimer' {
                         corresponds to the Sternheimer algorithm
                         }
            }
        }

	var itermax -type INTEGER {
	    default {500}
	    info {
                When @ref calculator = 'lanczos', @ref itermax is the 
                maximum number of Lanczos iterations that will be performed.
                When @ref calculator = 'sternheimer', @ref itermax is the
                maximum number of iterations in a SCF step for each frequency.
		}
	}

        var pseudo_hermitian -type LOGICAL {
            default {.true.}
            info {
                This variable is used only when @ref calculator = 'lanczos'.
                When set to .true. the pseudo-Hermitian Lanczos algorithm is 
                used. When set to .false. the non-Hermitian Lanczos 
                biorthogonalization algorithm is used (which is two times slower).
                }
        }

        var alpha_mix(i)  -type REAL {
            default { alpha_mix(1)=0.7 }
            info {
                This variable is used only when @ref calculator = 'sternheimer'.
                Mixing parameter (for the i-th iteration) for updating
                the response SCF potential using the modified Broyden
                method: D.D. Johnson, PRB 38, 12807 (1988).
            }
        }	

        var epsil -type REAL {
            default {0.02}
            info {
                This variable is used only when @ref calculator = 'sternheimer'.
                The broadening/damping term (in Rydberg units).
                }
        }

        var units -type INTEGER {
            default {0}
            info {
                This variable is used only when @ref calculator = 'sternheimer'.
                The unit system used for the output, for @ref start, @ref end,
                and @ref increment input parameters. 
                0 = Rydbergs, 1 = Electron volts.
                 }
        }

        var start -type REAL {
            default {0.0}
            see {end, increment}
            info {
                This variable is used only when @ref calculator = 'sternheimer'.
                @ref start is the value of frequency starting from which the
                susceptibility and the loss function (-Im(1/eps)) will be computed.
                @ref start is specified in units controlled by @ref units.
                }
        }

        var end -type REAL {
            default {2.5}
            see {start, increment}
            info {
                This variable is used only when @ref calculator = 'sternheimer'.
                @ref end is the value of frequency up to which the
                susceptibility and the loss function (-Im(1/eps)) will be computed.
                @ref end is specified in units controlled by @ref units.
                }
        }

        var increment -type REAL {
            default {0.001}
            see {start, end} 
            info {
                This variable is used only when @ref calculator = 'sternheimer'.
                @ref increment is an incremental step used to define the mesh 
                of frequencies between @ref start and @ref end.
                @ref increment is specified in units controlled by @ref units.
                }
        }


    }			

}
