oqmd_extract

Module to extract data from OQMD database

Functions

download(calc_type, start, end)

Function to create input files.

poscar_to_input(calc_type, mpid, compound, keven)

Function to convert POSCAR into ground-state input files.

search(kwargs, properties)

Function to search compounds.

oqmd_extract.poscar_to_input(calc_type, mpid, compound, keven)[source]

Function to convert POSCAR into ground-state input files.

Parameters:
  • calc_type (str) – Calculation type. “QE” or “VASP”.

  • mpid (str) – Material id.

  • compound (str) – Compound name.

  • keven (bool) – If even k-mesh to use.

Returns:

Compound name.

Return type:

str

Notes

This function reads a POSCAR file and generates input files required for ground-state calculations using either Quantum Espresso (QE) or VASP software.

It checks if ‘config.json’ exists, and if so, it retrieves settings such as k-point density and download configurations.

Based on the calculation type, it creates input files and directories accordingly. For VASP, it prepares INCAR, POSCAR, and POTCAR files and potentially runs VASP processing scripts if available. For QE, it creates input files with appropriate settings.

Finally, it moves input files to the designated directories.

oqmd_extract.search(kwargs, properties)[source]

Function to search compounds.

Parameters:
  • kwargs (dict) – Dictionary object for query to the OQMD website.

  • properties (list) – Properties to extract.

Notes

This function uses QMPYRester to retrieve data from the OQMD (Open Quantum Materials Database) website. It attempts to get data with the provided query parameters. If the limit is reached, it decreases the limit and retries until successful.

It then writes the retrieved data to ‘download.csv’ file, including IDs and properties specified in the list ‘properties’. It also creates ‘mpid-list.in’ file containing IDs, names, and compounds for each entry.

Example

>>> kwargs = {'element_set': '(Fe-Mn),B', 'stability': '<-0.1', 'natom': '<10', 'limit': 100}
>>> properties = ['entry_id', 'name', 'enthalpy', 'composition']
>>> search(kwargs, properties)
oqmd_extract.download(calc_type, start, end)[source]

Function to create input files.

Parameters:
  • calc_type (str) – Type of calculations, QE or VASP.

  • start (int) – Start index of the compounds to download.

  • end (int) – End index of the compounds to download.

Notes

This function utilizes QMPYRester to retrieve data from the Open Quantum Materials Database (OQMD). It reads material IDs and compounds from ‘mpid-list.in’ file and downloads the corresponding data. For each compound, it creates a POSCAR file containing the compound structure. Then, it invokes the ‘poscar_to_input’ function to generate input files for QE or VASP calculations. Finally, it updates ‘mpid.in’ file with downloaded compounds.