schrodinger.application.matsci.espresso.utils module¶
Copyright Schrodinger, LLC. All rights reserved.
-
schrodinger.application.matsci.espresso.utils.
get_shell_runner
(check_only=False, write_orig=False)¶ Get path to the shell runner script.
Parameters: - check_only (bool) – If True, only check if runner exists and return
- write_orig (bool) – If True, create original shell runner even if runner exists
Return type: (str, bool)
Returns: Path to shell runner and True if shell runner has been just created, otherwise False
-
schrodinger.application.matsci.espresso.utils.
add_qe_parallel_parser_arguments
(parser)¶ Add QE parallel arguments to the parser.
Parameters: parser ( argparse.ArgumentParser
) – The parser to add arguments to
-
schrodinger.application.matsci.espresso.utils.
get_pkeywords
(options, ncpus)¶ Validate and get string of parallel keywords for QE binaries (pw.x, etc.).
Parameters: - options (argparse Namespace object) – The input options
- ncpus (int) – Number of total requested CPUs
Return type: bool, str or list
Returns: If converted successfully, True and a list of [keyword, value] are returned, otherwise, False and error message are returned
-
schrodinger.application.matsci.espresso.utils.
get_mag_hubbu
(atom)¶ Get starting magnetization and Hubbard U parameters from atom property. If not present, return the default.
Parameters: atom ( schrodinger.structure._StructureAtom
) – Atom from which values are takenReturn type: tuple(float, float) Returns: Tuple of starting magnetization and HUbbard U parameter
-
schrodinger.application.matsci.espresso.utils.
set_mag_hubbu
(atom, mag, hubbu)¶ Set starting magnetization and Hubbard U parameters in atom property.
Parameters: - atom (
schrodinger.structure._StructureAtom
) – Atom for which values are set - mag (float) – Starting magnetization
- hubbu (float) – Hubbard U parameter
- atom (
-
schrodinger.application.matsci.espresso.utils.
sync_pbc
(struct, lattice_params=None, chorus_params=None, prioritize_cparams=False)¶ Sync PBC properties in place (without creating a new structure) for struct. If all PBC properties are absent (both chorus and PDB) return False. It is possible to provide new lattice or chorus parameters and to prioritize one of the sets.
Type: Param: Structure to be modified
Parameters: - lattice_params (list or numpy.array or None) – contains the a, b, c, alpha, beta, and gamma lattice parameters or None. These will be used instead of ones possibly obtained from the struct
- chorus_params (list or numpy.array or None) – contains the nine chorus properties, i.e. ax, ay, az, bx, …, cz or None. These will be used instead of ones possibly obtained from the struct
Param: Prioritize chorus params over lattice params if True. If False, lattice params have priority
Return type: bool
Returns: True on syncing success, False if both sets were not provided or empty
-
schrodinger.application.matsci.espresso.utils.
get_mpircores_from_environ
()¶ Get -MPICORES flag value from SCHRODINGER_COMMANDLINE environment variable. If not found, return 1.
Return type: int Returns: MPICORES value or 1 (if not defined)
-
class
schrodinger.application.matsci.espresso.utils.
PPHeaderHTMLParser
(*args, **kwargs)¶ Bases:
html.parser.HTMLParser
Parse and store pp_header tag attributes.
-
PP_HEADER_TAG
= 'pp_header'¶
-
handle_starttag
(tag, attrs)¶ Save PP_HEADER attributes in dictionary.
-
-
class
schrodinger.application.matsci.espresso.utils.
UPFParser
(path)¶ Bases:
object
Class that handles UPF parsing.
-
PP_TYPE_PAW
= 'PAW'¶
-
PP_TYPES
= ('1/r', 'US', 'NC', 'PAW')¶
-
FULLY_REL
= 'full'¶
-
-
class
schrodinger.application.matsci.espresso.utils.
HighSymmetryKPath
(struct)¶ Bases:
object
Based on symmetry/bandstructure.py :: HighSymmKpath (MIT license)
This class looks for path along high symmetry lines in the Brillouin Zone. It is based on Setyawan, W., & Curtarolo, S. (2010). High-throughput electronic band structure calculations: Challenges and tools. Computational Materials Science, 49(2), 299-312. doi:10.1016/j.commatsci.2010.05.010
-
cubic
()¶ Generate ‘edge’ k-points for the cubic lattice.
Return type: dict Returns: keys: ‘kpoints’ is a dict with labels as keys and coordinates as values, ‘path’ is a list of labels from the ‘kpoints’ dict.
-
fcc
()¶ Generate ‘edge’ k-points for the FCC cubic lattice.
Return type: dict Returns: keys: ‘kpoints’ is a dict with labels as keys and coordinates as values, ‘path’ is a list of labels from the ‘kpoints’ dict.
-
bcc
()¶ Generate ‘edge’ k-points for the BCC cubic lattice.
Return type: dict Returns: keys: ‘kpoints’ is a dict with labels as keys and coordinates as values, ‘path’ is a list of labels from the ‘kpoints’ dict.
-
tet
()¶ Generate ‘edge’ k-points for the tetrahedral lattice.
Return type: dict Returns: keys: ‘kpoints’ is a dict with labels as keys and coordinates as values, ‘path’ is a list of labels from the ‘kpoints’ dict.
-
bctet1
(c, a)¶ Generate ‘edge’ k-points for the tetrahedral lattice with I setting.
Parameters: - c (float) – C length
- a (float) – A length
Return type: dict
Returns: keys: ‘kpoints’ is a dict with labels as keys and coordinates as values, ‘path’ is a list of labels from the ‘kpoints’ dict.
-
bctet2
(c, a)¶ Generate ‘edge’ k-points for the tetrahedral lattice with I setting.
Parameters: - c (float) – C length
- a (float) – A length
Return type: dict
Returns: keys: ‘kpoints’ is a dict with labels as keys and coordinates as values, ‘path’ is a list of labels from the ‘kpoints’ dict.
-
orc
()¶ Generate ‘edge’ k-points for the orthorhombic lattice.
Return type: dict Returns: keys: ‘kpoints’ is a dict with labels as keys and coordinates as values, ‘path’ is a list of labels from the ‘kpoints’ dict.
-
orcf1
(a, b, c)¶ Generate ‘edge’ k-points for the orthorhombic lattice with F setting.
Parameters: - a (float) – A length
- b (float) – B length
- c (float) – C length
Return type: dict
Returns: keys: ‘kpoints’ is a dict with labels as keys and coordinates as values, ‘path’ is a list of labels from the ‘kpoints’ dict.
-
orcf2
(a, b, c)¶ Generate ‘edge’ k-points for the orthorhombic lattice with F setting.
Parameters: - a (float) – A length
- b (float) – B length
- c (float) – C length
Return type: dict
Returns: keys: ‘kpoints’ is a dict with labels as keys and coordinates as values, ‘path’ is a list of labels from the ‘kpoints’ dict.
-
orcf3
(a, b, c)¶ Generate ‘edge’ k-points for the orthorhombic lattice with F setting.
Parameters: - a (float) – A length
- b (float) – B length
- c (float) – C length
Return type: dict
Returns: keys: ‘kpoints’ is a dict with labels as keys and coordinates as values, ‘path’ is a list of labels from the ‘kpoints’ dict.
-
orci
(a, b, c)¶ Generate ‘edge’ k-points for the orthorhombic lattice with I setting.
Parameters: - a (float) – A length
- b (float) – B length
- c (float) – C length
Return type: dict
Returns: keys: ‘kpoints’ is a dict with labels as keys and coordinates as values, ‘path’ is a list of labels from the ‘kpoints’ dict.
-
orcc
(a, b, c)¶ Generate ‘edge’ k-points for the orthorhombic lattice with C setting.
Parameters: - a (float) – A length
- b (float) – B length
- c (float) – C length
Return type: dict
Returns: keys: ‘kpoints’ is a dict with labels as keys and coordinates as values, ‘path’ is a list of labels from the ‘kpoints’ dict.
-
hex
()¶ Generate ‘edge’ k-points for the hexagonal lattice.
Return type: dict Returns: keys: ‘kpoints’ is a dict with labels as keys and coordinates as values, ‘path’ - a list of labels from the ‘kpoints’.
-
rhl1
(alpha)¶ Generate ‘edge’ k-points for the rhombohedral lattice with alpha < 90.
Parameters: alpha (float) – Alpha cell angle in radians Return type: dict Returns: keys: ‘kpoints’ is a dict with labels as keys and coordinates as values, ‘path’ is a list of labels from the ‘kpoints’ dict.
-
rhl2
(alpha)¶ Generate ‘edge’ k-points for the rhombohedral lattice with alpha > 90.
Parameters: alpha (float) – Alpha cell angle in radians Return type: dict Returns: keys: ‘kpoints’ is a dict with labels as keys and coordinates as values, ‘path’ is a list of labels from the ‘kpoints’ dict.
-
mcl
(b, c, beta)¶ Generate ‘edge’ k-points for the monoclinic lattice.
Parameters: - b (float) – B length
- c (float) – C length
- beta (float) – Beta cell angle in radians
Return type: dict
Returns: keys: ‘kpoints’ is a dict with labels as keys and coordinates as values, ‘path’ is a list of labels from the ‘kpoints’ dict.
-
mclc1
(a, b, c, alpha)¶ Generate ‘edge’ k-points for the monoclinic lattice with C setting.
Parameters: - a (float) – A length
- b (float) – B length
- c (float) – C length
- alpha (float) – Alpha cell angle in radians
Return type: dict
Returns: keys: ‘kpoints’ is a dict with labels as keys and coordinates as values, ‘path’ is a list of labels from the ‘kpoints’ dict.
-
tria
()¶
-
-
class
schrodinger.application.matsci.espresso.utils.
MemoryEstimator
(vecs, ecutwfc, ecutrho, nproc, nks, nspin, nbnd, ntyp, nmix, lscf)¶ Bases:
object
Class to estimate RAM memory for a PW (QE) job.
-
COMPLEX_SIZE
= 16.0¶
-
REAL_SIZE
= 8.0¶
-
INT_SIZE
= 4.0¶
-
MBYTE
= 1048576.0¶
-
NFFTX
= 2049¶
-
realSpaceGridInit
(at_vecs, bg_vecs, gcutm)¶ Gets minimal 3D real-space FFT grid.
Parameters: - at_vecs (3 x 3 table of floats) – Lattice vectors in the units of alat
- bg_vecs (3 x 3 table of floats) – Reciprocal lattice vectors in the units of 1/alat
- gctum – Radius of the sphere to fit the FFT grid
Return type: list of 3 floats
Returns: FFT grid sizes
-
getGoodFFTDim
(fft_dim)¶ Get a good FFT dimension.
Parameters: fft_dim (int) – FFT dimension Return type: int Returns: Good FFT dimension, if exists
-
isGoodDim
(fft_dim)¶ Check if FFT dimension is good.
Parameters: fft_dim (int) – FFT dimension :rtype bool :return: True, if FFT dimension is good, False otherwise
-