aflow_extract¶
Module to search and download input files from AFLOW database.
Functions
|
Function to create input files. |
|
Main program. |
|
Function to create a POSCAR file from data obtained from a query. |
|
Function to create a string for URL search from the dictionary provided in config.json. |
|
Function to search data via AFLOW database. |
- aflow_extract.properties_string(dict_param)[source]¶
Function to create a string for URL search from the dictionary provided in config.json.
Parameters: dict_param (dict): A dictionary from the config.json file containing search criteria.
Returns: str: A string representing the search criteria for URL.
Example
>>> criteria_dict = { ... "aflow": { ... "filter": True, ... "elm": ["Cu", "Zn"], ... "nsites": 4, ... "metal": True, ... "FE": False, ... "spacegroup": None, ... "limit": 10, ... "prop": ["energy", "bandgap"] ... } ... } >>> criteria_string = properties_string(criteria_dict) >>> print(criteria_string) 'species(Cu,Zn),natoms(1*,*4),Egap(0),enthalpy_formation_atom(*),spacegroup_relax(*), $paging(1,10),energy,bandgap'
- aflow_extract.search_data(dict_param)[source]¶
Function to search data via AFLOW database.
Parameters: dict_param (dict): A dictionary containing search criteria.
Returns: None
This function constructs a URL based on the search criteria provided in dict_param and retrieves data from the AFLOW database. It saves the retrieved data as a CSV file in the ‘download’ directory and also generates an ‘mpid-list.in’ file containing relevant data.
Example
>>> search_criteria = { ... "aflow": { ... "elm": ["Cu", "Zn"], ... "nsites": 4, ... "metal": True, ... "FE": False, ... "spacegroup": None, ... "limit": 10, ... "prop": ["energy", "bandgap"] ... } ... } >>> search_data(search_criteria)
- aflow_extract.poscar_create(data)[source]¶
Function to create a POSCAR file from data obtained from a query.
Parameters: data (dict): A dictionary containing information necessary for creating the POSCAR file.
Returns: Structure: A pymatgen Structure object representing the structure.
This function takes data including lattice parameters, compound information, fractional positions, and creates a pymatgen Structure object. It then returns the Structure object representing the structure. This function currently does not write the POSCAR file to disk but can be extended to do so.
Example
>>> data = { ... "geometry": [3.84, 3.84, 3.84, 90, 90, 90], ... "compound": "Si", ... "auid": "aflow:12345", ... "positions_fractional": [[0.000000, 0.000000, 0.000000], [0.250000, 0.250000, 0.250000]] ... } >>> structure = poscar_create(data) >>> print(structure) Full Formula (Si2) Reduced Formula: Si abc : 3.840198 3.840198 3.840198 angles: 90.000000 90.000000 90.000000 Sites (2) # SP auid --- ---- ------------- 0 Si aflow:12345 1 Si aflow:12345
- aflow_extract.download(calc_type, start, end)[source]¶
Function to create input files.
Parameters: calc_type (str): Type of calculations, either ‘QE’ or ‘VASP’. start (int): Starting index. end (int): Ending index.
Returns: None
This function retrieves data from the AFLOW database based on the specified range of indices, constructs input files for quantum mechanical calculations, and saves them. It also creates a file named ‘mpid.in’ containing information about the downloaded structures.
Example
>>> download("QE", 1, 10)