psi4 / psi4

Open-Source Quantum Chemistry – an electronic structure package in C++ driven by Python
http://psicode.org
GNU Lesser General Public License v3.0
962 stars 445 forks source link

Cannot use high-valency basis sets #1992

Closed susilehtola closed 4 years ago

susilehtola commented 4 years ago

It appears that the basis set parser doesn't support really high-valency basis sets. For instance, Feller's aug-cc-pV10Z goes up to L=9. By this point, all the angular momentum symbols have been used up (they only go up to 8 in the Gaussian convention: S, P, D, F, G, H, I, J, K), after which the input format has to switch to explicit specification of the angular momentum L=9; this is what TCTSNBN does.

Support for the L=l format should be added to the Gaussian basis set parser to make these kinds of calculations possible in Psi4.

(Naturally, one also has to have a copy of Libint compiled to support such high angular momentum; e.g. the Fedora package is compiled with LIBINT_MAX_AM=11.)

susilehtola commented 4 years ago

Actually, in addition to the basis set parser, there's something else wrong. Namely, removing the L=9 functions from the basis, Psi4 crashes:

$ psi4 h2.in 

malloc(): corrupted top size
Aborted (core dumped)
loriab commented 4 years ago

I don't wholly trust the libint/libmints error messages to trigger when requested angmom too high. you've ruled out the libint compilation?

susilehtola commented 4 years ago

Yes, ERKALE runs with the same libint without crash.

edit: well, or at least the calculation started, but I don't know if it succeeds to do a Fock build since it is probably super slow.

susilehtola commented 4 years ago

The basis set taken from https://github.com/HPQC-LABS/AI_ENERGIES/blob/master/GENBAS is here (just change the suffix): aV10Z-FELLER_H.txt

Example input

molecule {
0 1
H
H 1 0.74
}

memory 8 gb
set basis aV10Z-FELLER
set scf_type direct
energy('scf')
hokru commented 4 years ago

I remember issues with 7ZaPa and letters. PSI4 seems to expect: SPDFGHIKLMNOPQRTUVWXYZ. (https://github.com/psi4/psi4/blob/master/psi4/src/psi4/libmints/gshell.cc#L245) So J->K and K->L for the aV10Z file, if I see it right.

susilehtola commented 4 years ago

I remember issues with 7ZaPa and letters. PSI4 seems to expect: SPDFGHIKLMNOPQRTUVWXYZ. (https://github.com/psi4/psi4/blob/master/psi4/src/psi4/libmints/gshell.cc#L245) So J->K and K->L for the aV10Z file, if I see it right.

Okay, so the Psi4 basis set format is not Gaussian'94 format...

susilehtola commented 4 years ago

OK, ERKALE calculation does work, and after changing the AM notation per @hokru 's suggestion, the Psi4 calculation also started.

I'm guessing the issue is that somewhere in the basis set parser the case of 'J' shells is not caught and this causes the segfault.

hokru commented 4 years ago

Thanks for opening the BSE issue.

It looks like the parser will pass on an angular momentum of -1 along and not complain. https://github.com/psi4/psi4/blob/master/psi4/driver/qcdb/libmintsbasissetparser.py#L129-L130 Perhaps an error and the expected order of letters can be printed instead.

susilehtola commented 4 years ago

I'll attack this in #1994 as well.

susilehtola commented 4 years ago
HF calculation for H2 at R=1.4 Å: Approach E
Psi4/aV10Z -1.1336376345119279
HelFEM -1.1336377187941578

so looks like the code is fine even at high angular momentum; the aug-cc-pV10Z basis has up to L functions in Gaussian'94 notation (M in the hitherto Psi4 notation).