Exemplo n.º 1
0
def extract_dft_E(filename):
    data = chunks_optim(filename)
    all_E = []
    for i in data:
        a = parser_lists(i, " SCF Done:", " KE= ")
        b = [k.split() for k in a if "SCF Done" in k]
        c = map(float, [j[4] for j in b])
        all_E.append(c)
    return all_E
Exemplo n.º 2
0
def extract_dft_distance(filename, atom1, atom2):
    data = chunks_optim(filename)
    all_dist = []
    for i in data:
        a = parser_lists(i, "Input orientation:", "Distance matrix")[5:-1]
        b = [i.split()[3:] for i in a]
        c = np.array([map(float, i) for i in b])
        dist = norm(c[atom2 - 1] - c[atom1 - 1])
        all_dist.append(dist)
    all_F1, all_F2 = [], []
    for j in data:
        ad = parser_lists(j, "(Enter /home/apps/Chem/g09/l716.exe)", "Cartesian Forces")[7:-1]
        bd = [i.split()[2:] for i in ad]
        cd = np.array([map(float, i) for i in bd])
        to_nN = 82.387
        F1 = norm(cd[atom1 - 1]) * to_nN
        F2 = norm(cd[atom2 - 1]) * to_nN
        all_F1.append(F1)
        all_F2.append(F2)
    return (all_dist, all_F1, all_F2)
Exemplo n.º 3
0
def extract_LUMO_E(filename):
    data = chunks_optim(filename)
    homos = []
    lumos = []
    for datai in data:
        a = parser_lists(datai, "The electronic state is", "Condensed to atoms")
        virt1 = [i for i in a if "virt" in i]
        occ1 = [i.split() for i in a if "occ" in i]
        h**o = float(occ1[-1][-1])
        lumo = list(floats([words for segments in virt1 for words in segments.split()]))[0]
        lumos.append(lumo)
        homos.append(h**o)
        # lumo = list(floats([words for segments in virt1 for words in segments.split)])
    return zip(homos, lumos)