# 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

  Bases: `monty.json.MSONable`

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

  abstract property Z

    The atomic number of the atom.

  abstract property Z_val

    Valence charge.

  as_dict(**kwargs)

    Return dictionary for MSONable protocol.

  classmethod as_pseudo(obj)

    Convert obj into a pseudo. Accepts:

    > - Pseudo object.

    > - string defining a valid path.

  as_tmpfile(tmpdir=None)

    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.

  property basename

    File basename.

  compute_md5()

    Compute and erturn MD5 hash value.

  property djrepo_path

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

  property element

    Pymatgen `Element`.

  property filepath

    Absolute path to pseudopotential file.

  classmethod from_dict(d)

    Build instance from dictionary (MSONable protocol).

  static from_file(filename)

    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.

  property has_dojo_report

    True if the pseudo has an associated DOJO_REPORT section.

  property has_hints

    True if self provides hints on the cutoff energy.

  hint_for_accuracy(accuracy='normal')

    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”]

  property isnc

    True if norm-conserving pseudopotential.

  property ispaw

    True if PAW pseudopotential.

  abstract property l_local

    Angular momentum used for the local part.

  abstract property l_max

    Maximum angular momentum.

  md5()

    MD5 hash value.

  open_pspsfile(ecut=20, pawecutdg=None)

    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.

  abstract property summary

    String summarizing the most important properties.

  abstract property 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.

  property symbol

    Element symbol.

  to_string(verbose=0)

    String representation.

  property type

    Type of pseudo.

class PseudoTable(pseudos)

  Bases: `collections.abc.Sequence`, `monty.json.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)

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

  property allnc

    True if all pseudos are norm-conserving.

  property allpaw

    True if all pseudos are PAW.

  as_dict(**kwargs)

    Return dictionary for MSONable protocol.

  classmethod as_table(items)

    Return an instance of `PseudoTable` from the iterable items.

  classmethod from_dict(d)

    Build instance from dictionary (MSONable protocol).

  classmethod from_dir(top, exts=None, exclude_dirs='_*')

    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)

    Return the list of `Pseudo` objects to be used for this `Structure`.

    Parameters

      structure – pymatgen `Structure`.

    Raises

      - ValueError –

      - multiple occurences are present in the table. –

  is_complete(zmax=118)

    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)

    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)

    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)

    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)

    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)

    Return PseudoTable with element beloging to the specified family, e.g. familiy=”alkaline”

  select_rows(rows)

    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)

    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()

    Return a new `PseudoTable` with pseudos sorted by Z

  sorted(attrname, reverse=False)

    Sort the table according to the value of attribute attrname.

    Returns

      PseudoTable object

    Return type

      New class

  to_table(filter_function=None)

    Return string with data in tabular form.

  with_dojo_report()

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

  property zlist

    Ordered list with the atomic numbers available in the table.