How to use spectroscopic constants for diatomics function

Hi everyone,

I tried to use the “Spectroscopic Constants for Diatomics” function as described in
http://www.psicode.org/psi4manual/master/diatomic.html

Here is my stupid input file, constant.dat

rvals=[2.5, 3.0, 4.0]
energies=[-161532.066290, -161532.703420, -161532.663434]

driver.diatomic.anharmonicity(‘rvals’, ‘energies’, ‘output.dat’)

By executing the input file as
psi4 constant.dat constant_out.dat
I received the following message


Traceback (most recent call last):
File “”, line 19, in
NameError: name ‘driver’ is not defined


May I know what is the reason for this issue and how to fix it? (I know three points are not enough…)

Hi, I managed to make it work, but for H2 under CCSD/cc-pVTZ, seems it having difficulty to converge


rvals =[0.5, 1.0, 1.5, 2.0, 2.5, 3.0 ]
energies=[-1.1008696866, -1.145759, -1.066168,-1.020455,-1.004680, -1.000726]

anharmonicity(rvals, energies, ‘output.dat’)


Performing a fit to 6 data points

Optimizing geometry based on current surface:

   E =    -1.03725492992109, x =      1.7500000, grad =     0.09203615427689
   E =    -1.01078412643145, x =      2.2075194, grad =     0.03450393540924
   E =    -1.00444177519382, x =      2.5248671, grad =     0.00895525792650
   E =    -1.00329661057718, x =      2.7102773, grad =     0.00457149292346
   E =     0.00000000000000, x =     38.3762532, grad =     0.00000000000000

Final E = 0.00000000000000, x = 38.3762532, grad = 0.00000000000000

Traceback (most recent call last):
File “/home/cwang/psi4conda/bin/psi4”, line 248, in
exec(content)
File “”, line 21, in
File “/home/cwang/psi4conda/lib//python3.6/site-packages/psi4/driver/diatomic.py”, line 127, in anharmonicity
raise Exception(“Minimum energy point is outside range of points provided. Use a higher range of r values.”)

Exception: Minimum energy point is outside range of points provided. Use a higher range of r values.

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

I think you just need more points grouped tighter around the apparent equilibrium distance.