Create alloy models

This tutorial showcases how to use Alloy Theoretic Automated Toolkit (ATAT) to create random alloys based on the theory of special quasi-random structure (SQS)

Written by Cheng-Wei Lee (clee2 [at] mines [dot] edu)


Installing Alloy Theoretic Automated Toolkit

  1. Download the source file from the official website (e.g. atat3_36.tar.gz)

  2. upload the file to HPC

  3. decompress the .tar.gz file

tar -zxvf atat3_36.tar.gz

"3_36" is the version number

  1. change the directory into the folder

cd atat
  1. check the makefile within the folder and change the path to binary file (BINDIR) if need

  1. The default path way is ~/bin/ which should be added to $PATH (the default for Kestrel)

  2. Make sure you have g++ , which is provided on Kestrel by default

Then it's time to compile the source code. With the provided makefile, we only need to

make 

and if there are no error messages

make install

Sanity check of compiling

echo $?

If it returns 0, it indicates no error message. The binary like mcsqs can be found in ~/bin/

Preparing input for mcsqs

Here, we are using the Monte Carlo (mcsqs) approach to find the special quasi-random structures (SQS) that match the correlation of random distribution

To start with, we need a "lat.in" file which defines the parent structure. The one for wurtzite AlN is provided below as example

3.1284 0.0000 0.0000
-1.5642 2.7093 0.0000
0.0000 0.0000 5.0153
1 0 0
0 1 0
0 0 1
0.667 0.333 0.500 Al=0.08333333,Gd=0.91666667
0.333 0.667 0.000 Al=0.08333333,Gd=0.91666667
0.667 0.333 0.881 N
0.333 0.667 0.381 N

The first six lines define the lattice vectors. If the first three lines form a 3x3 matrix M1 and the next 3 lines for another 3x3 matrix M2. The final lattice vectors in matrix form will be M1xM2. Here's another example for rocksalt AlN

4.983 0.000000 0.000000
0.000000 4.983 0.000000
0.000000 0.000000 4.983
0.000000 0.500000 0.500000
0.500000 0.000000 0.500000
0.500000 0.500000 0.000000
0.500000 0.500000 0.500000 N
0.000000 0.000000 0.000000 Al=0.08333333,Gd=0.91666667

The remaining lines define the basis and the elements. "Al=0.08333333,Gd=0.91666667" is where we can define the Gd content for AlGdN alloys

  1. we need sufficient decimal digit for the fractional numbers (e.g. 8 digit)

  2. The chosen fraction is related to the number of atoms in SQS

Another required input is the files that describe the correlation between atoms. It can be generated using corrdump, which requires lat.in

corrdump -l=lat.in -ro -noe -nop -clus -2=4.5 -3=3.2; getclus
  1. -2 and -3 defines the cutoff radius for what are included as two- and three-body clusters based on the given lat.in structure

  2. The provided numbers for the given wurtizte AlN structure are to include the 1st and 2nd nearest neighbors (NN) for generating the two-body clusters and only the 1st NN for the three-body clusters

corrdump will create two files, sym.out and clusters.out, which will be needed for the monte carlo simulation.

With lat.in, sym.out, and clusters.out, we can run the mcsqs next

Running Monte Carlo simulation to find SQS

The typical prompt for mcsqs is shown below

mcsqs -l=lat.in -n=48
  1. Make sure mcsqs is located in the directory whose path is added to $PATH

  2. -n=48 defines the size of SQS. 48 is chosen since we use the increment of 1/12 and we want larger enough of SQS

  3. We need to perform a convergence test with respect to SQS cell size to minimize the mismatch in correlation functions for those 2-body and 3-body clusters

To fully utilize all the cpus of a given node. Here's an example SLURM script for Kestrel, which has 104 cores/node

#!/bin/bash

#SBATCH --job-name="wz SQS Al=0.25,Sc=0.08333333,Gd=0.66666667"
#SBATCH --account=multiferro 
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=104
#SBATCH --time=04:00:00
#SBATCH -o stdout
#SBATCH -e stderr
#SBATCH -p short

# Go to the directoy from which the job was launched
cd $SLURM_SUBMIT_DIR

for i in {1..104}
do
    seed=$RANDOM
    mcsqs -l=lat.in -n=48 -ip=$i -sd=$seed & 
    echo $i, $seed >> seed_record
done

wait

The idea is to initial parallel MC simulations with different initial seeds.

Analyze the MC simulation results

The goal of the MC simulation is to find a structure that has a distribution of atoms that perfectly match the correlation function of selected 2- and 3-body clusters. During the mcsqs simulation, there are three outputs: mcsqs.log, bestsqs.out, and bestcorr.out

  1. mcsqs.log records the evolution of the MC simulation but only the ones with lower objective functions will be added to it. The mismatches are shown in this file

  2. bestsqs.out is the SQS that best match the correlation function of the clusters

  3. bestcorr.out save the correlation function values for the best SQS

The goal is to find a SQS with not only low objective function but also small mismatches. It is more important to have lower mismatches if two SQS have similar objective function

The bestsqs.out can be converted to VASP POSCAR using the sqs2poscar code

Examples of mismatches in clusters for 48-atom, 72-atom, and 96-atom SQS created for wz-Al1Gd11N12 alloys

# 48-atom
Correlations_mismatch=  0.055556        -0.027778       -0.027778       -0.027778       -0.027778       -0.027778       0.004630        0.004630        -0.078704       -0.078704       0.087963        0.087963
# 72-atom
Correlations_mismatch=  0.027778        -0.027778       0.027778        -0.027778       -0.027778       0.027778        0.032407        0.032407        0.032407        0.032407        0.032407        0.032407
# 96-atom
Correlations_mismatch=  0.013889        -0.027778       0.013889        -0.027778       -0.027778       0.013889        0.004630        0.004630        0.004630        0.004630        0.004630        0.004630
  • 48-atom has some clusters with large mismatch, i.e. number > 0.04

  • 72-atom one is acceptable

  • 96-atom SQS is the best among the three

Last updated