# Angular parameter#

This illustartes the use of angular parameter to identify diamond structure. Angular parameter was introduced by Uttomark et al., and measures the tetrahedrality of the local atomic structure. An atom belonging to diamond structure has four nearest neighbors which gives rise to six three body angles around the atom. The angular parameter \(A\) is then defined as,

\(A = \sum_{i=1}^6 (\cos(\theta_i)+\frac{1}{3})^2\)

An atom belonging to diamond structure would show the value of angular params close to 0. The following example illustrates the use of this parameter.

```
from pyscal3 import System
import numpy as np
import matplotlib.pyplot as plt
```

## Create structures#

The first step is to create some structures using the pyscal crystal structures module and assign it to a System. This can be done as follows-

```
sys = System.create.lattice.diamond(lattice_constant=4, repetitions=[3,3,3])
```

Now we can find the neighbors of all atoms. In this case we will use an adaptive method which can find an individual cutoff for each atom.

```
sys.find.neighbors(method='cutoff', cutoff='adaptive')
```

Finally, the angular criteria can be calculated by,

```
sys.calculate.angular_criteria()
```

The above function assigns the angular value for each atom which can be accessed using,

```
np.mean(sys.atoms.angular_parameters.diamond_angle)
```

```
1.8488927466117464e-32
```

The angular values are zero for atoms that belong to diamond structure.