PseudoSet Module#
Functionality for gathering, parsing, and validating collections of pseudopotentials.
- nexus.pseudoset.pp_elem_label(filename: PathLike, *, guard=False) tuple[str, str] | tuple[str, str, bool][source]#
Get the label and atomic symbol of an element from a pseudopotential file name.
- Parameters:
- filename
PathLike Either a
Pathobject or the name of a file as a string.- guardbool, default=False
Optionally raise an error if the file name is invalid or if the filename does not begin with a valid element prefix.
- filename
- Returns:
- elem_label
str The label of the pseudopotential file.
- symbol
str The atomic symbol of the element that the pseudopotential file describes.
- is_elembool
A bool to indicate whether or not the file has a valid element label. If
guard=Truethis is not returned, and an error is raised if the file does not have a valid prefix.
- elem_label
Examples
>>> pp_elem_label("Si.ccECP.xml") ('Si', 'Si', True) >>> pp_elem_label("Si-USPP.upf") ('Si', 'Si', True) >>> pp_elem_label("Si_NCPP.upf") ('Si', 'Si', True) >>> pp_elem_label("Si1.ccECP.xml") ('Si1', 'Si', True) >>> pp_elem_label("Not_An_Element.ccECP.xml") ('Not', 'Not', False)
Passing a
Pathobject only gets the file name.>>> from pathlib import Path >>> pp_elem_label(Path("/path/to/pseudo_dir/Si.ccECP.xml")) ('Si', 'Si', True)
Use
guard=Trueif you want to raise an error and not deal with an invalid output.>>> pp_elem_label("Not_An_Element.ccECP.xml", guard=True) Traceback (most recent call last): ... RuntimeError: cannot determine element for pseudopotential file: Not_An_Element.ccECP.xml pseudopotential file names must be prefixed by an atomic symbol or label (e.g. Si, Si1, etc)
- nexus.pseudoset.read_upf_z_valence(file: PathLike) int | float[source]#
Read Z-valence from a UPF-compliant pseudopotential file.
- nexus.pseudoset.read_qmcpack_xml_z_valence(file: PathLike) int | float[source]#
Read the Z-valence from a QMCPACK-compatible XML pseudopotential file.
- nexus.pseudoset.read_potcar_z_valence(file: PathLike) int | float[source]#
Read the Z-valence from a POTCAR file.
This function uses the format specifications from the VASP wiki, and assumes that the file is a valid POTCAR, so the second line should be the Z-valence [1].
References
- nexus.pseudoset.ppset(label: str, **codes_pps: Collection[str])[source]#
Register pseudopotentials for codes with a label.
Deprecated since version 2.4.0:
ppsethas been replaced bygenerate_pseudosetbecause the labeling system thatppsetrequires checks for the existence of the label at runtime, whereasgenerate_pseudosetreturns an object with a name as other generate functions do.This is intended as a backwards-compatible interface to not break existing user code. Users are suggested to migrate to
generate_pseudosetor callingPseudoSetand its methods for pseudopotential handling.- Parameters:
- label
str Label of the pseudopotential set.
- **codes_pps
Map of codes to collections of names of the pseudopotential files.
- label
See also
PseudoSet.file_extsKnown file extensions
PseudoSet.from_dirAutomatically reading pseudos from a directory
PseudoSet.from_mixed_dirAutomatically reading pseudos from a directory
Notes
Using this function is generally discouraged for users as the use of a string label for identifying pseudopotentials prevents Python from raising a
NameErrorwhen the label supplied to later functions does not match the label used when calling this function.For this reason, it is strongly encouraged to use
generate_pseudosetorPseudoSetand/or its member functionsPseudoSet.from_dirandPseudoSet.from_mixed_dir.Examples
After passing
pseudo_dirtosettings, call this with the file names for each pseudopotential.>>> ppset( ... label = 'bfd', ... pwscf = ["C.BFD.upf", "H.BFD.upf", "O.BFD.upf"], ... qmcpack = ["C.BFD.xml", "H.BFD.xml", "O.BFD.xml"], ... )
- class nexus.pseudoset.PseudoSet(pseudos: Collection[PathLike] | Mapping[Elements | str, PathLike], codes: str | Collection[str] = 'detect', Zeff_map: Mapping[PathLike, int] | None = None, *, skip_invalid: bool = False)[source]#
Bases:
DevBaseNexusObject representing a set of pseudopotentials.
- Parameters:
- pseudos
collectionofstr/Path ormapofstr/ElementstoPath A collection of pseudopotential files or a map of elements to file paths.
- codes
oneormoreof{“espresso”, “gamess”, “vasp”, “qmcpack”, “rmg”, “pyscf”, “detect”}, default=”detect” The name of the code that the pseudos are formatted for, or if
"detect", will auto-detect the code name from the file extensions.- Zeff_map
Mapofstr/Elementstoint, optional A mapping of elements to their effective nuclear charges (Z-valences). If this is supplied, it will override any parts of the code that may try to parse the pseudopotential file to get the Z-valence.
- skip_invalidbool, default=False (keyword-only)
If
True, then this will emit a warning rather than raise an error if a file is not found or if the file does not have a valid name.
- pseudos
- Attributes:
- pseudos
dictofstr:Path Dictionary mapping element labels to their pseudos.
- codes
setofoneormoreof{“espresso”, “gamess”, “vasp”, “qmcpack”, “rmg”, “pyscf”} Name of the program(s) that these pseudos are meant for. Due to overlap between some programs for file extension, this can occasionally contain more than one code.
- Zeff_map
Mapofstr:int A mapping of elements to their effective nuclear charges (Z-valences).
- pseudo_dirs
setofPath The directories that the pseudopotentials are stored in.
- pseudo_files
dictofstr:str(classattribute) Dictionary mapping pseudopotential file names to their full paths, set by passing
pseudo_dirtosettings.- labeled_pseudosets
dictofstr:dictofstr:PseudoSet(classattribute) Pseudopotential sets registered by label, then compatible code.
- pseudos
Methods
copy()from_dir(pseudo_dir[, code, extension, ...])Read in pseudopotentials from a directory.
from_mixed_dir(pseudo_dir[, codes, ...])Read in pseudos from a directory with pseudos for more than one code.
get_Zeff(elem_labels, *[, missing_as_ae])Get the Z-valences for each element in the list of elements.
get_pseudos(pseudos, system, code)Get the pseudopotential files for the elements in a physical system.
save([filepath])clear
error
items
keys
load
nxs_print
update
values
warn
- file_exts = mappingproxy({'espresso': frozenset({'.vdb', '.upf', '.van', '.rrkj3', '.ncpp'}), 'gamess': frozenset({'.gms', '.gamess'}), 'vasp': frozenset({'.potcar', '.vasp', 'potcar'}), 'qmcpack': frozenset({'.xml', '.data'}), 'rmg': frozenset({'.upf', '.xml'}), 'pyscf': frozenset({'.nwchem', '.gth'})})#
- known_codes = frozenset({'espresso', 'gamess', 'pyscf', 'qmcpack', 'rmg', 'vasp'})#
- code_aliases = mappingproxy({'quantum_espresso': 'espresso', 'quantum espresso': 'espresso', 'pwscf': 'espresso', 'qe': 'espresso', 'gms': 'gamess'})#
- classmethod from_dir(pseudo_dir: PathLike, code: str = 'detect', extension: str | Collection[str] | None = None, include: str | None = None, exclude: str | None = None, Zeff_map: Mapping[PathLike, int] | None = None, *, skip_invalid: bool = False) PseudoSet[source]#
Read in pseudopotentials from a directory.
- Parameters:
- pseudo_dir
PathLike The directory from which to read pseudopotentials. Does not support nested directories, except for those that contain a POTCAR file.
- code{“espresso”, “gamess”, “vasp”, “qmcpack”, “rmg”, “pyscf”, “detect”}, default=”detect”
The name of the code that the pseudos are formatted for, or if
"detect", will auto-detect the code name from the file extensions.- extension
strorlistofstr, optional Optionally filter the files in the directory by their extension.
If this is
Noneit will use the file suffixes inPseudoSet.file_exts, unlesscodes="detect", in which case it will do nothing.If this is a string or list of strings, it is assumed the string(s) are the file suffixes to filter by. The strings should include a leading
., e.g..xml, notxml.- include
str, optional A Unix shell-style wildcard. All files matched by this are included in the final
PseudoSet. By default this matches all files.- exclude
str, optional A Unix shell-style wildcard. All files matched by this are excluded in the final
PseudoSet. By default this matches nothing.- Zeff_map
Mapofstr/Elementstoint, optional A mapping of elements to their effective nuclear charges (Z-valences). If this is supplied, it will override any parts of the code that may try to parse the pseudopotential to get the Z-valence.
- skip_invalidbool, default=False (keyword-only)
If
True, then this will emit a warning rather than raise an error if a file is not found or if the file does not have a valid name.
- pseudo_dir
See also
file_extsDictionary mapping codes to file extensions.
known_codesCodes known by Nexus.
Examples
Reading pseudos in a directory with only one style of pseudo.
>>> os.listdir(pseudo_dir) ['H.ccECP.xml', 'C.ccECP.xml', 'Fe.ccECP.xml'] >>> psps = PseudoSet.from_dir(pseudo_dir) >>> for lbl, pth in psps.pseudos.items(): print(f"{lbl}: {pth}") H: /path/to/pseudo_dir/H.ccECP.xml C: /path/to/pseudo_dir/C.ccECP.xml Fe: /path/to/pseudo_dir/Fe.ccECP.xml
Reading in only the UPF pseudos in a directory with UPF and XML pseudos.
>>> os.listdir(pseudo_dir) ['H.ccECP.xml', 'C.ccECP.xml', 'H.ccECP.upf', 'C.ccECP.upf'] >>> psps = PseudoSet.from_dir(pseudo_dir, code="espresso") >>> for lbl, pth in psps.pseudos.items(): print(f"{lbl}: {pth}") C: /path/to/pseudo_dir/C.ccECP.upf H: /path/to/pseudo_dir/H.ccECP.upf
Filtering two different kinds of pseudos with the same extensions.
>>> os.listdir(pseudo_dir) ['H.ccECP.upf', 'C.ccECP.upf', 'H.USPP.upf', 'C.USPP.upf'] >>> psps = PseudoSet.from_dir(pseudo_dir, include="*USPP*") >>> for lbl, pth in psps.pseudos.items(): print(f"{lbl}: {pth}") C: /path/to/pseudo_dir/C.USPP.upf H: /path/to/pseudo_dir/H.USPP.upf
Filtering pseudos by both extension and pattern.
>>> os.listdir(pseudo_dir) ['H.ccECP.upf', 'C.ccECP.upf', 'H.USPP.upf', 'C.USPP.upf', 'H.ccECP.xml', 'C.ccECP.xml'] >>> psps = PseudoSet.from_dir(pseudo_dir, code="espresso", include="*ccECP*") >>> for lbl, pth in psps.pseudos.items(): print(f"{lbl}: {pth}") C: /path/to/pseudo_dir/C.ccECP.upf H: /path/to/pseudo_dir/H.ccECP.upf
Filtering out VASP pseudos with similar names. Pattern matches anything without an underscore.
>>> os.listdir(pseudo_dir) ['H_sv_GW', 'C', 'C_GW', 'H_sv', 'H_GW', 'C_sv_GW', 'C_sv', 'H'] >>> psps = PseudoSet.from_dir(pseudo_dir, code="vasp", exclude="*_*") >>> for lbl, pth in psps.pseudos.items(): print(f"{lbl}: {pth}") C: /path/to/pseudo_dir/C/POTCAR H: /path/to/pseudo_dir/H/POTCAR
Including VASP pseudos ending with
_sv.>>> os.listdir(pseudo_dir) ['H_sv_GW', 'C', 'C_GW', 'H_sv', 'H_GW', 'C_sv_GW', 'C_sv', 'H'] >>> psps = PseudoSet.from_dir(pseudo_dir, code="vasp", include="*_sv") >>> for lbl, pth in psps.pseudos.items(): print(f"{lbl}: {pth}") C: /path/to/pseudo_dir/C_sv/POTCAR H: /path/to/pseudo_dir/H_sv/POTCAR
Including VASP pseudos ending with
_GW, but do not contain_sv.>>> os.listdir(pseudo_dir) ['H_sv_GW', 'C', 'C_GW', 'H_sv', 'H_GW', 'C_sv_GW', 'C_sv', 'H'] >>> psps = PseudoSet.from_dir(pseudo_dir, code="vasp", include="*_GW", exclude="*_sv*") >>> for lbl, pth in psps.pseudos.items(): print(f"{lbl}: {pth}") C: /path/to/pseudo_dir/C_GW/POTCAR H: /path/to/pseudo_dir/H_GW/POTCAR
Including only VASP pseudos ending with
_sv_GW.>>> os.listdir(pseudo_dir) ['H_sv_GW', 'C', 'C_GW', 'H_sv', 'H_GW', 'C_sv_GW', 'C_sv', 'H'] >>> psps = PseudoSet.from_dir(pseudo_dir, code="vasp", include="*_sv_GW",) >>> for lbl, pth in psps.pseudos.items(): print(f"{lbl}: {pth}") C: /path/to/pseudo_dir/C_sv_GW/POTCAR H: /path/to/pseudo_dir/H_sv_GW/POTCAR
- classmethod from_mixed_dir(pseudo_dir: PathLike, codes: str | Collection[str] | None = None, extensions: Mapping[str, set[str]] | str | None = None, include: Mapping[str, str] | str | None = None, exclude: Mapping[str, str] | str | None = None, code_Zeff_map: Mapping[str, Mapping[str, int]] | Mapping[str, int] | None = None, *, skip_invalid: bool = False) dict[Literal['espresso', 'gamess', 'vasp', 'qmcpack', 'rmg', 'pyscf'], PseudoSet][source]#
Read in pseudos from a directory with pseudos for more than one code.
- Parameters:
- pseudo_dir
PathLike The directory from which to read pseudopotentials. Does not support nested directories, except for those that contain a POTCAR file.
- codes
oneormoreof{“espresso”, “gamess”, “vasp”, “qmcpack”, “rmg”, “pyscf”}, optional The code(s) to use to separate the files in the directory into their respective groups.
- extensions
Mapofcodestosetofstrorasinglestr, optional A dictionary mapping codes to the file extensions corresponding to those labels, or a single string that will be applied to all codes. If this is not provided, then the filters are automatically populated by the codes in
codes.- include
Mapofcodestostrorsinglestr, optional A dictionary mapping codes to a Unix shell-style wildcard. All files matched by this are included in the final
PseudoSet. By default this matches all files.- exclude
Mapofcodestostrorsinglestr, optional A dictionary mapping codes to a Unix shell-style wildcard. All files matched by this are excluded in the final
PseudoSet. By default this matches all files.- code_Zeff_map
MapofcodestoMapofstr/ElementstointorMapofstr/Elementstoint, optional A mapping for each code that maps elements to their effective nuclear charges (Z-valences), or a single mapping that will be applied to all codes. If this is supplied, it will override any parts of the code that may try to parse the pseudopotential to get the Z-valence.
- skip_invalidbool, default=False (keyword-only)
If
True, then this will emit a warning rather than raise an error if a file is not found or if the file does not have a valid name.
- pseudo_dir
- Returns:
See also
from_dirUsed to get pseudos after filters have been established.
file_extsDictionary mapping codes to file extensions.
known_codesCodes known by Nexus.
Notes
This function is the most generous in terms of what it is able to parse and separate, however it can result in errors if you have multiple pseudos with the same file extension for the same element. If you have a lot of pseudos with the same extension, you should use
PseudoSet.from_dirand provide a pattern to separate the pseudos.Examples
Filter a large collection of pseudos for multiple codes.
>>> print(contents_of_pseudo_dir) pseudo_dir ├── C │ └── POTCAR ├── C.BFD.gms ├── C.BFD.gth ├── C.ccECP.upf ├── C.ccECP.xml ├── C.USPP.upf ├── H │ └── POTCAR ├── H.BFD.gms ├── H.BFD.gth ├── H.ccECP.upf ├── H.ccECP.xml └── H.USPP.upf >>> psps = PseudoSet.from_mixed_dir( ... pseudo_dir=pseudo_dir, ... patterns={"espresso": "ccECP", "rmg": "USPP"} ... ) >>> for code, ps_set in psps.items(): ... print(f"{code} pseudos:") ... for lbl, psp in ps_set.pseudos.items(): ... print(f" {lbl}: {psp}") espresso pseudos: H: /path/to/pseudo_dir/H.ccECP.upf C: /path/to/pseudo_dir/C.ccECP.upf gamess pseudos: C: /path/to/pseudo_dir/C.BFD.gms H: /path/to/pseudo_dir/H.BFD.gms vasp pseudos: C: /path/to/pseudo_dir/C/POTCAR H: /path/to/pseudo_dir/H/POTCAR qmcpack pseudos: C: /path/to/pseudo_dir/C.ccECP.xml H: /path/to/pseudo_dir/H.ccECP.xml rmg pseudos: C: /path/to/pseudo_dir/C.USPP.upf H: /path/to/pseudo_dir/H.USPP.upf pyscf pseudos: C: /path/to/pseudo_dir/C.BFD.gth H: /path/to/pseudo_dir/H.BFD.gth
- static get_pseudos(pseudos: PseudoSet | str | Collection[str] | dict[str, Path] | None, system: PhysicalSystem | Collection[str], code: Literal['espresso', 'gamess', 'vasp', 'qmcpack', 'rmg', 'pyscf']) dict[str, str][source]#
Get the pseudopotential files for the elements in a physical system.
- Parameters:
- pseudos
PseudoSetorstrorCollectionofstrordict[str:PathLike]orNone Either a
PseudoSetobject, a string label fromppset, a list of pseudopotential file names, a dictionary mapping file names to file paths, orNone.- system
PhysicalSystemorcollectionofstrorNone The system to get pseudopotentials for, or a collection of element labels, or
None.- code{“espresso”, “gamess”, “vasp”, “qmcpack”, “rmg”, “pyscf”}
The name of the code requesting the pseudopotentials. This provides a way to ensure the user does not provide the wrong pseudos to a
generatecall.
- pseudos
- Returns:
Examples
Call with an instance of
PseudoSet.>>> psps = PseudoSet(["C.ccECP.xml", "H.ccECP.xml", "O.ccECP.xml"]) >>> PseudoSet.get_pseudos( ... pseudos=psps, ... system=["C", "H"], ... code="qmcpack", ... ) {'C.ccECP.xml': '/path/to/pseudo_dir/C.ccECP.xml', 'H.ccECP.xml': '/path/to/pseudo_dir/H.ccECP.xml'}
Or call with a label after using
ppset. (Deprecated)>>> ppset( ... label = 'my_pseudos', ... pwscf = ["C.ccECP.upf", "H.ccECP.upf", "O.ccECP.upf"], ... qmcpack = ["C.ccECP.xml", "H.ccECP.xml", "O.ccECP.xml"], ... ) >>> PseudoSet.get_pseudos( ... pseudos="my_pseudos", ... system=["C", "H"], ... code="qmcpack", ... ) {'C.ccECP.xml': '/path/to/pseudo_dir/C.ccECP.xml', 'H.ccECP.xml': '/path/to/pseudo_dir/H.ccECP.xml'}
You can also call with a list of pseudopotential names.
>>> PseudoSet.get_pseudos( ... pseudos=["C.ccECP.xml", "H.ccECP.xml"], ... system=["C", "H"], ... code="qmcpack", ... ) {'C.ccECP.xml': '/path/to/pseudo_dir/C.ccECP.xml', 'H.ccECP.xml': '/path/to/pseudo_dir/H.ccECP.xml'}
Most commonly this would be called with a
PhysicalSystemobject, created here withgenerate_physical_system.>>> sys = generate_physical_system( ... elem = ['C','H'], ... pos = np.empty((2,3)), ... C = 4, ... H = 1, ... ) >>> PseudoSet.get_pseudos( ... pseudos=["C.ccECP.xml", "H.ccECP.xml"], ... system=sys, ... code="qmcpack", ... ) {'C.ccECP.xml': '/path/to/pseudo_dir/C.ccECP.xml', 'H.ccECP.xml': '/path/to/pseudo_dir/H.ccECP.xml'}
Calling with a dict of
PseudoSet.>>> psps = PseudoSet.from_mixed_dir( ... pseudo_dir="/path/to/pseudo_dir", ... codes={"espresso", "qmcpack"}, ... ) >>> for code, ps_set in psps.items(): ... print(f"{code} pseudos:") ... for lbl, psp in ps_set.pseudos.items(): ... print(f" {lbl}: {psp}") espresso pseudos: H: /path/to/pseudo_dir/H.ccECP.upf C: /path/to/pseudo_dir/C.ccECP.upf qmcpack pseudos: C: /path/to/pseudo_dir/C.ccECP.xml H: /path/to/pseudo_dir/H.ccECP.xml >>> PseudoSet.get_pseudos( ... pseudos=psps, ... system=["C", "H"], ... code="qmcpack", ... ) {'C.ccECP.xml': '/path/to/pseudo_dir/C.ccECP.xml', 'H.ccECP.xml': '/path/to/pseudo_dir/H.ccECP.xml'} >>> PseudoSet.get_pseudos( ... pseudos=psps, ... system=["C", "H"], ... code="espresso", ... ) {'C.ccECP.upf': '/path/to/pseudo_dir/C.ccECP.upf', 'H.ccECP.upf': '/path/to/pseudo_dir/H.ccECP.upf'}
- get_Zeff(elem_labels: Collection[Elements | str] | PhysicalSystem, *, missing_as_ae: bool = False) dict[str, int][source]#
Get the Z-valences for each element in the list of elements.
- Parameters:
- elem_labels
listofElementsorlistofstrorPhysicalSystem The elements or system to get Z-valences for.
- missing_as_aebool, default=False (keyword-only)
Assume any elements for which a pseudopotential can not be found are all-electron, and use their atomic number as the value for the Z-valence. If this is not supplied, and if the Z-valence for an element is not in
self.Zeff, this will attempt to extract the Z-valence from the pseudopotential file.
- elem_labels
- Returns:
See also
read_upf_z_valenceUsed to extract Z-valences from UPF files.
read_qmcpack_xml_z_valenceUsed to extract Z-valences from XML files.
read_potcar_z_valenceUsed to extract Z-valences from POTCAR files.
- nexus.pseudoset.generate_pseudoset(pseudo_dir: PathLike | None = None, *, code: str | Collection[str] | None = None, extension: Mapping[str, str | Collection[str]] | None = None, include: Mapping[str, str] | str | None = None, exclude: Mapping[str, str] | str | None = None, Zeff_map: Mapping[str, Mapping[str, int]] | Mapping[str, int] | None = None, **codes_psps: Collection[PathLike] | PathLike) dict[str, PseudoSet][source]#
Generate a dictionary of
PseudoSet.The ideal use of this function is to create a single collection of
PseudoSet’s that represent a single kind or type of pseudopotential. See the Notes and Examples for more information.- Parameters:
- pseudo_dir
PathLike The directory from which to read pseudopotentials. Does not support nested directories, except for those that contain a POTCAR file. If you do not provide this or
codes_pspsit will try to use thepseudo_dirsupplied insettings.- code
oneormoreof{“espresso”, “gamess”, “vasp”, “qmcpack”, “rmg”, “pyscf”}, optional The code(s) to use to separate the files in the directory into their respective groups. Incompatible with
codes_psps.- extension
Mapofcodestoastr/setofstr, optional A dictionary mapping codes to the file extension(s) corresponding to those labels. If this is not provided, then the filters are automatically populated by the codes in
code.- include
Mapofcodestostrorsinglestr, optional A dictionary mapping codes to a Unix shell-style wildcard. All files matched by this are included in the final
PseudoSet. By default this matches all files.- exclude
Mapofcodestostrorsinglestr, optional A dictionary mapping codes to a Unix shell-style wildcard. All files matched by this are excluded in the final
PseudoSet. By default this matches all files.- Zeff_map
MapofcodestoMapofstr/ElementstointorMapofstr/Elementstoint, optional A mapping for each code that maps elements to their effective nuclear charges (Z-valences), or a single mapping that will be applied to all codes. If this is supplied, it will override any parts of the code that may try to parse the pseudopotential to get the Z-valence.
- **codes_psps
A mapping of code names to either a collection of pseudopotential file names/paths or a path to a directory with pseudopotential files in it.
- pseudo_dir
Notes
This function is designed around the idea that the returned dict represents a single type of pseudos, e.g. ccECPs, USPPs, NCPPs, PAWs, with the same kind of pseudopotential for each code. That means that, for the same element, all of the Z-valences in the pseudos should match, all of the radial grids are the same, all pseudos are made with the same functional, and so on. Then, the object returned can be passed freely to any function that may accept it, e.g. as the
pseudoskeyword ingenerate_pwscforgenerate_qmcpack.If you are only working with one code, or prefer a class-based interface, you may want to use
PseudoSetdirectly, along with its methodsPseudoSet.from_dirand/orPseudoSet.from_mixed_dir.Examples
Basic usage, all files in one directory.
>>> print(contents_of_pseudo_dir) pseudo_dir ├── C.ccECP.gamess ├── C.ccECP.nwchem ├── C.ccECP.upf ├── C.ccECP.xml ├── H.ccECP.gamess ├── H.ccECP.nwchem ├── H.ccECP.upf └── H.ccECP.xml >>> psps = generate_pseudoset( ... pseudo_dir=pseudo_dir, ... code={"qmcpack", "espresso", "rmg", "pyscf", "gamess"}, ... extension={"rmg": ".xml"}, ... ) >>> for code, ps_set in psps.items(): ... print(f"{code} pseudos:") ... for lbl, psp in ps_set.pseudos.items(): ... print(f" {lbl}: {psp}") espresso pseudos: C: /path/to/pseudo_dir/C.ccECP.upf H: /path/to/pseudo_dir/H.ccECP.upf pyscf pseudos: H: /path/to/pseudo_dir/H.ccECP.nwchem C: /path/to/pseudo_dir/C.ccECP.nwchem rmg pseudos: H: /path/to/pseudo_dir/H.ccECP.xml C: /path/to/pseudo_dir/C.ccECP.xml qmcpack pseudos: H: /path/to/pseudo_dir/H.ccECP.xml C: /path/to/pseudo_dir/C.ccECP.xml gamess pseudos: C: /path/to/pseudo_dir/C.ccECP.gamess H: /path/to/pseudo_dir/H.ccECP.gamess