TABLE OF CONTENTS
2.1 Specifying Input Data
DESCRIPTION
This page contains a description of how to specify input data and associated user commands, i.e., namelists and cards.
- Namelists and cards
- Atomic labels as indices of "ntyp" arrays
- Case-sensitivity
- Explicitly supported QE programs
- Input data handling
- How to unset a namelist variable
- How to clear the content of a given namelist of card
- Input data stacking
- Description of namelists and cards supported by PWTK
- How to deal with input specification and execution of unsupported codes
Namelists and cards
Usually the namelists and cards in PWTK have the same name as those in Quantum ESPRESSO (QE). However, there are some exceptions, i.e., in PWTK namelists are renamed in case when in QE a generic INPUT namelist is used and for closed-cards (neb.x, cp.x) the PWTK syntax is slightly different (see below).
The difference between Quantum ESPRESSO and PWTK is that for the latter the content of namelists and cards is encapsulated with curly braces, e.g.:
CONTROL { calculation = 'relax', outdir = '/temp/pwscf/' }
Instead of curly braces, one can also use double-quotes, e.g.:
SYSTEM " celldm(1) = $a "
The difference between curly braces { ... } and double-quotes " ... " is that inside the double-quotes the variable $a is substituted by its value, whereas inside curly braces the $a is treated literally (i.e. no substitution).
Atomic labels as indices of "ntyp" arrays
As a convenience, indices of ntyp-type array variables, such as starting_magnetization(i), i=1,ntyp, can be specified with atomic labels, e.g.:
SYSTEM { starting_magnetization(Fe) = -0.8 }
where Fe is one among atomic species defined by ATOMIC_SPECIES card. Indeed, it is highly recommended to use atomic-labels instead of atomic-indices in PWTK.
Case-sensitivity
Beware that in PWTK the names are case-sensitive in general. All commands for specifying namelists and cards are written in uppercase. Beware that also the names of namelist variables are case-sensitive. This implies that, e.g., ibrav and IBRAV are too different namelist variables in PWTK.
Explicitly supported QE programs
Currently, the input data handling is supported for the following programs:
* pw.x * cp.x * neb.x * pp.x * projwfc.x * dos.x * bands.x * molecularpdos.x * ph.x * dynmat.x * matdyn.x * q2r.x * hp.x * turbo_davidson.x * turbo_lanczos.x * turbo_eels.x * turbo_spectrum.x
For others, non-supported programs, the input files can be created by the writeFile command (see: ::pwtk::writeFile). For example, see the last part of the following example script: examples/Si.pwtk . Such non-supported programs are executed via the run command (see: ::pwtk::run) as:
run ?options? program input ?output?
where options and output arguments are optional. See the example at the end of this page.
Input Data Handling
The handling of input data in PWTK is dynamic and input data can be changed on the fly. Whenever a given namelist's input variable or the content of the card is set or changed by user it stays so until the user changes it again.
Multiple calls to namelist and card command
Namelist or card commands can be called any number of times, but there is a big difference in the way multiple calls are handled for namelists and cards: the content of card is handled in overwrite mode, whereas the content of namelist is handled in kind of append mode. Consider, for example, calling card command twice:
ATOMIC_POSITIONS bohr { H 0.0 0.0 0.0 H 0.0 0.0 1.1 } ATOMIC_POSITIONS angstrom { N 0.0 0.0 0.0 N 0.0 0.0 1.25 }
The second call to ATOMIC_POSITIONS completely overwrites the first call. In addition, there are also the cardPrepend and cardAppend commands for appending a new content to the beginning or at the end of an existing card content, respectively (see procedures ::pwtk::input::cardPreppend and ::pwtk::input::cardAppend).
As for the ATOMIC_POSITIONS card, there are additional procedures, such as ::pwtk::pwi::insertAtoms and ::pwtk::pwi::deleteAtoms that adds or delete atoms to or from the ATOMIC_POSITIONS card, respectively. For a list of other procedures related to input data, see ::pwtk::input
On the other hand, if we call a given namelist command twice, e.g.:
SYSTEM { ibrav=1, celldm(1)=10.0*sqrt(2), ecutwfc=25.0 } SYSTEM { ibrav=0, nat=2, ntyp=1 }
then the data from both calls will be merged. Note that the ibrav from the second call will overwrite the value from the first call. So the corresponding input data will be: ibrav=0, celldm(1)=14.14213562373095048800, ecutwfc=25.0, nat=2, ntyp=1. Note that celldm(1) was specified as simple mathematical expression: this can be done for all the cards and for namelist variables of real and integer type.
How to unset a namelist variable
Once a given namelist variable is set, it can be unset by assigning it an "empty" value as follows:
# a namelist variable is unset as follows: SYSTEM { celldm(3) = }
How to clear the content of a given namelist of card
A given namelist or card can be cleared (unset) via the input_clear command as follows:
# let's clear the IONS and CELL namelists input_clear IONS CELL
Input Data Stacking
Input data stacking is a useful concept when performing multiple calculations. For its description, see either the Section 2.4 Input Data Stacking or the corresponding section in tutorial.html .
Description of namelists and cards supported by PWTK
• pw.x and cp.x namelist commands:
* CONTROL * SYSTEM * ELECTRONS * IONS * CELL * FCP (pw.x only) * PRESS_AI (cp.x only) * WANNIER (cp.x only)
• pw.x and cp.x card commands:
* ATOMIC_SPECIES * ATOMIC_POSITIONS * ATOMIC_VELOCITIES * ATOMIC_FORCES * K_POINTS (pw.x only) * ADDITIONAL_K_POINTS (pw.x only) * CELL_PARAMETERS * REF_CELL_PARAMETERS (cp.x only) * OCCUPATIONS * CONSTRAINTS * PLOT_WANNIER (cp.x only) * AUTOPILOT (cp.x only)
Note: in PWTK the AUTOPILOT card is specified without the ENDRULES keyword as:
AUTOPILOT { on_step = N : .... on_step = M : .... }
• neb.x commands for specifying input data:
* PATH * CLIMBING_IMAGES
Beware: PWTK does not use BEGIN / END, BEGIN_PATH_INPUT / END_PATH_INPUT, BEGIN_ENGINE_INPUT / END_ENGINE_INPUT, and BEGIN_POSITIONS / END_POSITIONS keywords. Instead all namelists/cards are specified as for other programs (enclosing with {...} or "..."). Atomic positions are specified using the POSITIONS { ... } card, which represents the BEGIN_POSITIONS/END_POSITIONS pair of neb.x input.
Here is an example of how the neb.x input is specified in PWTK:
PATH { CI_scheme = 'manual', num_of_images = 9, ... } CLIMBING_IMAGES { 3 6 }
CONTROL { nstep = 250, ... } SYSTEM { ... } ELECTRONS { ... } ATOMIC_SPECIES { ... } K_POINTS (automatic) { ... }
POSITIONS { FIRST_IMAGE ATOMIC_POSITIONS (angstrom) ... INTERMEDIATE_IMAGE ATOMIC_POSITIONS (angstrom) ... LAST_IMAGE ATOMIC_POSITIONS (angstrom) ... }
• ph.x command for specifying input data:
* INPUTPH
The INPUTPH is a bit peculiar command, because the ph.x input file is composed of title-line + INPUTPH namelist + some additional lines. So the INPUTPH can be used in any of the following three different flavors:
1. INPUTPH { title-line } { inputph-namelist } { affix-lines } 2. INPUTPH { inputph-namelist } { affix-lines } 3. INPUTPH { inputph-namelist }
For example:
INPUTPH { phonons of Si at Gamma } { tr2_ph = 1.0d-14, epsil = .true., amass(1) = 28.08, fildyn = 'si.dynG', } { 0.0 0.0 0.0 }
• matdyn.x command for specifying input data:
* MATDYN
Beware: matdyn.x actually uses INPUT namelist, but this name is too generic, hence PWTK uses MATDYN instead.
The MATDYN namelist can be specified in two different flavors:
1. MATDYN { matdyn-namelist} { affix-lines } 2. MATDYN { matdyn-namelist}
For example:
MATDYN { asr = .true. flfrc = 'si.fc' flfrq = 'si.freq' } { 26 0.0 0.0 0.0 0.0 ... }
• q2r.x command for specifying input data:
* Q2R
Beware: q2r.x actually uses INPUT namelist, but this name is too generic, hence PWTK uses Q2R instead.
The Q2R namelist can be specified in two different flavors:
1. Q2R { q2r-namelist} { affix-lines } 2. Q2R { q2r-namelist}
• dynmat.x command for specifying input data:
* DYNMAT
Beware: dynmat.x actually uses INPUT namelist, but this name is too generic, hence PWTK uses DYNMAT instead.
• pp.x command for specifying input data:
* INPUTPP * PLOT
• projwfc.x command for specifying input data:
* PROJWFC
• molecularpdos.x command for specifying input data:
* MOPDOS
Beware: molecularpdos.x actually uses INPUTMOPDOS namelist, but this name is too long, hence PWTK uses shorter MOPDOS instead.
• dos.x command for specifying input data:
* DOS
• bands.x command for specifying input data:
* BANDS
• hp.x command for specifying input data:
* INPUTHP
• Commands for specifying input data for turbo_*** set of programs
Note that the turbo_*** programs use/share LR_INPUT and LR_CONTROL namelists, hence in PWTK these namelists are shared among these programs, hence be carefull with their specs. To prevent a mess, input-data stacking can be used.
• turbo_davidson.x commands for specifying input data:
* LR_INPUT * LR_DAV
• turbo_lanczos.x commands for specifying input data:
* LR_INPUT * LR_CONTROL * LR_POST
• turbo_eels.x commands for specifying input data:
* LR_INPUT * LR_CONTROL
• turbo_spectrum.x commands for specifying input data:
* LR_INPUT * LR_CONTROL
How to deal with input specification and execution of unsupported codes
For other executables that are not directly supported by PWTK, input file can be constructed by the writeFile command, whereas calculation can be submitted via the generic run command (see ::pwtk::run). Here is an example how to run ev.x code:
writeFile ev.murnaghan.in { au fcc 4 Etot-vs-alat.dat ev.murnaghan.out } run -serial ev.x ev.murnaghan.in
See also the last part of the following example script: examples/Si.pwtk