Materials Database Access AFLOW org AFLOW RESTAPI AFLUX
Materials Database Access: AFLOW. org, AFLOW REST-API, AFLUX Cormac Toher June 17 th, 2020
AFLOW. org: search page R. H. Taylor et al. , Comput. Mater. Sci. 93, 178 -192 (2014) http: //aflow. org 2
AFLOW. org: search page Element group selection Property Filters R. H. Taylor et al. , Comput. Mater. Sci. 93, 178 -192 (2014) Element selection Number of species http: //aflow. org/advanced. php 3
AFLOW. org: search page Selected Elements Check box to restrict search results to specific value range R. H. Taylor et al. , Comput. Mater. Sci. 93, 178 -192 (2014) Number of species=2 Added filter for Egap: electronic band bap Select “Add Column” to add filter aflow. org/search/advanced. php 4
AFLOW. org: database organization R. H. Taylor et al. , Comput. Mater. Sci. 93, 178 -192 (2014) 5
AFLOW. org: database organization Data for each entry stored as keywordvalue pairs R. H. Taylor et al. , Comput. Mater. Sci. 93, 178 -192 (2014) 6
AFLOW. org: database stats With such a large dataset, how do we make it accessible? • To solve this issue, we introduced two helpful tools: 1. AFLOW REST-API. 2. AFLUX. 7
AFLOW. org: database tutorial resources • Database REST-API and AFLUX search-API tutorial scripts available in Portal: Desktop/Aflow_Day 2/ • REST-API tutorial script: Desktop/Aflow_Day 2/05_database/AFLOW_RESTAPI/restapi. py • AFLUX tutorial script: Desktop/Aflow_Day 2/05_database/AFLUX/afluxapi. py 8
AFLOW: REST-API • The AFLOW REST-API AFLOW URL (AURL) has the form: <server>: AFLOWDATA/<project>/<set>/<entry>/? <keyword> • The AURL for the formation enthalpy per atom of the ternary Heusler structure T 0001. A 2 BC with composition Cu 2 Ti. Zn is: aflowlib. duke. edu: AFLOWDATA/LIB 3_RAW/Cu_pv. Ti_sv. Zn/T 0001. A 2 BC/? enthalpy_formation_atom Server Project Set Layer Entry Keyword • This becomes the AURL: aflowlib. duke. edu/AFLOWDATA/LIB 3_RAW/Cu_pv. Ti_sv. Zn/T 0001. A 2 BC/? enthalpy_formation_atom • The full list of entries in the set Cu-Ti-Zn can be retrieved using: aflowlib. duke. edu/AFLOWDATA/LIB 3_RAW/Cu_pv. Ti_sv. Zn/? aflowlib_entries R. H. Taylor et al. , Comput. Mater. Sci. 93, 178 -192 (2014) 9
AFLOW: REST-API • Example python script to access API & download space groups (see tutorial script restapi. py): import json from urllib. request import urlopen SERVER = 'http: //aflowlib. duke. edu/AFLOWDATA' PROJECT = '/LIB 3_RAW’ SET = '/Cu_pv. Ti_sv. Zn’ ENTRIES = '/? aflowlib_entries’ Project: Ternary alloys Set: Cu. Ti. Zn alloy system Keyword: List of entries in this alloy system response = urlopen(SERVER+PROJECT+SET+ENTRIES). read(). decode('utf-8') entry_list = response. rstrip(). split(', ') Download list of entries with urlopen Loop through list of entries for entry in entry_list: entry_sg_url = SERVER + PROJECT + SET + '/' + entry + '/? spacegroup_relax' # spacegroup relax URL entry_sg = urlopen(entry_sg_url). read(). decode('utf-8') print('{0}: {1}'. format(entry, entry_sg)) Download space group for each entry R. H. Taylor et al. , Comput. Mater. Sci. 93, 178 -192 (2014) 10
AFLOW: REST-API Exercises: • Use the AFLOW REST-API to download the formation enthalpies (keyword: enthalpy_formation_atom) for all of the entries in the ternary alloy system Al. Ni. Ti: set layer “Al. Ni_pv. Ti_sv”. • Use the AFLOW REST-API to download the full list of binary alloy systems that are available in the LIB 2 project. How many alloys systems are available for download? (AURL: aflowlib. duke. edu: AFLOWDATA/LIB 2_RAW/? aflowlib_entries) • Use the AFLOW REST-API to download the stoichiometries (keyword: stoichiometry) and space groups for all of the entries in an alloy system of your choice. How many entries are present in this system? R. H. Taylor et al. , Comput. Mater. Sci. 93, 178 -192 (2014) 11
AFLUX: AFLOW Search-API Logical operator LUX syntax <block> “(” and “)” <AND> “, ” <OR> “: ” <NOT> “!” <loose> “*” <string> “’” <mute> “$” • Aim: Programatically expose the same functionality as our web search interface at http: //aflow. org/advanced. php F. Rose et al. , Comput. Mater. Sci. 137, 362 (2017). 12
AFLUX: AFLOW Search-API • AFLUX enables search functionality through query part of URI • Supports use of several logical operators • Operator scope can be inter-property and/or intra-property Logical operator AFLUX syntax Operator scope <block> “(” and “)” Intra- and inter-property <AND> “, ” Intra- and inter-property <OR> “: ” Intra- and inter-property <NOT> “!” Intra-property <loose> “*” Intra-property <string> “’” Inter-property <mute> “$” Intra-property F. Rose et al. , Comput. Mater. Sci. 137, 362 (2017). 13
AFLUX: AFLOW Search-API http: //aflow. org/API/aflux/v 1. 0/? <matchbook>, <directives> Search API Server Query • Matchbook: • Materials keywords with arguments • Example: <server>/? species((Na: K), Cl), nspecies(2), Egap(1*, *5), energy_cell • Keyword list available from schema directive: <server>/? schema • Directives: • • Formatting instructions with arguments “format” takes arguments “json” and “html” “catalog” takes arguments “icsd”, “lib 1”, “lib 2”, . . . “paging” controls number of entries and page displayed, sorted in ascending order of first materials keyword – order can be reversed by using a negative page number in the argument F. Rose et al. , Comput. Mater. Sci. 137, 362 (2017). 14
AFLUX: AFLOW Search-API • Example python script to access AFLUX search-API (see tutorial script afluxapi. py from aflow_api. txz): #!/usr/bin/env python import json, sys, os from urllib. request import urlopen AFLUX Server SERVER="http: //aflow. org" Matchbook: materials keywords API=”/API/aflux/v 1. 0/? " MATCHBOOK="species((Na: K), Cl), nspecies(2), Egap(2*, *5), energy_cell" DIRECTIVES="$paging(0)" SUMMONS=MATCHBOOK+", "+DIRECTIVES Directive: return all entries satisfying query response=json. loads(urlopen(SERVER+API+SUMMONS). read(). decode("utf-8")) for datum in response: bandgap=datum['Egap’] energycell=datum['energy_cell’] print ("{}, {}". format( datum['auid'], bandgap, energycell)) JSON with query results is downloaded F. Rose et al. , Comput. Mater. Sci. 137, 362 (2017). 15
AFLUX: AFLOW Search-API Exercises: • Use AFLUX to retrieve the formation enthalpies for all of the ternary entries in a ternary alloy system of your choice. • Use AFLUX to retrieve the space group numbers of all materials that contain Cu and Ti but not V (the logical NOT operator is denoted by the exclamation mark “!”). • Use AFLUX to retrieve the band gaps of all of the materials that have a calculated bulk modulus between 200 GPa and 300 GPa (ael_bulk_modulus_vrh). • Use AFLUX to retrieve the materials that contain the element Sn but not Pb, and that have a band gap between 1 and 3 e. V. How many such materials are available? F. Rose et al. , Comput. Mater. Sci. 137, 362 (2017). 16
- Slides: 16