pymatgen.io.pwscf module¶
-
class
PWInput(structure, pseudo=None, control=None, system=None, electrons=None, ions=None, cell=None, kpoints_mode='automatic', kpoints_grid=(1, 1, 1), kpoints_shift=(0, 0, 0))[source]¶ Bases:
objectBase input file class. Right now, only supports no symmetry and is very basic.
Initializes a PWSCF input file.
Parameters: - structure (Structure) – Input structure. For spin-polarized calculation, properties (e.g. {“starting_magnetization”: -0.5, “pseudo”: “Mn.pbe-sp-van.UPF”}) on each site is needed instead of pseudo (dict).
- pseudo (dict) – A dict of the pseudopotentials to use. Default to None.
- control (dict) – Control parameters. Refer to official PWSCF doc on supported parameters. Default to {“calculation”: “scf”}
- system (dict) – System parameters. Refer to official PWSCF doc on supported parameters. Default to None, which means {}.
- electrons (dict) – Electron parameters. Refer to official PWSCF doc on supported parameters. Default to None, which means {}.
- ions (dict) – Ions parameters. Refer to official PWSCF doc on supported parameters. Default to None, which means {}.
- cell (dict) – Cell parameters. Refer to official PWSCF doc on supported parameters. Default to None, which means {}.
- kpoints_mode (str) – Kpoints generation mode. Default to automatic.
- kpoints_grid (sequence) – The kpoint grid. Default to (1, 1, 1).
- kpoints_shift (sequence) – The shift for the kpoints. Defaults to (0, 0, 0).
-
static
from_file(filename)[source]¶ Reads an PWInput object from a file.
Parameters: filename (str) – Filename for file Returns: PWInput object
-
static
from_string(string)[source]¶ Reads an PWInput object from a string.
Parameters: string (str) – PWInput string Returns: PWInput object
-
class
PWOutput(filename)[source]¶ Bases:
object-
final_energy¶
-
lattice_type¶
-
patterns= {'energies': 'total energy\\s+=\\s+([\\d\\.\\-]+)\\sRy', 'ecut': 'kinetic\\-energy cutoff\\s+=\\s+([\\d\\.\\-]+)\\s+Ry', 'lattice_type': 'bravais\\-lattice index\\s+=\\s+(\\d+)', 'celldm1': 'celldm\\(1\\)=\\s+([\\d\\.]+)\\s', 'celldm2': 'celldm\\(2\\)=\\s+([\\d\\.]+)\\s', 'celldm3': 'celldm\\(3\\)=\\s+([\\d\\.]+)\\s', 'celldm4': 'celldm\\(4\\)=\\s+([\\d\\.]+)\\s', 'celldm5': 'celldm\\(5\\)=\\s+([\\d\\.]+)\\s', 'celldm6': 'celldm\\(6\\)=\\s+([\\d\\.]+)\\s', 'nkpts': 'number of k points=\\s+([\\d]+)'}¶
-
read_pattern(patterns, reverse=False, terminate_on_match=False, postprocess=<class 'str'>)[source]¶ General pattern reading. Uses monty’s regrep method. Takes the same arguments.
Parameters: - patterns (dict) – A dict of patterns, e.g., {“energy”: r”energy(sigma->0)s+=s+([d-.]+)”}.
- reverse (bool) – Read files in reverse. Defaults to false. Useful for large files, esp OUTCARs, especially when used with terminate_on_match.
- terminate_on_match (bool) – Whether to terminate when there is at least one match in each key in pattern.
- postprocess (callable) – A post processing function to convert all matches. Defaults to str, i.e., no change.
- Renders accessible:
- Any attribute in patterns. For example, {“energy”: r”energy(sigma->0)s+=s+([d-.]+)”} will set the value of self.data[“energy”] = [[-1234], [-3453], …], to the results from regex and postprocess. Note that the returned values are lists of lists, because you can grep multiple items on one line.
-