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: monty.json.MSONable, object

Abstract base class defining the methods that must be implemented by the concrete pseudopotential sub-classes.

Z

The atomic number of the atom.

Z_val

Valence charge.

as_dict(**kwargs)[source]
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.
basename

File basename.

compute_md5()[source]

Compute and erturn MD5 hash value.

djrepo_path

The path of the djrepo file. None if file does not exist.

element

Pymatgen Element.

filepath
classmethod from_dict(d)[source]
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.

has_dojo_report

True if the pseudo has an associated DOJO_REPORT section.

has_hints

True if self provides hints on the cutoff energy.

hint_for_accuracy(accuracy='normal')[source]

Returns a Hint object with the suggensted 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”]
isnc

True if norm-conserving pseudopotential.

ispaw

True if PAW pseudopotential.

l_local

Angular momentum used for the local part.

l_max

Maximum angular momentum.

md5[source]

MD5 hash value.

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.
summary

String summarizing the most important properties.

supports_soc

True if the pseudo can be used in a calculation with spin-orbit coupling. Base classes should provide a concrete implementation that computes this value.

symbol

Element symbol.

to_string(verbose=0)[source]

String representation.

type
class PseudoTable(pseudos)[source]

Bases: collections.abc.Sequence, monty.json.MSONable, object

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 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"])
allnc

True if all pseudos are norm-conserving.

allpaw

True if all pseudos are PAW.

as_dict(**kwargs)[source]
classmethod as_table(items)[source]

Return an instance of PseudoTable from the iterable items.

classmethod from_dict(d)[source]
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 this Structure.

Parameters:

structure – pymatgen Structure.

Raises:
  • ValueError if one of the chemical symbols is not found or
  • multiple occurences are present in the table.
is_complete(zmax=118)[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 occurences 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 occurences are present.
select(condition)[source]

Select only those pseudopotentials for which condition is True. Return new class:PseudoTable object.

Parameters:condition – Function that accepts a Pseudo object and returns True or False.
select_family(family)[source]
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
to_table(filter_function=None)[source]

Return string with data in tabular form.

with_dojo_report()[source]

Select pseudos containing the DOJO_REPORT section. Return new class:PseudoTable object.

zlist

Ordered list with the atomic numbers available in the table.