RI worsens SCF timings

Due to the size of the systems I am investigating for a project, I am exploring the different ways to speed up SCF calculations offered by QChem. The test molecule I am using has 78 heavy atoms and 80 hydrogens, 732 electrons, and 1524 basis functions in the def2-SVP basis. Without the RI approximation and with 32 cores, an wB97M-V calculation takes 255 seconds. However, when using the RIJK-def2-SVP auxiliary basis, RI_J, and occ_RI_K, and the exact same resources, the calculation takes 639 seconds.

Any thoughts as to why this is the case would be appreciated!

$comment
  RSCF calculation
$end

$molecule
  0    1
  C    1.0467836   -8.2985168    5.8905895
  C    0.6257057   -7.8252442    4.5016173
  C    0.0194036   -8.9751064    3.6880918
  C   -0.3721602   -8.5097699    2.2753014
  C   -0.8621585   -9.6764443    1.3691693
  C   -2.1231080  -10.3984818    1.9161167
  C   -3.3543771   -9.5022918    2.0866880
  C   -1.0815700   -9.2245808   -0.1009181
  C    0.1429829   -8.5804153   -0.6812836
  C    1.4168933   -9.1155496   -0.7143705
  C    2.3741369   -8.2365990   -1.2330344
  C    1.8680991   -6.9951903   -1.6625126
  C    2.6452396   -5.8054222   -2.1948112
  C    3.9555835   -5.9022462   -2.7505738
  C    4.6892875   -7.0824108   -3.0343307
  C    5.9607014   -6.8641285   -3.5335472
  H    6.6724292   -7.6305511   -3.8098636
  S    6.2000586   -5.2211799   -3.6510194
  C    4.6742639   -4.7449867   -3.1093061
  C    4.1671686   -3.4271008   -2.9793318
  C    5.0341328   -2.2377043   -3.3045478
  C    6.0790058   -2.1885013   -4.2386688
  C    6.7955229   -0.9905626   -4.2443141
  C    6.3367795   -0.0708796   -3.3177839
  C    6.9524951    1.2772030   -3.0660207
  C    6.9323546    2.1780799   -4.3288045
  C    5.4868477    2.4250525   -4.8416905
  C    4.5672380    3.1566332   -3.8585898
  C    7.6797916    3.5211937   -4.1123254
  C    9.1908801    3.3514917   -3.8653885
  C    9.8888368    4.7155830   -3.7769838
  C   11.3917614    4.5564898   -3.5591986
  S    5.0202159   -0.7414408   -2.5083855
  C    2.8301736   -3.3273237   -2.5014769
  C    2.0620413   -2.1404111   -2.3558289
  C    0.7680154   -2.3596735   -1.8712931
  C   -0.2764099   -1.3436189   -1.6046543
  C   -1.5375338   -1.5624780   -1.0496607
  C   -2.2745654   -0.3826521   -0.8101653
  C   -1.6042487    0.7811715   -1.1943969
  C   -1.8953165    2.2190793   -0.9132715
  S   -0.7206084    3.3448210   -1.3188596
  C   -1.2839616    4.6522036   -0.4705126
  C   -0.5425708    5.9457722   -0.4950770
  C   -0.9456980    7.2202844   -0.0822511
  C    0.0104146    8.2181503   -0.3194335
  C    1.1639416    7.7563110   -0.9311192
  H    2.0170154    8.3576202   -1.2147082
  S    0.9931160    6.1089782   -1.1788551
  C   -2.4420348    4.2133131    0.2060114
  C   -3.0768382    4.9210935    1.3390118
  O   -2.5611946    5.8986215    1.8417901
  C   -4.1675370    4.2531127    2.0557277
  C   -4.3347175    4.2642342    3.5101170
  C   -3.0706665    3.8660498    4.2403658
  C   -2.3814353    5.0307359    4.9739700
  C   -3.2315045    5.3913137    6.2168690
  C   -2.7248724    6.6117240    6.9813154
  C   -0.9095093    4.6574686    5.3289512
  C   -0.0201393    4.4377165    4.0773198
  C    1.4401259    4.1659978    4.4453522
  C    2.2809916    3.9483302    3.1859584
  S   -5.8326956    3.3975481    3.9977737
  C   -6.0816759    2.8655145    2.2906467
  C   -7.4963226    2.7600644    1.7285361
  C   -8.5522534    3.7423957    2.3805389
  C   -8.4030125    5.2485756    1.9848364
  C   -7.1324986    5.9665064    2.4048397
  C  -10.0191753    3.3743395    2.0153093
  C  -10.5223651    2.0316026    2.5644468
  C  -12.0376133    1.9080229    2.3229188
  C  -12.5984916    0.6070315    2.8845638
  C   -4.8997192    3.1827803    1.4655270
  C   -4.2027999    2.3790505    0.4169399
  O   -4.6966558    1.3380253    0.0282516
  C   -2.8824552    2.8917867   -0.1351006
  S   -0.1094690    0.3001205   -1.8378266
  S    0.5872529   -3.9967890   -1.5978281
  C    2.1122238   -4.4853192   -2.1300644
  S    0.2099518   -7.0396240   -1.3256845
  H    1.4873560   -7.4505597    6.4560134
  H    1.8085968   -9.1035039    5.8090331
  H    0.1684200   -8.6835517    6.4507794
  H    1.5224663   -7.4284700    3.9768239
  H   -0.1186158   -7.0064089    4.6061996
  H   -0.8708994   -9.3626774    4.2256023
  H    0.7743404   -9.7880178    3.6030774
  H    0.5416484   -8.0698935    1.8222907
  H   -1.1352935   -7.7051250    2.3305090
  H   -0.0504014  -10.4374031    1.3478486
  H   -1.8916413  -10.8585477    2.8987311
  H   -2.3846935  -11.2326830    1.2293504
  H   -3.1561189   -8.6891401    2.8144690
  H   -4.1962690  -10.1106948    2.4783355
  H   -3.6734814   -9.0635744    1.1203927
  H   -1.9188024   -8.5002722   -0.1709255
  H   -1.3329761  -10.1147808   -0.7165557
  H    1.6655348  -10.0958269   -0.3297813
  H    3.4025882   -8.5353979   -1.2163173
  H    4.3523655   -8.0907293   -2.9269699
  H    6.3455852   -2.9828054   -4.9148467
  H    7.6388929   -0.8120870   -4.8987848
  H    7.9975731    1.0869305   -2.7502638
  H    6.4371109    1.7805892   -2.2224686
  H    7.4658538    1.6450431   -5.1474448
  H    5.0165890    1.4512321   -5.0972707
  H    5.5372512    3.0175359   -5.7809868
  H    4.4326444    2.5731258   -2.9254905
  H    3.5676859    3.2857363   -4.3236439
  H    4.9630799    4.1627713   -3.6133857
  H    7.2302168    4.0863425   -3.2684549
  H    7.5666133    4.1252033   -5.0399351
  H    9.6343239    2.7755246   -4.7075111
  H    9.3708776    2.8021594   -2.9186131
  H    9.4621601    5.3002690   -2.9332110
  H    9.7262146    5.2805409   -4.7209005
  H   11.5905351    4.0145242   -2.6102924
  H   11.8680817    5.5582240   -3.5031783
  H   11.8470598    3.9948516   -4.4028567
  H    2.4096338   -1.1511271   -2.6027503
  H   -1.9020940   -2.5432070   -0.7737157
  H   -3.2269820   -0.4196145   -0.3170248
  H   -1.8983692    7.4722098    0.3474802
  H   -0.1435004    9.2581728   -0.0641842
  H   -2.3965339    3.4447564    3.4789886
  H   -3.2538792    3.0214289    4.9404254
  H   -2.3389736    5.9159223    4.3055729
  H   -3.2778687    4.5218432    6.9091927
  H   -4.2676641    5.6234935    5.8857750
  H   -1.7240746    6.4293501    7.4195596
  H   -3.4215380    6.8299537    7.8177387
  H   -2.6858332    7.4945729    6.3091730
  H   -0.8901568    3.7518987    5.9740721
  H   -0.4515109    5.4979192    5.8862476
  H   -0.0682389    5.3444667    3.4343369
  H   -0.3539747    3.5659326    3.4844506
  H    1.5002768    3.2538592    5.0781020
  H    1.8514647    5.0277679    5.0127435
  H    1.8992459    3.0774776    2.6095444
  H    3.3356656    3.7490869    3.4681533
  H    2.2486672    4.8499946    2.5371493
  H   -7.8029267    1.7157799    1.9304348
  H   -7.4945781    2.8999146    0.6258685
  H   -8.4911335    3.6637626    3.4873958
  H   -9.2197475    5.8178488    2.4845419
  H   -8.5305730    5.3658237    0.8873262
  H   -6.9800034    5.8937716    3.5018047
  H   -7.2158301    7.0430480    2.1451979
  H   -6.2781206    5.5713185    1.8436177
  H  -10.1682749    3.4191150    0.9142015
  H  -10.6781488    4.1444844    2.4791658
  H  -10.3362941    1.9931092    3.6604286
  H   -9.9939267    1.1883685    2.0747062
  H  -12.2518389    1.9554605    1.2331620
  H  -12.5635493    2.7530498    2.8219999
  H  -12.1233286   -0.2635165    2.3868102
  H  -13.6942116    0.5698438    2.7033411
  H  -12.4200794    0.5513290    3.9796144
$end

$rem
  METHOD     wB97M-V 
  BASIS      def2-SVP
  AUX_BASIS  RIJK-def2-SVP
  RI_J       TRUE
  occ_RI_K   TRUE
  MEM_TOTAL  32000
  MEM_STATIC 2000
$end

What do you get if you use RI_K = TRUE instead of OCC_RI_K = TRUE?

RI-J + occ-RI-K benefits when with 1) large MEM_TOTAL and 2) large basis set (or precisely large ratio of number of basis function over number of occupied orbitals).

  1. Large MEM_TOTAL allows qchem to keep and reuse big integrals and intermediates, so I would recommend using as much MEM_TOTAL as available.

  2. For basis set at level of or smaller than TZ, RI-J + occ-RI-K does not benefit much or even is slower than non-RI case like what you found with def2-svp.

I tried your input with def2-TZVP/rijk-def2-TZVP and MEM_TOTAL = 150000, using 32 threads RI-J + occ-RI-K talks about half wall time of non-RI case.

1 Like

Use RI_K = TRUE instead of OCC_RI_K = TRUE will use RI-K which is much slower than occ-RI-K, so not recommended at all. We only use RI_K for virtual orbital corrections when occ-RI-K is used for SCF and post-HF method is requested (that is when the correct virtual orbital is needed).

