Local crystalline order

Asap contains three methods for analysing the local crystalline order of a simulation: Coordination Numbers, Polyhedral Template Matching and Common Neighbor Analysis.

Unless otherwise noted, these methods work in both serial and parallel simulations. All objects on this page are imported like this:

from asap3.analysis import XXX

WARNING: In parallel simulations, these analysis functions can in some cases trigger a migration, so atoms move between CPUs.

Coordination Numbers

The coordination number of an atom is the number of nearest neighbor atoms. In a realistic system, is not necessarily well defined if two atoms are nearest neighbors, so the coordination number is defined as the number of neighbors within a cutoff distance. Radial Distribution Functions can be used to choose a good value for this cutoff (the position of the minimum between the first and second peak in the RDF is a good choice).

Asap provides a function for calculating the coordination numbers.

CoordinationNumbers(atoms, rCut=None):

Returns the coordination numbers of the atoms. The cutoff can be given, otherwise it tries to guess a value between the first and second coordination shell, based on the atomic numbers. For full documentation of the function, see CoordinationNumbers().

Note that for pure elements, not providing a cutoff distance (rCut) typically works well since the function will get a reasonable value based on the crystalline lattice constant of the material.

Polyhedral Template Matching (PTM)

PTM is a new alternative to the popular Common Neigbor Analysis, providing much of the same advantages, but with a greater robustness against thermal vibrations, and does not depend critically on a cutoff.

The PTM classifies the local crystalline order, and identifies local simple cubic (SC), face-centered cubic (FCC), body-centered cubic (FCC), hexagonal closed-packed (HCP) and icosahedral (ICO) order. In addition, some ordered alloys based on the FCC and BCC structures are also detected, namely L1_0, L1_2 and B2 structures.

The PTM also return the local rotation of the lattice (if a crystalline order is found) and optionally the elastic strain tensor.

The method is described by P.M. Larsen, S. Schmidt, and J. Schiøtz, Modelling Simul. Mater. Sci. Eng. 24, 055007 (2016). It is also available as a preprint here.

The PTM version in Asap is dated, a more modern version is available in the project mdapy (the Asap authors are not associated with that project).

PTM(atoms, cutoff=10.0, rmsd_max=None, target_structures=None, calculate_strains=False, quick=False, return_nblist=False):

Run Complex Hull Analysis on an Atoms object.

For a full documentation of the function, see PTM()

Example

Assuming that atoms is an atoms object, you can visualize the different local crystal structures like this:

from asap3.analysis import PTM
from ase.visualize import view

ptmdata = PTM(atoms, rmsd_max=0.2)
atoms.set_tags(ptmdata['structure']
view(atoms)

Note that the rmsd_max argument is not necessary, but it prevents that some surface atoms are misclassified as highly distorted simple cubic structures. A value of 0.2 is high enough to only exclude spurious classifications.

PTM Observer

A wrapper object which does PTM analysis can be attached to the dynamics, in order to automatically do PTM analysis during a simulation. For an example, see Running Polyhedral Template Matching under the Examples tab on these pages.

PTMobserver(atoms, cutoff=10.0, rmsd_max=None, target_structures=None, calculate_strains=False, quantity='structure', analyze_first=True):

Per default, sets the tags of the atoms according to their local crystal structure. 0 = none; 1 = FCC; 2 = HCP; 3 = BCC; 4 = Icosahedral; 5 = SC.

An optional argument \(quantity\) can be set to ‘alloytype’ or None, then the tags are set to the alloytype calculated by the PTM function (see that function’s documentation); or not set if None is given.

This class is intended to use as an observer, so its analyze() function is called automatically by e.g. the dynamics. It can itself act as a subject, so a Plotter or a Trajectory can be called just after the calculations.

It has a method get_data which returns the full dictionary of PTM data from the last calculation.

For full documentation, see PTMobserver.

PTMdislocations

PTMdislocations is an analysis module build on top of PTM. It identifies stacking faults and dislocation lines in systems with an FCC crystal structure. It is used exactly like PTM Observer above, but identifies the following structures:

0 = none; 1 = FCC; 2 = HCP; 3 = BCC; 4 = Icosahedral; 5 = SC; 6 = Twin boundary; 7 = Stacking Fault; 8 = Dislocation line.

It works by looking at the neighbors to atoms identified as HCP.

  • If an HCP atom has 6 HCP neighbors centered around the atom then it is assumed that it is part of a single (111) layer of HCP atoms, i.e. a twin boundary.

  • If an HCP atom has 9 HCP neighbors then it is assumed that it is part of a double (111) layer of HCP atoms, i.e. an intrinsic stacking fault.

  • If an HCP atom has between 5 and 8 neighbors, and they are not evenly distributed around it, then it is likely to the edge of a stacking fault, i.e. the core of a partial dislocation.

See also PTMdislocations.

Common Neighbor Analysis (CNA)

Common Neighbor Analysis (CNA) is a way to get information about the local crystalline order of a system. It can for example be used to find stacking faults and dislocations in a simulation of a metal. CNA works by examining all bonds (nearest-neighbor pairs of atoms), each such bond is classified according to how the common neighbors of the two atoms are located, and finally all bonds related to an atom is used to classify the crystal structure of the atom. Asap provides two impementations of CNA:

  • Restricted CNA (RestrictedCNA) which classifies atoms in one of three groups, FCC, HCP and Other according to the local crystal structure but skips doing a full CNA analysis

  • Full CNA (FullCNA), which does a full CNA analysis, and can return the data in several ways.