Disorder variable#

In this example, disorder which was introduced to measure the disorder of a system is explored. We start by importing the necessary modules.

from pyscal3 import System
import numpy as np

First an fcc structure with a lattice constant of 4.00 is created.

fcc = System.create.lattice.fcc(lattice_constant=4, repetitions=[4,4,4])

The next step is find the neighbors, and the calculate the Steinhardt parameter based on which we could calculate the disorder variable.

fcc.find.neighbors(method='cutoff', cutoff='adaptive')

Once the neighbors are found, we can calculate the Steinhardt parameter value. In this example \(q=6\) will be used.

fccq = fcc.calculate.steinhardt_parameter(6)

Finally, disorder parameter can be calculated.


The calculated disorder value can be accessed easily with tab completion


As expected, for a perfect fcc structure, we can see that the disorder is zero. The variation of disorder variable on a distorted lattice can be explored now.

fcc_d1 = System.create.lattice.fcc(lattice_constant=4, repetitions=[4,4,4], noise=0.1)

Once again, find neighbors and then calculate disorder

fcc_d1.find.neighbors(method='cutoff', cutoff='adaptive')

Check the value of disorder


The value of disorder parameter shows an increase with the amount of lattice distortion. An averaged version of disorder parameter, averaged over the neighbors for each atom can also be calculated as shown below.


Once again, we can visualise the system