"set properties_origin" currently broken for "COM" or variables as values?

We’re currently fiddling about with calculating properties determined using different origins, using something along the lines of:

molecule h2o {
    O
    H 1 1.0
    H 1 1.0 2 104.5
}
set {
  basis        cc-pVTZ
}
E, wfn = energy('scf', return_wfn = True)

set properties_origin [0.0, 1.0, 0.0]
oeprop(wfn, "QUADRUPOLE")

The above works as expected. However, using COM (as outlined here:

set properties_origin ["COM"]
oeprop(wfn, "QUADRUPOLE")

throws:

Fatal Error: Invalid specification of PROPERTIES_ORIGIN.  Please consult the manual.
Error occurred in file: /var/tmp/build/psi4/psi4/src/psi4/libmints/oeprop.cc on line: 783

(Digging into oeprop.cc looks like it should work!)

We’ve also found that we can’t use a variable within the coordinates, i.e.

z = 1.0
set properties_origin [0.0, 0.0, z]

always evaluates z as 0.0 rather than whatever the value of z is.

I’m not sure whether this is an issue within the python driver or the c++ side of things, i.e. whether variables are substituted by their values within python or c++ code.

Well, you’re right on all counts.

The [0.0, z, z] one is simplest. The inputparser that transforms Psithon into proper python turns it into [0.0, "z", "z"] rather than evaluating the z. You can get around this by using the python call directly, psi4.set_global_option("PROPERTIES_ORIGIN", [0.0, z, z]) instead of set properties_origin [0.0, z, z]. The PsiAPI input should also be fine.

The ["COM"] issue looks to have gotten broken upon Boost --> pybind11. I’ve fixed it locally and will PR it soon.

Your reputation for finding obscure bugs continues. Thanks!

Fixed in master as of https://github.com/psi4/psi4/commit/98ece53edacbb467132cbd59b964612b64c48501

I can confirm that “COM” and using psi4.set_global_option() both work as expected.
:slight_smile: