How to set geometry options for optking in python API for psi4

I am trying to run a simple geometric optimization for LiCN with 6-31G* basisset and then get the one, two electron integrals in an fcidump .

But, end up getting the error :
BEND::BEND() Atoms defining bend are not unique.
Segmentation fault (core dumped)

I am using PsiAPI mode and the following is my .py file:

import numpy as np
import psi4


psi4.core.set_output_file('lithium_cyanide_output.dat',True)

options = {'memory': 40e9,
          'scf_type':'pk',
          'e_convergence': 1e-8,
          'd_convergence': 1e-8,
}

psi4.set_options(options)
psi4.set_num_threads(6)

mol_Sxyz = open('lithium_cyanide_Sxyz.txt', 'r').read() 
mol = psi4.geometry(mol_Sxyz)
psi4.core.set_local_option("OPTKING", "frozen_bend", "1 2 3")
E, wfn = psi4.optimize('hf/6-31g*', return_wfn=True)

np.savetxt('lithium_cyanide_eigen_energy.dat', E)
wfn.to_file('lithium_cyanide_wfn.dat')
psi4.fcidump(wfn, fname = 'lithium_cyanide_intdump.dat', oe_ints=['EIGENVALUES'] )


And my mol_Sxyz.txt looks like :

N      3.732000    0.500000    0.000000
C      2.866000    0.000000    0.000000
Li     2.000000   -0.500000    0.000000


units angstrom

Optking issue go to @Rollin_King

Looks like a bug in the coordinate detection scheme. I’ll look for a work around, and/or try out with newer code, but it may take me a couple of days to get to it.

Is there anyway I could optimize using geometric? Or would it work if I try this out with psithon? But i am guessing that may not work.

Psithon won’t help.

Geometric might work. If you want to use it, reading the documentation is always a great place to start.

The calculation runs fine with geometric.

There’s another issue I came across while fiddling around with this simple calculation, for some reason, pythonAPI’s qcelemental module ends up throwing an error ‘LI not in the list’. I guess there seems to be an issue with coordinate detection that’s linked to this. I have had that error a couple of times, but unfortunately I didn’t make a note of the exact psi4.core.Molecule method that led to this.

Without an example, I’m afraid there’s nothing we can do.

Glad you found a workaround. I didn’t get a chance to look at it yet, but we’ll make sure your job runs fine with the new optking. Cheers.