Thank you for explaining! I was running another (much smaller) test molecule also at the def2-SVP level:

$molecule
  0   1
  Fe
  C   1   rFeC_Short
  C   1   rFeC_Short 2  a_CC_Short
  C   1   rFeC_Long  3  a_CC_LS    2 d_CL_Fe_CS_CS
  C   1   rFeC_Long  2  a_CC_LS    3 d_CL_Fe_CS_CS
  O   1   rFeO_Short 2  a_CO_Short 4 d_OS_Fe_CS_CL
  O   1   rFeO_Short 3  a_CO_Short 5 d_OS_Fe_CS_CL
  O   1   rFeO_Long  4  a_CO_Long  2 d_OL_Fe_CL_CS
  O   1   rFeO_Long  5  a_CO_Long  3 d_OL_Fe_CL_CS

  rFeC_Short    =    1.78765
  rFeO_Short    =    2.92720
  rFeC_Long     =    1.84212
  rFeO_Long     =    2.97961
  a_CC_Short    =  122.24979
  a_CC_Long     =  164.91464
  a_CC_LS       =   93.63430
  a_CO_Short    =  119.08885
  a_CO_Long     =  163.37067
  d_CL_Fe_CS_CS =   96.61375
  d_OL_Fe_CL_CS =  118.66525
  d_OS_Fe_CS_CL =   96.61375
$end

$rem
  METHOD               WB97M-V
  BASIS                def2-SVP
  AUX_BASIS            RIJK-def2-SVP
  RI_J                 TRUE
  occ_RI_K             TRUE
  SYMMETRY             FALSE
  SYM_IGNORE           TRUE
  SCF_ALGORITHM        GDM
  MAX_SCF_CYCLES       200
  MEM_STATIC           500
  THRESH               14
$end

The improvement of RI on the SCF timing (6.79 s vs 7.56 s on 32 cores), if marginal, was not negative at least. This is why I was surprised to see such a worsening for the other molecule.