pymatgen.io.abinit.pseudos module
This module provides objects describing the basic parameters of the pseudopotentials used in Abinit, and a parser to instantiate pseudopotential objects..
- class Pseudo[source]
Bases:
MSONable
Abstract base class defining the methods that must be implemented by the concrete pseudo-potential sub-classes.
- classmethod as_pseudo(obj)[source]
Convert obj into a pseudo. Accepts:
Pseudo object.
string defining a valid path.
- as_tmpfile(tmpdir=None)[source]
Copy the pseudopotential to a temporary a file and returns a new pseudopotential object. Useful for unit tests in which we have to change the content of the file.
- Parameters:
tmpdir – If None, a new temporary directory is created and files are copied here else tmpdir is used.
- static from_file(filename)[source]
Build an instance of a concrete Pseudo subclass from filename. Note: the parser knows the concrete class that should be instantiated Client code should rely on the abstract interface provided by Pseudo.
- hint_for_accuracy(accuracy='normal')[source]
Returns a
Hint
object with the suggested value of ecut [Ha] and pawecutdg [Ha] for the given accuracy. ecut and pawecutdg are set to zero if no hint is available.- Parameters:
accuracy – [“low”, “normal”, “high”]
- open_pspsfile(ecut=20, pawecutdg=None)[source]
Calls Abinit to compute the internal tables for the application of the pseudopotential part. Returns
PspsFile
object providing methods to plot and analyze the data or None if file is not found or it’s not readable.- Parameters:
ecut – Cutoff energy in Hartree.
pawecutdg – Cutoff energy for the PAW double grid.
- class PseudoTable(pseudos)[source]
Bases:
Sequence
,MSONable
Define the pseudopotentials from the element table. Individidual elements are accessed by name, symbol or atomic number.
For example, the following all retrieve iron:
print elements[26] Fe print elements.Fe Fe print elements.symbol(‘Fe’) Fe print elements.name(‘iron’) Fe print elements.isotope(‘Fe’) Fe
- Parameters:
pseudos – List of pseudopotentials or filepaths
- all_combinations_for_elements(element_symbols)[source]
Return a list with all the possible combination of pseudos for the given list of element_symbols. Each item is a list of pseudopotential objects.
Example:
table.all_combinations_for_elements(["Li", "F"])
- classmethod as_table(items)[source]
Return an instance of
PseudoTable
from the iterable items.
- classmethod from_dir(top, exts=None, exclude_dirs='_*')[source]
Find all pseudos in the directory tree starting from top.
- Parameters:
top – Top of the directory tree
exts – List of files extensions. if exts == “all_files” we try to open all files in top
exclude_dirs – Wildcard used to exclude directories.
return:
PseudoTable
sorted by atomic number Z.
- get_pseudos_for_structure(structure)[source]
Return the list of
Pseudo
objects to be used for thisStructure
.- Parameters:
structure – pymatgen
Structure
.- Raises:
ValueError –
multiple occurrences are present in the table. –
- is_complete(zmax=118) bool [source]
True if table is complete i.e. all elements with Z < zmax have at least on pseudopotential
- print_table(stream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, filter_function=None)[source]
A pretty ASCII printer for the periodic table, based on some filter_function.
- Parameters:
stream – file-like object
filter_function – A filtering function that take a Pseudo as input and returns a boolean. For example, setting filter_function = lambda p: p.Z_val > 2 will print a periodic table containing only pseudos with Z_val > 2.
- pseudo_with_symbol(symbol, allow_multi=False)[source]
Return the pseudo with the given chemical symbol.
- Parameters:
symbols – String with the chemical symbol of the element
allow_multi – By default, the method raises ValueError if multiple occurrences are found. Use allow_multi to prevent this.
- Raises:
ValueError if symbol is not found or multiple occurrences are present and not allow_multi –
- pseudos_with_symbols(symbols)[source]
Return the pseudos with the given chemical symbols.
- Raises:
ValueError if one of the symbols is not found or multiple occurrences are present. –
- select(condition) PseudoTable [source]
Select only those pseudopotentials for which condition is True.
- Parameters:
condition – Function that accepts a
Pseudo
object and returns True or False.- Returns:
New PseudoTable instance with pseudos for which condition is True.
- Return type:
- select_family(family)[source]
Return PseudoTable with element belonging to the specified family, e.g. family=”alkaline”
- select_rows(rows)[source]
Return new class:PseudoTable object with pseudos in the given rows of the periodic table. rows can be either a int or a list of integers.
- select_symbols(symbols, ret_list=False)[source]
Return a
PseudoTable
with the pseudopotentials with the given list of chemical symbols.- Parameters:
symbols – str or list of symbols Prepend the symbol string with “-”, to exclude pseudos.
ret_list – if True a list of pseudos is returned instead of a
PseudoTable
- sort_by_z()[source]
Return a new
PseudoTable
with pseudos sorted by Z
- sorted(attrname, reverse=False)[source]
Sort the table according to the value of attribute attrname.
- Returns:
PseudoTable object
- Return type:
New class