# Fatal Error: Cannot set element X since there are only X elements

Dear collegues,
I am new to Psi4 software, and facing some problems while working with heavy metals. It was showing error: "Fatal Error: Cannot set element 12 since there are only 12 elements.
! Error occurred in file: D:\a\1\s\psi4\src\psi4/libmints/vector.h on line: 207. ".
Please suggest me an input file format for SAPT calculation for heavy metals. Below I have attached my input file.
Benzene_Ba.dat (1.6 KB)

Thanks for the report. This is a bug in Psi4. I’ll try to have it fixed soon and report back.

1 Like

I think there is a problem with the basis set that you specified for Ba. Judging from the GENECP name, I assume you intended to specify both an effective core potential for inner-shell electrons and a valence basis set for the outer-shell ones. However, your input specifies a valence basis set but no ECP.

As a result, Psi4 sees only 12 basis functions centered on Ba, and that’s not enough occupied orbitals to place all electrons of Ba2+. I think this might be the source of the error.

For an example how to specify a user-defined ECP, please see the Psi4 definition of the def2-svp basis set here. Note that Ba is represented twice in that file, first with the valence basis set and then with an ECP (look for BA-ECP).

Hope this helps!

2 Likes

Konrad’s diagnosis was spot on. The most that Psi can do is give you a better error message. And in 1.8, it will.

1 Like

Sorry for late reply, and thank you all for the suggestion. I created the file according to the suggestion, I attached below (Input 1 & input 2). It again showing an error:
“Fatal Error: BasisSet contains ECP shells but libecpint addon not enabled. Re- !compile with -D ENABLE_ecpint=ON.”
And when i exclude Ba-ECP portion from input file (input 2), it calculates sapt0 successfully. What mistake I did in input 1 file. How to use Ba-ECP portion of basis set?
And also how to assign multiple basis set for heavy metals?
input1.dat (2.4 KB)
input2.dat (1.8 KB)

How did you install Psi4? Did you get it from conda? Did you compile it yourself? We need to know exactly what you did.

I installed new version of psi4 using conda (linux) by following given instruction in “Conda Binary distribution – Quick installation”. Also I created Scratch folder as mention.

Thanks. I’ve notified our build specialist, @loriab, who can provide more detailed advice.

What’s your conda list and which conda python psi4, please? Either v1.6 or v1.7 should have ecpint enabled, so I’d like to check your environment.

I attached the enviroment list below:
Psi4 versioin - 1.7.
Also suggest to how to enable this ecpint on linux and windows.
thankyou.

No, we need conda list and which conda python psi4. We need that to suggest how to enable libecpint.