-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfchl.py
executable file
·49 lines (39 loc) · 1.36 KB
/
fchl.py
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
40
41
42
43
44
45
46
47
48
49
#!/home/mdi0316/anaconda3/bin/python
### common input start
import os, sys, re
import numpy as np
import pandas as pd
import shutil
import subprocess as sp
import datetime
import getpass
user = getpass.getuser()
scripts_dir = '/home/mdi0316/FUNCTIONS'
classes_dir = '/home/mdi0316/CLASSES'
sys.path.insert(0, scripts_dir)
sys.path.insert(0, classes_dir)
import IONIC_LIQUID as IL
import GAMESS
from Regression import pred_GPR_3D, pred_KRR, get_dataset
from Functions import *
import json
from qml.fchl import generate_representation
csv_file = 'cart_coords.csv'
df = pd.read_csv(csv_file, index_col = 0, dtype=object)
for idx, row in df.iterrows():
cart_coords = ast.literal_eval(row['cart.coords.'])
mull_charges = ast.literal_eval(row['mull.charges'])
at_charg = np.array([float(v['charge']) for v in mull_charges.values() ])
at_coord = np.empty([0,3])
for kk, tmp_dict in cart_coords.items():
x = float(tmp_dict['x'])
y = float(tmp_dict['y'])
z = float(tmp_dict['z'])
print( kk, tmp_dict, [x,y,z] )
at_coord = np.vstack( ( at_coord, [x,y,z] ) )
rep = generate_representation( at_coord, at_charg[0:int(kk)+1] )
print( kk, at_coord, len(at_charg[0:int(kk)+1]) )
print( at_coord.shape )
print( at_charg.shape )
rep = generate_representation( at_coord, at_charg )
print(rep)