Ejemplo n.º 1
0
def test_j3d():
    data_3d = get_3d_dataset()
    assert (len(data_3d)) == 32486
Ejemplo n.º 2
0
from jarvis.db.static.explore_db import get_3d_dataset
import os
from pymatgen.symmetry.bandstructure import HighSymmKpath

data=get_3d_dataset()
def give_cif_for_jid(jid=''):
    strt='na'
    for i in data:
     if i['jid']==jid:
      strt=i['final_str']
      break
    return strt

def prepare_wien_input(jid='JVASP-1002'):
    s=give_cif_for_jid(jid=jid)
    filename1=str(jid)+str('.cif')
    fold=jid

   ## if not os.path.exists(fold):
       ##os.makedirs(fold)
       ##os.chdir(fold)
    s.to(fmt='cif',filename=filename1)
    cmd=str('cif2struct') + str(' ')+str(filename1)
    os.system(cmd)
    cmd=str('init_lapw -b -red 0 -vxc 13 -ecut -7.0  -numk 100 -sp >init_w2k_out' )
    os.system(cmd)
    cmd=str('runsp_lapw -cc 0.0001 -ec 0.0001 -p -i 500  >run_w2k_out')
    os.system(cmd)
    ##os.chdir('../')

def get_kpoints(strt=''):
Ejemplo n.º 3
0
pos = os.path.join(os.path.dirname(__file__), "..", "..", "vasp", "examples",
                   "SiOptb88", "POSCAR")

# STEP-1: Check if the descriptor array length for POSCAR is 1557 as
# mentioned in https://journals.aps.org/prmaterials/abstract/10.1103/PhysRevMaterials.2.083801
s = Structure.from_file(pos)
X = get_comp_descp(s)
print(X, len(X))
# 1557

# STEP-2: Download JARVIS-DFT database for bulk materials
# from https://figshare.com/articles/jdft_3d-7-7-2018_json/6815699

# STEP-3: load data
data = get_3d_dataset()  # loadfn("jdft_3d-7-7-2018.json", cls=MontyDecoder)
print("data length", len(data))
print("available keys", data[0].keys())


# Simple function to check if the data is available/float
def isfloat(value):
    try:
        float(value)
        return True
    except ValueError:
        return False


# STEP-4:  Let's train a Formation energy ML
# for i in data: