Datasets:
ArXiv:
License:
File size: 978 Bytes
abd5619 7869e07 abd5619 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
import lmdb
import pickle
import gzip
lmdb_file = '/path/to/lmdb/dir/hokusai2017.lmdb'
with lmdb.open(lmdb_file, readonly=True, subdir=False) as env:
with env.begin() as txn:
val = pickle.loads(gzip.decompress((txn.get(b'000000984'))))
pm3_val = val['pm3']
hf_val = val['hf']
dft1st_val = val['DFT_1st']
dft2nd_val = val['DFT_2nd']
for step in dft1st_val:
# coords & grad is a list of dictionaries that stores the relevant information of each atom
# energy is a scalar representing the energy for that conformer
coords = step['coordinates']
energy = step['energy']
grad = step['gradient']
for atom in coords:
# access atom's attributes
element = atom['atom']
x = atom['x']
y = atom['y']
z = atom['z']
for atom in grad:
# access atom's attributes
element = atom['atom']
dx = atom['dx']
dy = atom['dy']
dz = atom['dz']
|