Fixed Gamess with symmetry

This commit is contained in:
Anthony Scemama 2018-11-07 15:29:32 +01:00
parent ca97e90da3
commit b502a622cc
1 changed files with 33 additions and 22 deletions

View File

@ -599,15 +599,19 @@ class gamessFile(resultsFile):
except IndexError:
return None
end = self._pos
pos += 4
pos += 2
basis_read = []
basis_read_dict = {}
atom_label = None
atom = []
while pos < end:
line = self.text[pos].split()
bf = []
if len(line) == 1:
basis_read.append(atom)
basis_read_dict[atom_label] = atom
atom = []
atom_label = line[0]
while len(line) > 1:
index = int(line[0])
sym = line[1]
@ -625,20 +629,29 @@ class gamessFile(resultsFile):
pos += 1
basis_read.append(atom)
basis_read_dict[atom_label] = atom
# new_basis_read = []
# ib = 1
# for iatom in range(len(basis_read)):
# atom = basis_read[iatom]
# for (i, s, b) in atom:
# new_basis_read += [ [ib, s, b] ]
# ib += 1
# if iatom+1 < len(basis_read):
# while ib < basis_read[iatom+1][0][0]:
# for (i, s, b) in atom:
# new_basis_read += [ [ib, s, b] ]
# ib += 1
#
# basis_read = new_basis_read
new_basis_read = []
ib = 1
for iatom in range(len(basis_read)):
atom = basis_read[iatom]
for (i, s, b) in atom:
new_basis_read += [ [ib, s, b] ]
ib += 1
if iatom+1 < len(basis_read):
while ib < basis_read[iatom+1][0][0]:
for (i, s, b) in atom:
new_basis_read += [ [ib, s, b] ]
ib += 1
for a in atom:
new_basis_read += [ a ]
basis_read = new_basis_read
Nmax = basis_read[len(basis_read)-1][0]
@ -646,18 +659,15 @@ class gamessFile(resultsFile):
for b in basis_read:
basis[b[0]-1] = [b[1],b[2]]
# If symmetry is used, rebuild the basis taking the infos of the atoms
if None in basis:
basis_aux = []
for atom in self.geometry:
basis_aux += basis_read_dict[atom._name]
NotNone = 0
ReadNone = False
for i in range(len(basis)-1,-1,-1):
if basis[i] == None:
ReadNone = True
basis[i] = list(basis[i+NotNone])
else:
if ReadNone:
NotNone = 0
ReadNone = False
NotNone += 1
for i,b in enumerate(basis):
if b is None:
basis[i] = [ basis_aux[i][1], basis_aux[i][2] ]
k=0
while k<len(basis):
@ -697,6 +707,7 @@ class gamessFile(resultsFile):
basis[k][0] = i
k+=1
for a,i in enumerate(self.atom_to_ao_range):
for j in range(i[0]-1,i[1]):
basis[j].append(a)