`atomsk --nye <file1> <file2> [options] [<outputfile>] [formats]`

This mode computes the per-atom Nye tensor, a quantity related to the strain gradient around an atom. The Nye tensor can be useful for visualizing lattice defects such as point defects, dislocations, or planar defects (stacking faults, twins, grain boundaries).

The calculation follows the method described in C.S. Hartley, Y. Mishin, *Acta Mater.* **53** (2005) 1313. Given a reference lattice defined by a set of atom positions **P** and a distorted lattice defined by **Q**, the lattice correspondance tensor is computed as:

**G** = (**Q**^{T} **Q**)^{-1} **Q**^{T} **P**

Once the tensor **G** is computed for each atom, then the Nye tensor **α** is computed from its spatial derivatives (ε_{imk} is the Levi-Civita permutation symbol):

**α**_{jk} = -ε_{imk} ∂_{m}**G**_{ij}

This mode requires two files: a <file1> containing the reference system, and a <file2> that contains the system to analyze. The reference system may be:

**a full reference system**, i.e. a supercell of bulk, undeformed and defect-free material that has the same number of atoms as the analyzed system (<file2>). In addition, atom indices should match between the two files, and their positions should not change too much. For example, if one wishes to analyze a <file2> containing a screw dislocation, then the <file1> should be a supercell of perfect material with the same number of atoms.**a unit cell**of the system to analyze. The unit cell may or may not have the same crystal orientation as the system to analyze. Atomsk will construct the reference atomic environments from the unit cell, and compare them with the actual atomic environments in the system to study.**NULL**, meaning that no reference is provided. Atomsk will construct reference atomic environments on-the-fly, by averaging the environments found in the system to analyze. Environments where atoms have an odd number of neighbors are discarded (not included in the averaging).

The two files <file1> and <file2> may be of the same format, or of different formats, as long as these formats are supported by Atomsk.

The nine components of the Nye tensor are saved as auxiliary properties for each atom (in the following order: α_{11}, α_{12}, α_{13}, α_{21}, α_{22}, α_{23}, α_{31}, α_{32}, α_{33}). Note that Atomsk will output these auxiliary properties only to the file formats that support it, like e.g. Atomeye CFG format (see this page for a list of formats supporting auxiliary properties).

If you use this mode with one or several options they will be applied to the <file1> and <file2> *before* the Nye tensor is computed.

Note that this mode assumes that the atom coordinates are *wrapped*, i.e. that all atoms are inside of the simulation box. If it is not the case then the calculation may be wrong. Coordinates can be wrapped thanks to the option `-wrap`

.

`atomsk --nye reference.xsf dislocation.cfg nye.cfg`

This will compute the Nye tensor due to the displacements in the file

`dislocation.cfg`

, using`reference.xsf`

as a reference system. The positions and Nye tensors of atoms will be written to`nye.cfg`

.`atomsk --nye unitcell.xsf mysystem.cfg nye.cfg`

In this example, a unit cell is provided as reference system. Atomsk will construct reference atomic environments from the file

`unitcell.xsf`

, and then proceed with computing the Nye tensor. The final result will be written into`nye.cfg`

.`atomsk --nye NULL mysystem.cfg nye.cfg`

In this example the reference system is specified as "NULL", i.e. no reference is provided. Atomsk will read atom positions from the file

`mysystem.cfg`

, and average their environments to construct the reference. Then, it will compute the Nye tensor and write the result into`nye.cfg`

.