PhInput

This module manages the input file for ph.x computations of QuantumESPRESSO. The input can be created from scratch or can be initialized from an existing input file.

class mppi.InputFiles.PhInput.PhInput(file=None, tr2_ph=1e-12, trans=True, qplot=True, ldisp=False, prefix='ph', outdir='./')[source]

Bases: dict

Class to generate an manipulate the QuantumESPRESSO ph.x input files. Can be initialized either reading from a file or starting from scratch. Actually the parser of th kpoints has not yet been implented.

Note that the default parameters for the init of the class set the qplot=True and ldisp=False so ph.x performs the calculation on the list of q-points in the input in the form

nqs

xq(1,i) xq(2,i) xq(3,1) nq(1)

xq(1,nqs) xq(2,nqs) xq(3,nqs) nq(nqs)

where nqs are the number of points, xq(j,i) is the j-th coordinate of the i-th point, in units of 2pi/a0 (a0 = lattice parameter), and nq(i) is the weigth of the i-th point

cards = ['kpoints']
convert_string()[source]

Convert the input object into a string

get_outdir()[source]

Get the value of outdir.

Returns:

The value of the outdir key of the input dictionary.

If the key is not present return the default value ‘.’

Return type:

string

get_prefix()[source]

Get the value of prefix.

Returns:

The value of the prefix key of the input dictionary. If the key is not present return the default value ‘pwscf’

Return type:

string

namelist = ['inputph']
parseInputFile(file)[source]

Read the arguments and variables from the input file.

Parameters:

file (string) – name of an exsistent input file, used to initialize the dictionary of the object

read_kpoints()[source]

Read the kpoints from theinput file and attribute the associated variables in the dictionary….to be implemented

set_inputph_variables(**kwargs)[source]

Add to the inputph key of the input dictionary the elements kwargs[key] = kwargs[value] for all the elements of the kwargs provided as input.

Parameters:

kwargs – variable(s) added in the form name = value

set_kpoints(klist)[source]

Set the kpoints on which phonons are computed. Actually only the method associated to qplot=True and ldisp=False is implemented.

Parameters:
  • klist (list) – list with the coordinates and the weights of the kpoints

  • kweigth (list) – array with the weigth of each kpoint. If is None a uniform weight equal to 1 is attributed to each kpoint

set_outdir(outdir)[source]

Set the value of outdir

Parameters:

outdir (string) – value of the outdir

set_prefix(prefix)[source]

Set the value of prefix

Parameters:

prefix (string) – value of the prefix

slicefile(group)[source]

Return a list that contains the variables associated to the group key of the input file

store(group)[source]

Look for the namelist (control, system, electrons,…) in the file and attribute the associated variables in the dictionary

stringify_group(group)[source]
stringify_kpoints(line)[source]
write(file)[source]

Write the QE input on file.

Parameters:

file (string) – name of the file

mppi.InputFiles.PhInput.fortran_bool(boolean)[source]