Problem with diatomic molecules where both atoms have orbitals different than s #2
I think I found a problem with such setup. For example for N2 molecule, with the following configuration:
the given result is:
This is with the fix of the bug I previously signaled.
According to some paper I was looking into, the Hartree-Fock limit for N2 is -108.994.
I am comparing your results with a program I've written. It has different basis sets than yours but the values are quite similar. I too have issues with diatomic molecules for this kind of configuration. It works nicely for example for H2O or any diatomic molecule I tried that has a hydrogen in it, but fails once I put two atoms with both more than s orbitals.
I'm using recurrence relations (I think they are called Hamilton & Schaefer) to solve the integrals, for this described case I could spot different terms in both the nuclear matrix and in electron-electron integrals than given by your program. Most of the values are basically identical, but some come out differently.
It doesn't mean yours are wrong since I am also getting bad results for such molecules, but it seems that I'm getting results closer to the expected value, for example for the above molecule I get -113.677. Still wrong :(
The text was updated successfully, but these errors were encountered:
As a help to diagnose this, I just compared with the values my program gives for N2, the overlap and kinetic matrices are basically identical, despite the different methods of calculating them, so I suppose the problems originate elsewhere. I'll let you know if I found more about this.
For the core matrix, I found only one difference - it comes out from the nuclear matrix, since the kinetic matrix is ok. I don't know which one is correct (they could be both wrong), the matrix element corresponding to a px orbital from one N and the px orbital from the other N comes out different, all other matrix values seem to match. There are also electron-electron integral differences :(
I have calculated N2 using the geometry as you described above in Gaussian; the result with a STO-3G basis set is -107.50 a.u.; which is within the HF limit as you mentioned above. HFCXX indeed gives -144.20 a.u., which is clearly wrong. Interestingly, also PyQuante is off with a value of -149.46 a.u.
I am still in the dark where the problem originates from.
I make a mistake with PyQuante; I now get -106.82 a.u. for the total energy (yay!). That number is correct.
Furthermore, PyQuante gives
So I probably have some error in my code or in my definition for the basis set.
For reproduction of the PyQuante calculation, see below:
By the way, by looking at your code it seems that you use some code similar with the one discussed here: http://chemistry.stackexchange.com/questions/40958/computing-two-electron-integrals-with-an-sto-3g-basis-set There is an errata here: http://spider.shef.ac.uk/ It's unlikely that you have that mistake, but it's worth a try...
Here is more info about the bug: I simply forced
I tried replacing the Boys functions calculations with mine with the same result, so it's not originating from Boys/Fgamma implementation. Anyway, I think I can rely on your code for e-e integrals values to check against mine.
Now I have more info. I used your program to check the electron-electron integrals results from my program. Now I get basically identical results for the N2 molecule. I had a nasty bug in the electron transfer relation implementation combined with a mistake in the way I stored integral computation results :(
So the issue with the N2 molecule in your program is certain to originate only from the nuclear matrix computation.
OK; it turned out to be a really stupid mistake. See:
That line had
@aromanro : I am very grateful that you found this mistake. Many thanks again!