LocalStructure

class LocalStructure(configuration, cutoff_radius_structure=None, cutoff_radius_coordination=None, centrosymmetry_neighbors=None)

Class for calculating the local structure parameters.

Parameters:
  • configuration (BulkConfiguration) – The configuration for which the structure analysis should be calculated.

  • cutoff_radius_structure (PhysicalQuantity of type length) – The cutoff radius used for the local structure analysis.
    Default: 8.0 Angstrom

  • cutoff_radius_coordination (PhysicalQuantity of type length) – The cutoff radius used to calculate the coordination number. Cannot be larger than cutoff_radius.
    Default: 4.0 Angstrom

  • centrosymmetry_neighbors (even int) – The number of neighbors for each atom to be included in the centro-symmetry calculation (e.g. 12 for face centered cubic, 8 for body centered cubic). Must be between 8 and 20.
    Default: 12 (face centered cubic).

centrosymmetryParameters(atom_index=None)

Return the list of centrosymmetry parameters for all atoms or a selected atom.

Parameters:

atom_index (int) – Index of the atom to return the centrosymmetry parameters for.
Default: Centrosymmetry parameters of all atoms.

Returns:

Either an array of all centrosymmetry parameters if atom_index is None, or the parameter for the specified atom.

Return type:

numpy.array | float

coordinationNumbers(atom_index=None)

Return the list of coordination numbers for all atoms or a selected atom.

Parameters:

atom_index (int) – Index of the atom to return the coordination number for.
Default: Coordination numbers of all atoms.

Returns:

Either an array of all coordination numbers if atom_index is None, or the coordination number for the specified atom.

Return type:

numpy.array | float

evaluate(atom_index=None)
Return the list of local structure indices for all atoms or a selected atom.
  • 0: Undefined

  • 1: FCC

  • 2: BCC

  • 3: HCP

  • 4: Icosahedral

  • 5: Diamond-like

Parameters:

atom_index (int) – Index of the atom to return the local crystal structure for.
Default: Local structure of all atoms.

Returns:

Either all local structure indices as an array if atom_index is None, or the structure index for the specified atom

Return type:

numpy.array | float

metatext()
Returns:

The metatext of the object or None if no metatext is present.

Return type:

str | None

nlprint(stream=None)

Print a string containing an ASCII table useful for plotting the AnalysisSpin object.

Parameters:

stream (python stream) – The stream the table should be written to.
Default: NLPrintLogger()

setMetatext(metatext)

Set a given metatext string on the object.

Parameters:

metatext (str | None) – The metatext string that should be set. A value of “None” can be given to remove the current metatext.

uniqueString()

Return a unique string representing the state of the object.

Usage Examples

Analyze the LocalStructure of fcc copper:

# -------------------------------------------------------------
# Local structure
# -------------------------------------------------------------
local_structure = LocalStructure(bulk_configuration,
                                 cutoff_radius_structure=8.0*Angstrom,
                                 cutoff_radius_coordination=3.5*Angstrom,
                                 centrosymmetry_neighbors=12)

nlsave('ls_copper.nc', local_structure)
nlprint(local_structure)

# Extract the local structure index of the first atom
ls_atom1 = local_structure.evaluate(atom_index=0)

# Extract the centrosymmetry parameter of the first atom
cs_atom1 = local_structure.centrosymmetryParameters(atom_index=0)

# Extract the coordination number of the first atom
cn_atom1 = local_structure.coordinationNumbers(atom_index=0)

local_structure.py

Notes

  • The LocalStructure object assigns a crystal structure type to each atom based on its local environment, as described in [1]. The range of the local atomic environment is specified by the cutoff_radius_structure argument. The assigned crystal structures, however, are not particularly sensitive to the exact choice of this value, and the default setting commonly yields correct results. The results can be visualized by the corresponding plugin of the 3D Viewer.

  • Furthermore, the LocalStructure object calculates the centrosymmetry parameter, as well as the coordination number for each atom.

  • The centrosymmetry parameter quantifies the symmetry of the local environment around each atomic site, as described in [2]. When the atom represents a perfect center of symmetry, a zero value is returned, while deviations from a centrosymmetric arrangement yield values larger than zero. This parameter can, for instance, be used to detect defects in the crystal lattice. For meaningful results, it is important to specify the correct number of nearest neighbors of the considered crystal structure (e.g. 8 for bcc, and 12 for fcc) via the centrosymmetry_neighbors argument. Note that diamond-like structures can not be analyzed, since they are not centrosymmetric.

  • The coordination number returns the number of neighbors of each atom within a given cutoff range, as specified by the cutoff_radius_coordination argument. Unlike the crystal structure indices, the resulting coordination numbers are rather sensitive to the choice of the cutoff and the default setting may not provide the best results for all materials.