MolSSI-BSE / basis_set_exchange

A repository for quantum chemistry basis sets
https://molssi-bse.github.io/basis_set_exchange/
BSD 3-Clause "New" or "Revised" License
155 stars 46 forks source link

Psi4 angular momentum notation wrong #121

Closed susilehtola closed 4 years ago

susilehtola commented 4 years ago

It turns out that the angular momentum notation in Psi4 basis set format differs from Gaussian'94 format: L=7 is J in Gaussian'94 but K in Psi4; however, Psi4 format in BSE uses the former notation. See https://github.com/psi4/psi4/blob/master/psi4/src/psi4/libmints/gshell.cc#L245

(More discussion in https://github.com/psi4/psi4/issues/1992)

loriab commented 4 years ago

What a mess. Psi4 can either comply with Gaussian and include J since we use .gbs (+spherical/cartesian, but at least it's clear whether that is present or absent) or with everyone else, including all past BSE downloads, and skip J. And without seeking patterns in a gbs file of skipped letters and trying to judge intentions vs conventions, the psi4 parser could guess wrong.

susilehtola commented 4 years ago

Given that L=7 is pretty much a fringe case: 8Z for first period, 7Z for second and third period, 6Z for transition metals and 5Z for post-lanthanides, and since the basis set formats are otherwise almost inseparable, my preference would be to fix the issue in Psi4 (and qcdb). Any backward incompatibilities are easy to see, since changing L=7 from K to J will result in a gap in the basis set, which can trigger an error.

The alternative choice would of course be to change the Psi4 and Gaussian backends so that functions for L>=7 are always given out with the explicit angular momentum notation, which eliminates all inconsistencies.

loriab commented 4 years ago

L=7 starts showing up in Dunning 6Z fitting bases and 7zapa orbital basis.

@jturney

gbs file past psi future A (hik) future B (hijk) future C (either)
IK file am 6, 7 runs runs protests protests
IJ file am 6, -1 segfaults protests (https://github.com/psi4/psi4/pull/1994) runs protests
L=7 file does not parse runs (https://github.com/psi4/psi4/pull/1994) runs (https://github.com/psi4/psi4/pull/1994) runs (https://github.com/psi4/psi4/pull/1994)

IK file

IJ file

loriab commented 4 years ago

Psi4 requesting BSE write out L= for >=7. After the above PR, we'll be able to read all three types (L=, HIJ, HIK) provided J or K comes after I, but explicit L= preferred. This change will break ppl using a new BSE download (L=) on an old psi4 (HIK only). But that's a cleaner break (can't parse L=) than what old psi does with HIJ (set am=-1 and segfault).

bennybp commented 4 years ago

Here is aug-cc-pv7z for Ne. Is this what you are looking for?

spherical

!----------------------------------------------------------------------
! Basis Set Exchange
! Version v0.8.12+26.gd655a887.dirty
! https://www.basissetexchange.org
!----------------------------------------------------------------------
!   Basis set: aug-cc-pV7Z
! Description: aug-cc-pV7Z
!        Role: orbital
!     Version: 0  (Data from the original Basis Set Exchange)
!----------------------------------------------------------------------

****
Ne     0
S   18   1.00
2636740.00000000             0.000001440000
 394695.00000000             0.000011220000
  89814.20000000             0.000058990000
  25439.50000000             0.000249480000
   8292.48000000             0.000910340000
   2991.77000000             0.002970990000
   1166.58000000             0.008836340000
    483.92700000             0.024128060000
    211.04900000             0.059888510000
     95.96840000             0.130974150000
     45.17840000             0.238356210000
     21.88590000             0.324182820000
     10.83230000             0.264520520000
      5.38014000             0.090492150000
      2.43637000             0.007440550000
      1.11925000             0.000920980000
      0.50669700             0.000367010000
      0.22345000             0.000054930000
S   18   1.00
2636740.00000000            -0.000000340000
 394695.00000000            -0.000002630000
  89814.20000000            -0.000013860000
  25439.50000000            -0.000058570000
   8292.48000000            -0.000214200000
   2991.77000000            -0.000699200000
   1166.58000000            -0.002094490000
    483.92700000            -0.005769250000
    211.04900000            -0.014722180000
     95.96840000            -0.033720660000
     45.17840000            -0.068187320000
     21.88590000            -0.112897020000
     10.83230000            -0.135574070000
      5.38014000            -0.035597710000
      2.43637000             0.237542910000
      1.11925000             0.458344790000
      0.50669700             0.370962150000
      0.22345000             0.087667750000
S   1   1.00
     10.83230000             1.000000000000
S   1   1.00
      5.38014000             1.000000000000
S   1   1.00
      2.43637000             1.000000000000
S   1   1.00
      1.11925000             1.000000000000
S   1   1.00
      0.50669700             1.000000000000
S   1   1.00
      0.22345000             1.000000000000
S   1   1.00
      0.10115800             1.000000000000
P   12   1.00
   2081.84000000             0.000035900000
    494.12400000             0.000316530000
    160.70800000             0.001792150000
     61.41720000             0.007579340000
     25.86760000             0.025395680000
     11.61990000             0.069519430000
      5.46353000             0.150087390000
      2.62574000             0.243800850000
      1.26106000             0.299199320000
      0.59777800             0.276037990000
      0.27813600             0.164642160000
      0.12436200             0.037328710000
P   1   1.00
      5.46353000             1.000000000000
P   1   1.00
      2.62574000             1.000000000000
P   1   1.00
      1.26106000             1.000000000000
P   1   1.00
      0.59777800             1.000000000000
P   1   1.00
      0.27813600             1.000000000000
P   1   1.00
      0.12436200             1.000000000000
P   1   1.00
      0.05786400             1.000000000000
D   1   1.00
     16.27000000             1.000000000000
D   1   1.00
      7.80882000             1.000000000000
D   1   1.00
      3.74786000             1.000000000000
D   1   1.00
      1.79879000             1.000000000000
D   1   1.00
      0.86333600             1.000000000000
D   1   1.00
      0.41436000             1.000000000000
D   1   1.00
      0.18997400             1.000000000000
F   1   1.00
     17.00780000             1.000000000000
F   1   1.00
      7.96028000             1.000000000000
F   1   1.00
      3.72569000             1.000000000000
F   1   1.00
      1.74376000             1.000000000000
F   1   1.00
      0.81614000             1.000000000000
F   1   1.00
      0.38198400             1.000000000000
G   1   1.00
     10.10510000             1.000000000000
G   1   1.00
      4.82848000             1.000000000000
G   1   1.00
      2.30718000             1.000000000000
G   1   1.00
      1.10243000             1.000000000000
G   1   1.00
      0.52677100             1.000000000000
H   1   1.00
      9.85490000             1.000000000000
H   1   1.00
      4.45959000             1.000000000000
H   1   1.00
      2.01808000             1.000000000000
H   1   1.00
      0.91323200             1.000000000000
I   1   1.00
      7.28237000             1.000000000000
I   1   1.00
      2.92594000             1.000000000000
I   1   1.00
      1.17559600             1.000000000000
L=7   1   1.00
      5.25600000             1.000000000000
L=7   1   1.00
      1.97400000             1.000000000000
****
loriab commented 4 years ago

yes, thanks! Maybe make the AM field four wide in case of fixed-width parser (psi should be content either way).

https://github.com/psi4/psi4/blob/master/psi4/share/psi4/basis/7zapa-nr.gbs#L288-L291

bennybp commented 4 years ago

Fixed in 4f1f50f81d2527d19cc626b43f826cac11b3bbde