pymatgen.command_line.critic2_caller module

class Critic2Caller(structure, chgcar=None, chgcar_ref=None, user_input_settings=None, write_cml=False)[source]

Bases: object

Run Critic2 in automatic mode on a supplied structure, charge density (chgcar) and reference charge density (chgcar_ref).

The reason for a separate reference field is that in VASP, the CHGCAR charge density only contains valence electrons and may be missing substantial charge at nuclei leading to misleading results. Thus, a reference field is commonly constructed from the sum of AECCAR0 and AECCAR2 which is the total charge density, but then the valence charge density is used for the final analysis.

If chgcar_ref is not supplied, chgcar will be used as the reference field. If chgcar is not supplied, the promolecular charge density will be used as the reference field – this can often still give useful results if only topological information is wanted.

User settings is a dictionary that can contain: * GRADEPS, float (field units), gradient norm threshold * CPEPS, float (Bohr units in crystals), minimum distance between

critical points for them to be equivalent
  • NUCEPS, same as CPEPS but specifically for nucleus critical points (critic2 default is depedent on grid dimensions)
  • NUCEPSH, same as NUCEPS but specifically for hydrogen nuclei since associated charge density can be significantly displaced from hydrogen nucleus
  • EPSDEGEN, float (field units), discard critical point if any element of the diagonal of the Hessian is below this value, useful for discarding points in vacuum regions
  • DISCARD, float (field units), discard critical points with field value below this value, useful for discarding points in vacuum regions
  • SEED, list of strings, strategies for seeding points, default is [‘WS 1’, ‘PAIR 10’] which seeds critical points by sub-dividing the Wigner-Seitz cell and between every atom pair closer than 10 Bohr, see critic2 manual for more options
Parameters:
  • structure – Structure to analyze
  • chgcar – Charge density to use for analysis. If None, will

use promolecular density. :param chgcar_ref: Reference charge density. If None, will use chgcar as reference. :param user_input_settings (dict): :param write_cml (bool): Useful for debug, if True will write all critical points to a file ‘table.cml’ in the working directory useful for visualization

classmethod from_path(path, suffix='')[source]

Convenience method to run critic2 analysis on a folder containing typical VASP output files. This method will: 1. Look for files CHGCAR, AECAR0, AECAR2, POTCAR or their gzipped counterparts. 2. If AECCAR* files are present, constructs a temporary reference file as AECCAR0 + AECCAR2 3. Runs critic2 analysis twice: once for charge, and a second time for the charge difference (magnetization density). :param path: path to folder to search in :param suffix: specific suffix to look for (e.g. ‘.relax1’ for ‘CHGCAR.relax1.gz’) :return:

class Critic2Output(structure, critic2_stdout)[source]

Bases: monty.json.MSONable

This class is used to store results from the Critic2Caller.

To explore the bond graph, use the “structure_graph” method, which returns a user-friendly StructureGraph class with bonding information. By default, this returns a StructureGraph with edge weights as bond lengths, but can optionally return a graph with edge weights as any property supported by the CriticalPoint class, such as bond ellipticity.

This class also provides an interface to explore just the non-symmetrically-equivalent critical points via the critical_points attribute, and also all critical points (via nodes dict) and connections between them (via edges dict). The user should be familiar with critic2 before trying to understand these.

Indexes of nucleus critical points in the nodes dict are the same as the corresponding sites in structure, with indices of other critical points arbitrarily assigned.

Parameters:
  • structure – associated Structure
  • critic2_stdout – stdout from running critic2 in automatic

mode

get_critical_point_for_site(n)[source]
structure_graph(edge_weight='bond_length', edge_weight_units='Å')[source]

A StructureGraph object describing bonding information in the crystal. Lazily constructed.

Parameters:edge_weight – a value to store on the Graph edges,

by default this is “bond_length” but other supported values are any of the attributes of CriticalPoint :return:

class CriticalPoint(index, type, frac_coords, point_group, multiplicity, field, field_gradient, coords=None, field_hessian=None)[source]

Bases: monty.json.MSONable

Class to characterise a critical point from a topological analysis of electron charge density.

Note this class is usually associated with a Structure, so has information on multiplicity/point group symmetry.

Parameters:
  • index – index of point
  • type – type of point, given as a string
  • coords – Cartesian co-ordinates in Angstroms
  • frac_coords – fractional co-ordinates
  • point_group – point group associated with critical point
  • multiplicity – number of equivalent critical points
  • field – value of field at point (f)
  • field_gradient – gradient of field at point (grad f)
  • field_hessian – hessian of field at point (del^2 f)
ellipticity

Most meaningful for bond critical points, can be physically interpreted as e.g. degree of pi-bonding in organic molecules. Consult literature for more information. :return:

laplacian
type
class CriticalPointType[source]

Bases: enum.Enum

An enumeration.

bond = 'bond'
cage = 'cage'
nucleus = 'nucleus'
ring = 'ring'
logger = <Logger pymatgen.command_line.critic2_caller (INFO)>

This module implements an interface to the critic2 Bader analysis code.

For most Bader analysis purposes, users are referred to pymatgen.command_line.bader_caller instead, this module is for advanced usage requiring identification of critical points in the charge density.

This module depends on a compiled critic2 executable available in the path. Please follow the instructions at https://github.com/aoterodelaroza/critic2 to compile or, if using macOS and homebrew, use brew tap homebrew/science followed by brew install critic2.

New users are strongly recommended to read the critic2 manual first.

In brief, * critic2 searches for critical points in charge density * a critical point can be one of four types: nucleus, bond, ring or cage * it does this by seeding locations for likely critical points and then searching in these regions * there are two lists of critical points in the output, a list of non-equivalent points (with in-depth information about the field at those points), and a full list of points generated by the appropriate symmetry operations * connectivity between these points is also provided when appropriate (e.g. the two nucleus critical points linked to

a bond critical point)
  • critic2 can do many other things besides

If you use this module, please cite the following:

A. Otero-de-la-Roza, E. R. Johnson and V. Luaña, Comput. Phys. Commun. 185, 1007-1018 (2014) (http://dx.doi.org/10.1016/j.cpc.2013.10.026)

A. Otero-de-la-Roza, M. A. Blanco, A. Martín Pendás and V. Luaña, Comput. Phys. Commun. 180, 157–166 (2009) (http://dx.doi.org/10.1016/j.cpc.2008.07.018)