-
Notifications
You must be signed in to change notification settings - Fork 15
/
mol.py
59 lines (49 loc) · 1.63 KB
/
mol.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
50
51
52
53
54
55
56
57
58
59
"""
Mock mol class
"""
import numpy as np
import pickle
class mol:
"""
class mol
Contains the information about the molecule
"""
def __init__(self, atom_string_, nao_, nelect_, nmo_):
"""
mol Creator - creates an instance of the mol class
Arguments:
atoms_string_: A string for defining the atoms in the molecule
nao_: Number of atomic orbitals
nelec_: Number of electrons / 2
nmo_: Number of molecular orbitals
Returns:
instance of mol
"""
self.nao = nao_
self.nelec = [nelect_, nelect_]
self.nmo = nmo_
self.charges = []
coords_list = []
atom_list = atom_string_.split(";")
for a in atom_list:
print(a.split()[2])
self.charges.append(int(a.split()[0]))
coords_list.append([float(a.split()[1]),
float(a.split()[2]),
float(a.split()[3])])
self.coords = np.array(coords_list)
def atom_charges(self):
return self.charges
def atom_coords(self):
return self.coords
def intor(self, int_type_str_=None):
if int_type_str_ == "int1e_ovlp":
return pickle.load(open("suv.pkl", "rb"))
elif int_type_str_ == "int1e_kin":
return pickle.load(open("tuv.pkl", "rb"))
elif int_type_str_ == "int1e_nuc":
return pickle.load(open("vuv.pkl", "rb"))
elif int_type_str_ == "int2e":
return pickle.load(open("eri.pkl", "rb"))
else:
raise Exception("Unrecognized integral type")