The QEInput object

The QEInput object is a input handler for QE:

from qepy.io import QEInput
qeinput = QEInput()

List of all Methods

class qepy.io.QEInput(filename=None, qe_options={}, **kwargs)[source]

Input for QE

Read/write the QE input file. The input qe_options or the output after reading an input is a dictionary. There are two main types of QE input parameters : namelist and card. In qe_options namelist keys always start with '&', and the value is a dictionary. Cards keys are the first line of the card, and the value is a list of strings.

e.g.

qe_options = {
    '&control' : {
        'calculation' : "'scf'",
        'nstep' : 50,
        },
    'k_points automatic' : ['1 1 1 0 0 0'],
    }

Note

Nota bene: when the value of a namelist is a string (character), it needs to be enclosed by quotation marks in addition to the usual string apostophies.

Parameters:
  • filename (str) -- Name of QE input file

  • qe_options (dict) -- A dictionary with input parameters for QE to generate QE input file.

iter_lines(fh, sep='!', **kwargs)[source]

return the non-comment part of non-empty line

sep is the comment characters. The comment line or empty line will be skip. If the line is mixed, only the front non-comment part will return.

Parameters:
  • fh (object) -- file handler

  • sep (str, list or tuple) -- The delimiter string, multiple delimiters can given by a list

read_card(fh, **kwargs)[source]

read the card

The comments lines which start with '#' will be kept. Here assuming if all the characters of first word are alphabet letters and length is greater than 6, this line will be next card.

Parameters:

fh (iter) -- modified file handler

read_namelist(fh, **kwargs)[source]

read the namelist

Parameters:

fh (iter) -- modified file handler

read_qe_input(filename, **kwargs)[source]

read the QE input file

Parameters:

filename (str) -- file name of QE input file

classmethod update_atoms(atoms, qe_options, prog='pw', **kwargs)[source]

update atomic information

Parameters:
  • atoms (ase.Atoms) -- ase.Atoms has all atomic information in ASE units

  • qe_options (dict) -- Input parameters of QE

classmethod update_options(options={}, qe_options={}, **kwargs)[source]

update options

Use options to update qe_options

Parameters:
  • options (dict) -- New options

  • qe_options (dict) -- QE options

write_qe_input(filename, atoms=None, basefile=None, qe_options={}, prog='pw', **kwargs)[source]

Write the QE input file

Parameters:
  • filename (str) -- The file name of output file

  • atoms (ase.Atoms) -- structure information with ase.Atoms

  • basefile (str) -- If set, will base on this file only update atomic information

  • qe_options (dict) -- Input parameters of QE