ptmdisp

PTM Displacement

Identifies atoms in a structure file that do not match a specified crystal structure (e.g., FCC) using Polyhedral Template Matching (PTM). It outputs the 0-based indices of these defect atoms (e.g., interstitials), which is useful for filtering or setting up atom lists for the displacements used for eOn calculations.

rgpycrumbs eon ptmdisp

Analyzes FILENAME to find all atoms that are NOT the specified crystal structure type and prints their 0-based indices as a comma-separated list, suitable for use in other programs.

The vacancy filter drops atoms whose centrosymmetry, divided by the squared FCC lattice constant a**2, lies from –csp-vacancy-min to –csp-vacancy-max. A vacancy neighbor has 0.5.

Usage

rgpycrumbs eon ptmdisp [OPTIONS] FILENAME

Options

-s, --structure-type <structure>

The crystal structure to identify and exclude.

Default:

<CrystalStructure.FCC: 'FCC'>

Options:

Other | FCC | HCP | BCC | Icosahedral

-v, --verbose

Enable verbose informational output to stderr.

--no-fcc-vacancy

Disable FCC vacancy processing.

--csp-vacancy-min <csp_vacancy_min>

Lowest centrosymmetry of a vacancy neighbor, in units of a**2.

Default:

0.375

--csp-vacancy-max <csp_vacancy_max>

Highest centrosymmetry of a vacancy neighbor, in units of a**2.

Default:

0.625

--selection-image <selection_image>

Render the atoms around the defect to this PNG file.

Arguments

FILENAME

Required argument

Vacancy filter

Unless --no-fcc-vacancy is given, the command drops the neighbors of a vacancy from the defect atoms. The selection then centers on the interstitial. The filter uses the centrosymmetry parameter of Kelchner, Plimpton and Hamilton (Physical Review B 58, 11085, 1998). It sums |R_i + R_(i+6)|**2 over the six pairs of opposite nearest neighbors, so it is 0 in the perfect lattice. Next to a vacancy one atom of a pair is missing. The other sits at a/sqrt(2) for the lattice constant a, so a vacancy neighbor has a**2/2. The command divides the parameter by a**2. It takes a from the median nearest-neighbor distance of the face-centered cubic (FCC) atoms. It drops the mismatched atoms whose value lies from --csp-vacancy-min to --csp-vacancy-max. The defaults, 3/8 and 5/8, reach a**2/8 to either side of a**2/2. That is half the gap to the a**2/4 of the atoms next to an unrelaxed octahedral interstitial. Without FCC atoms the filter drops nothing.

The atoms of a stacking fault also have a**2/2, and so do the atoms around a relaxed octahedral interstitial. The filter drops them as well, so pass --no-fcc-vacancy for such structures. In copper relaxed with effective medium theory, the neighbors of a <100> dumbbell stay below 0.35. The two dumbbell atoms stay above 1.

Periodic boundaries

The structure analysis and the selection sphere take the periodic directions that the structure file declares. A slab in an extended .xyz file with pbc="T T F" stays free along z. A .con file keeps the flags of its metadata line. When that line names none, all three directions are periodic. The eon reader of the Atomic Simulation Environment (ASE) drops the flags of compressed .con files. The command takes those files as periodic along all three directions.

Usage

$ python -m rgpycrumbs.cli eon ptmdisp --help
--> uv is not on PATH, so the script runs in the active interpreter, which lacks its dependencies; install uv (or the packages the script's header lists)
--> Dispatching to: /home/runner/work/rgpycrumbs/rgpycrumbs/.pixi/envs/docs/bin/python /home/runner/work/rgpycrumbs/rgpycrumbs/rgpycrumbs/eon/ptmdisp.py --help
Usage: ptmdisp.py [OPTIONS] FILENAME

  Analyzes FILENAME to find all atoms that are NOT the specified crystal
  structure type and prints their 0-based indices as a comma-separated list,
  suitable for use in other programs.

  The vacancy filter drops atoms whose centrosymmetry, divided by the squared
  FCC lattice constant a**2, lies from --csp-vacancy-min to --csp-vacancy-max.
  A vacancy neighbor has 0.5.

Options:
  -s, --structure-type [OTHER|FCC|HCP|BCC|ICO]
                                  The crystal structure to identify and
                                  exclude.  [default: FCC]
  -v, --verbose                   Enable verbose informational output to
                                  stderr.
  --no-fcc-vacancy                Disable FCC vacancy processing.
  --csp-vacancy-min FLOAT         Lowest centrosymmetry of a vacancy neighbor,
                                  in units of a**2.  [default: 0.375]
  --csp-vacancy-max FLOAT         Highest centrosymmetry of a vacancy
                                  neighbor, in units of a**2.  [default:
                                  0.625]
  --selection-image FILE          Render the atoms around the defect to this
                                  PNG file.
  -h, --help                      Show this message and exit.

API Reference

For developer details and source code see rgpycrumbs.eon.ptmdisp.