PSI4 run time error: <module> exec(content)

Hello All,

I’m new to PSI4 so bare with me…

The following repetitive errors on a number failed job raw file output:

*** Psi4 encountered an error. Buy a developer more coffee!
*** Resources and help at github.com/psi4/psi4.
Traceback (most recent call last):
File “/home/webmo/psi4conda/bin/psi4”, line 269, in
exec(content)
File “”, line 83, in

IndexError: list index out of range

Line 83 in psi4 states:

82 parser.add_argument(’–plugin-template’,
83 choices=[‘ambit’, ‘aointegrals’, ‘basic’, ‘dfmp2’, ‘mointegrals’, ‘scf’, ‘sointegrals’, ‘wavefunction’],
84 help=‘Selects new plugin template to use.’)

Traceback (most recent call last):
File “/home/webmo/psi4conda/bin/psi4”, line 269, in
exec(content)
File “”, line 74, in

IndexError: list index out of range

Psi4 stopped on: Wednesday, 29 August 2018 10:37AM
Psi4 wall time for execution: 0:00:01.48

Traceback (most recent call last):
File “/home/webmo/psi4conda/bin/psi4”, line 269, in
exec(content)
File “”, line 75, in

IndexError: list index out of range

Psi4 stopped on: Tuesday, 28 August 2018 06:14PM
Psi4 wall time for execution: 0:00:00.35

*** Psi4 encountered an error. Buy a developer more coffee!
*** Resources and help at github.com/psi4/psi4.
Traceback (most recent call last):
File “/home/webmo/psi4conda/bin/psi4”, line 269, in
exec(content)
File “”, line 75, in

IndexError: list index out of range

Line 75 in psi4 is:
71 parser.add_argument("–json", action=‘store_true’,
72 help=“Runs a JSON input file. !Warning! experimental option.”)
73 parser.add_argument("-t", “–test”, action=‘store_true’,
74 help=“Runs smoke tests.”)
75
76 # For plugins

The error message is a lot more confusing than it should be. Here’s the end of an output I just attempted that failed.

Traceback (most recent call last):
  File "/opt/vulcan/opt/vulcan/linux-x86_64/intel-16.0.1/psi4-master-avducsgnonqrcpftiesq432gagal6y7r/bin/psi4", line 269, in <module>
    exec(content)
  File "<string>", line 30, in <module>

IndexError: list index out of range

    Psi4 stopped on: Wednesday, 29 August 2018 01:11PM
    Psi4 wall time for execution: 0:00:02.68

*** Psi4 encountered an error. Buy a developer more coffee!
*** Resources and help at github.com/psi4/psi4.

What was the problem? Nowhere in Psi. The input file was bad.

memory 600 mb

molecule h2o {
  O   
  H 1 0.96
  H 1 0.96 2 104.5
}

set basis cc-pVDZ
energy('scf')

foo = [1, 2]
print(foo[3])

The actual quantum chemistry runs just fine, but Psi rightly complains when I try to access a non-existent index.

Not helping any is the line number. Psi reports that my error occurred on line 30 of a 13 line input file. What’s that about? Internally, Psi parses your input file to pure Python, and the pure Python parsing is…

import psi4
from psi4 import *
from psi4.core import *
from psi4.driver.diatomic import anharmonicity
from psi4.driver.gaussian_n import *
from psi4.driver.frac import ip_fitting, frac_traverse
from psi4.driver.aliases import *
from psi4.driver.driver_cbs import *
from psi4.driver.wrapper_database import database, db, DB_RGT, DB_RXN
from psi4.driver.wrapper_autofrag import auto_fragments
from psi4.driver.constants.physconst import *
psi4_io = core.IOManager.shared_object()
geometry("""
0 1
H 0 0 0
H 0.74 0 0
""","blank_molecule_psi4_yo")
core.set_memory_bytes(600000000)

h2o = geometry("""
  O   
  H 1 0.96
  H 1 0.96 2 104.5
""","h2o")
core.IO.set_default_namespace("h2o")
core.set_global_option("BASIS", "cc-pVDZ")
energy('scf')
foo = [1, 2]
print(foo[3])

With the new line numbering, the problematic line is now line 29. This isn’t quite 30, but close enough.

So, the application to your problem: something is wrong with your input file. If you can’t spot it manually, then run psi4 with the -v flag. That flag will print extra debug information, including the parsed version that the line numbers should match.

…All of which is more confusing than it should be. I’ll get a bug report up.