I’m trying to run psi4 using WebMO server on a WSL/Windows10. Most calcs work, but not the MOs.
Any help troubleshooting?
*** Psi4 encountered an error. Buy a developer more coffee!
*** Resources and help at github.com/psi4/psi4.
Traceback (most recent call last):
File “/home/crfhradilvp/psi4conda/bin/psi4”, line 287, in
exec(content)
File “”, line 71, in
IndexError: list index out of range
Printing out the relevant lines from the Psithon --> Python processed input file:
end = (i+1)*6
lin = “%12s” % (’ ')
for j in range(start,end): lin+= “%10d” % (j+1)
print_out(lin+newline)
lin = " "
–> for num in range(start,end): lin+= “%10.3f” % (float(evals[num]))
print_out("Eigenvalues: “+lin+newline)
for j in range(len(coeffs)):
lin = “%3d %5s” % (j+1,ao_labels[j].split()[0])
lin += “%5s” % (” ".join(ao_labels[j].split()[1:]))
for num in range(start,end): lin+= “%10.5f” % (float(coeffs[j][num]))
Can you post a copy of the input file? Based on the error message, it looks like in the line for num in range(start,end): lin+= “%10.3f” % (float(evals[num])), you’re trying to access a non-existent element of a list. evals[num] probably doesn’t exist for some value of num, but I need to know where these variables come from to be more specific. Hence the input file.
memory 1024 mb
import numpy as np
import psi4
import math
molecule mol {
0 1
O 0.00000000 0.00000000 0.00000000
H 0.00000000 -0.75808100 -0.63582100
H 0.00000000 0.75808100 -0.63582100
}
set scf_type df
set basis STO-3G
set reference rhf
set MOLDEN_WRITE true
set WRITER_FILE_LABEL output
set print_mos true
e, wfn = energy('scf', return_wfn=True)
newline = """
"""
print_out("Molecular Orbitals with AO's Listed"+newline)
# Use Andy's handy little AO name helper function
ao_labels = []
for s in range(wfn.basisset().nshell()):
shell = wfn.basisset().shell(s)
center = str(shell.ncenter+1)
am = [shell.am](http://shell.am)
amchar = shell.amchar
basename = '{'+wfn.molecule().symbol(shell.ncenter)+center+'} '+amchar
if amchar == 'd' and wfn.basisset().has_puream() == True:
for i in range(1,6): ao_labels.append(basename+' '+str(i))
continue
for j in range(0,am+1):
lx = am - j
for lz in range(0, j + 1):
ly = j - lz
ao_labels.append(basename+'x'*lx+'y'*ly+'z'*lz)
evals = list(np.array(wfn.epsilon_a_subset("AO", "OCC")).astype(str))
coeffs = list(np.array(wfn.Ca_subset("AO", "OCC")).astype(str))
length = int(math.ceil(len(evals)/6))
rem = len(evals)%6
start = 0
end = 0
for i in range(length+1):
if rem == 0 and i == length: break
if rem != 0 and i == length:
start = end
end = start + rem
else:
start = i*6
end = (i+1)*6
lin = "%12s" % (' ')
for j in range(start,end): lin+= "%10d" % (j+1)
print_out(lin+newline)
lin = " "
for num in range(start,end): lin+= "%10.3f" % (float(evals[num]))
print_out("Eigenvalues: "+lin+newline)
for j in range(len(coeffs)):
lin = "%3d %5s" % (j+1,ao_labels[j].split()[0])
lin += "%5s" % (" ".join(ao_labels[j].split()[1:]))
for num in range(start,end): lin+= "%10.5f" % (float(coeffs[j][num]))
print_out(lin+newline)
print_out(newline)
oeprop(wfn, "MULLIKEN_CHARGES")
mol.print_out()
print_variables()
I need the version of the input file with the whitespace intact. When you’re working with Python code, whitespace is important. Also, it’s helpful to enclose code in triple backticks (looks like ```). Then the forum won’t interfere with the formatting.
Looking at the input file, I suspect you got this input file from somewhere else. If you don’t mind me asking, where? In addition to whatever is necessary to fix this bug, I’m probably going to recommend some other changes, and those should go to the source.
So WebMO is generating this file? I’m definitely confused about the weblink in the input file. @ashley, have you run MOs of late? Otherwise we’ll have to send to Prof. Schmidt.
What version of WebMO and what version of Psi4 are you using? If you just upgraded to the HTML5 version of WebMO (version 18+) with the newest version of Psi4 (version 1.2+), there was a known problem with the MO parsing there. We have a new version of the parsing script that just came out (as of April 26, 2019) that should fix the problems. If you replace your webmo/public_html/cgi-bin/parse_psi.cgi file with this new one, it should fix all the known parsing problems. (I can’t post the .cgi file here because the forum doesn’t allow it, but if you e-mail me I can send it to you.)
Go to https://github.com/psi4/psi4webmo/tree/master/cgi-bin and download the parse_psi.cgi script. Replace the file in ~webmo/public_html/cgi-bin/parse_psi.cgi with this new one and hopefully that should fix your problems.
Update - I reinstalled everything from scratch to make sure that I didn’t muck anything up. I also install gamess on my WSL to make sure that this was peculiar to running WebMO on a WSL. Gamess works fine making MOs.
Another thing I noticed, but I’m not sure if it matters, when I ran PSI4 to get vibrational frequencies all of the intensities are reported as 1. Is this a parsing error or does PSI4 not estimate intensities?
input.inp
memory 1024 mb
molecule mol {
0 1
O 0.00000000 0.00000000 0.00000000
H -0.91097400 -0.23977800 -0.00000000
H 0.01211098 0.94192380 -0.00000000
}
set scf_type df
set basis STO-3G
set reference rhf
mol.update_geometry()
mol.symmetrize(1e-3)
e, wfn = optimize('scf', return_wfn=True)
e, wfn = frequencies('scf', return_wfn=True)
oeprop(wfn, "MULLIKEN_CHARGES")
mol.print_out()
print_variables()
Psi does do IR intensities but only for restricted Hartree–Fock. It’s pretty new, and I don’t know if WebMO does that optional parsing.
If you get a chance, could you post the MO input file with spacing intact? I can at least see if it runs ok command-line. If that’s ok and it’s not the problem that Ashley knew of, we’ll have to send to the WebMO folks.
Thank you Ashley for pointing to the psi4webmo git repo. I actually downloaded and installed all the latest from there and I’m not getting any errors!
However, I’m also not getting any MO visualization. The MO’s are reported correctly in WebMO, but they aren’t painted when I click on the magnifying glass.
Here’s the input.inp:
memory 1024 mb
molecule mol {
0 1
O 0.00000000 0.00000000 0.00000000
H -0.75808100 -0.00000000 0.63582100
H 0.75808100 0.00000000 0.63582100
}
set scf_type df
set basis STO-3G
set reference rhf
set MOLDEN_WRITE true
set WRITER_FILE_LABEL output
set print_mos true
e, wfn = energy('scf', return_wfn=True)
molden(wfn, 'output.molden')
oeprop(wfn, "MULLIKEN_CHARGES")
mol.print_out()
print_variables()
On the IR topic, WebMO inserts the dertype=1 into the input that forces finite difference (to be fair, analytic Hessians are the exception, not the rule, in psi). If you remove that arg in the input, you get intensities:
I’m glad the cgi from psi4webmo worked, but I’m suspicious of the word “update”. That psi4/psi4webmo repo is only a means of exchanging code between psi4 devs and the webmo folks. The definitive webmo code is under a different location under a different version control system, and they only get synced up when someone has an interest, so some of those files are many years old. You may want to get a fresh installation and replace only the file Ashley mentioned.
The IR fix worked, but WebMO is not parsing the information correctly.
At first I downloaded the lastest WebMO Pro version that I have a license for (18.1.002p). Perhaps those script changes aren’t in the download? I see what you mean about the dates - most are 2,3 or 5 years
WebMO shows orbitals, occupancy, energies - but not visualization.
(from the Li atomic radius lab at psi4education) I get:
I don’t know how the MOs are communicated between Psi and WebMO, be it printing, or Molden, NBO, or fchk files. We have had changes in our code of late to make the files more regulation. This comes to mind for Molden files and there are others. If you’ll post the link to the webmo thread here, I’ll try to follow along and chip in.