AFLOW Prototypes

Process for downloading the AFLOW prototypes using the python interface.

The AFLOW Database

I have chosen to use the AFLOW data as a comparison to existing literature because the prototypes include the icsd experimental data as well as an ever increasing number of first principles calculations. The MSG group contributes to the AFLOW database.

To query the database for relevant data I used the python interface to Rest API. Rosenbrock, C. W. (2017). A Practical Python API for Querying AFLOWLIB. arXiv preprint arXiv:1710.00813.

# The python interface to the AFLOW Rest API.
from aflow import *
# Choose all unique binaries and ternaries from a list of elements.
from itertools import combinations
# Save the dictionary for each query
import json

# Loop through pure, binary, and ternary systems (there are no quaternary here)
for s in range(1,4):
    # Find the unique permutations of length s
    for comb in combinations(["Al","Co","Nb","V"],s):
        # reset the dictionary for ease of parsing and creating plots.
        cfgs={}
        # Pure elements (e.g. comb[0]="Al")
        if s == 1:
            # Query the database of purge elements for each combination.
            # res in an iterator over the filtered results that accepts lazy evaluation
            res=search(catalog='lib1').filter((K.species==comb[0]) & (K.nspecies == 1))
        if s == 2:
            # Check for failure of an empty set.
            try:
                print(comb)
                # K.nspecies limits to binaries with the specified elements.
                res=search(catalog='lib2').filter((K.species==comb[0])&(K.species==comb[1]) & (K.nspecies == 2))
            except AssertionError:
                print("none")
        if s == 3:
            try:
                print(comb)
                res=search(catalog='lib3').filter((K.species==comb[0])&(K.species==comb[1])&(K.species==comb[2]) & (K.nspecies == 3))
            except AssertionError:
                print("none")

        for cfg in res:
            # Convert composition to binary coordinates from element A=0.0 to B=1.0
            # I chose a dictionary to preserve the POTCAR used.
            cfgs[cfg.compound] = [cfg.composition[-1]/sum(cfg.composition), cfg.enthalpy_formation_atom]
            print(cfgs[cfg.compound])
        # Save each query under the name of the combination.
        with open(''.join(comb)+'.json', 'w') as fp:
            json.dump(cfgs, fp)

This code only checks the AFLOW lib1-lib3 not icsd.

The next step is to plot the data and compare to AFLOW as a sanity check.

Last updated

Was this helpful?