pymatgen.analysis.diffusion.aimd.pathway module

Algorithms for diffusion pathway analysis.

class ProbabilityDensityAnalysis(structure, trajectories, interval=0.5, species=('Li', 'Na'))[source]

Bases: object

Probability density analysis class.

Compute the time-averaged probability density distribution of selected species on a “uniform” (in terms of fractional coordinates) 3-D grid. Note that int_{Omega}d^3rP(r) = 1

If you use this class, please consider citing the following paper:

Zhu, Z.; Chu, I.-H.; Deng, Z. and Ong, S. P. “Role of Na+ Interstitials and Dopants in Enhancing the Na+ Conductivity of the Cubic Na3PS4 Superionic Conductor”. Chem. Mater. (2015), 27, pp 8318-8325.

Initialization.

Parameters:
  • structure (Structure) – crystal structure

  • trajectories (numpy array) – ionic trajectories of the structure from MD simulations. It should be (1) stored as 3-D array [ Ntimesteps, Nions, 3] where 3 refers to a,b,c components; (2) in fractional coordinates.

  • interval (float) – the interval between two nearest grid points (in Angstrom)

  • species (list of str) – list of species that are of interest

classmethod from_diffusion_analyzer(diffusion_analyzer, interval=0.5, species=('Li', 'Na'))[source]

Create a ProbabilityDensityAnalysis from a diffusion_analyzer object.

Parameters:
  • diffusion_analyzer (DiffusionAnalyzer) – A pymatgen.analysis.diffusion_analyzer.DiffusionAnalyzer object

  • interval (float) – the interval between two nearest grid points (in Angstrom)

  • species (list of str) – list of species that are of interest

generate_stable_sites(p_ratio=0.25, d_cutoff=1.0)[source]

Obtain a set of low-energy sites from probability density function with given probability threshold ‘p_ratio’. The set of grid points with probability density higher than the threshold will further be clustered using hierarchical clustering method, with no two clusters closer than the given distance cutoff. Note that the low-energy sites may converge more slowly in fast conductors (more shallow energy landscape) than in the slow conductors.

Parameters:
  • p_ratio (float) – Probability threshold above which a grid point is considered as a low-energy site.

  • d_cutoff (float) – Distance cutoff used in hierarchical clustering.

Notes

The set of stable sites is stored in the stable_sites attribute as a Nx3 numpy array.

get_full_structure()[source]

Generate the structure with the low-energy sites included. In the end, a pymatgen Structure object will be returned.

to_chgcar(filename='CHGCAR.vasp')[source]

Save the probability density distribution in the format of CHGCAR, which can be visualized by VESTA.

class SiteOccupancyAnalyzer(structure, coords_ref, trajectories, species=('Li', 'Na'))[source]

Bases: object

A class that analyzes the site occupancy of given species using MD trajectories. The occupancy of a site is determined based on the shortest distance scheme.

site_occ
N x 1 numpy array that stores the occupancy of all sites associated with
species. It has the same sequence as the given list of indices.
coords_ref
N x 3 numpy array of fractional coordinates of all reference sites.
nsites
Number of reference sites.
structure
Initial structure.
Parameters:
  • structure (pmg_structure) – Initial structure.

  • coords_ref (N_s x 3 array) – Fractional coordinates of N_s given sites at which the site occupancy will be computed.

  • trajectories (Ntimesteps x Nions x 3 array) – Ionic trajectories from MD simulation, where Ntimesteps is the number of time steps in MD simulation. Note that the coordinates are fractional.

  • species (list of str) – list of species that are of interest.

classmethod from_diffusion_analyzer(coords_ref, diffusion_analyzer, species=('Li', 'Na'))[source]

Create a SiteOccupancyAnalyzer object using a diffusion_analyzer object.

Parameters:
  • coords_ref (nested list of floats) – Fractional coordinates of a list of reference sites at which the site occupancy will be computed.

  • diffusion_analyzer (DiffusionAnalyzer) – A pymatgen.analysis.diffusion_analyzer.DiffusionAnalyzer object

  • species (list of str) – list of species that are of interest.

get_average_site_occupancy(indices)[source]

Get the average site occupancy over a subset of reference sites.