Skip to content

GDF fails when range separation is disabled #2169

@pavel-po

Description

@pavel-po

PySCF version: 2.5.0 with HEAD pointing to commit d57f1d6c89c723e11a7f0933380a6139ba372554.

This example fails if range separation is disabled with mydf._prefer_ccdf = True:

import os
from pyscf.pbc import tools, gto, df, scf, dft
from pyscf.gto.basis import parse_nwchem
from pyscf.gto.basis import parse_cp2k

# Setup basis set

bsf =  {
'Ni': 'gth-dzvp-molopt-sr',
'O': 'gth-dzvp-molopt-sr',
'Nd': parse_cp2k.parse('''
Nd DZVP-MOLOPT-SR-GTH DZVP-MOLOPT-SR-GTH-q14
 1
 2 0 4 7 3 2 2 2 1
      4.69889675 -0.02694194 -0.00854110  0.01848050  0.01762687  0.00869998  0.00215610 -0.00471271 -0.49416072 -0.33163809 -0.00707320
      2.96884013  0.07797557  0.04481596 -0.20430779 -0.04803951  0.00493974  0.01279489  0.02531248 -0.40795679 -0.24624728  0.01834686
      1.62747841  0.27990008 -0.05281392  0.65806828 -0.22334394 -0.14779379 -0.09416554 -0.08564240 -0.46529017 -0.23058386 -0.03455400
      0.75818905 -0.61608224 -0.01278412 -0.17991715  0.65474377  0.07221708  0.38959945  0.26310516 -0.19463049 -0.37943734  0.14916577
      0.32014190 -0.50790968 -0.35834658 -0.11882747  0.68986843  0.13635169  0.77650752  0.28417944  0.31338794 -0.58231514  0.55171805
      0.12019590  0.28846338  0.53912847 -0.56434612 -0.05144366  0.68960915  0.48593037 -0.67045025  0.44550406 -0.50788241  0.70279553
      0.03757949 -0.44057825  0.75887684  0.39985778 -0.20061077  0.69187357  0.00919254 -0.62651147  0.19574117 -0.18762034  0.42172811
''')}

# Setup cell

cell = gto.M(
    a = '''3.92 0.0 0.0
           0.0 3.92 0.0
           0.0 0.0 3.28''',
    atom = '''Nd 1.96 1.96 1.64
              Ni 0.0 0.0 0.0
              O  0.0 1.96 0.0
              O  1.96 0.0 0.0''',
    basis = bsf,
    pseudo = 'gth-pbe',
    verbose = 7,
)

nk = [2,2,2]  # 2 k-poins for each axis
kpts = cell.make_kpts(nk)

# Setup GDF

mydf = df.GDF(cell)
mydf.auxbasis = df.aug_etb(cell, beta=3.0)
mydf.kpts = kpts
mydf._prefer_ccdf = True  # Disable RS-GDF switch
mydf._cderi_to_save = "cderi.h5"
mydf.build()

The error thrown in mydf.build():

******** <class 'pyscf.pbc.df.gdf_builder._CCGDFBuilder'> ********
mesh = [15 15 13] (2925 PWs)
ke_cutoff = 17.626088768626285
eta = 0.3573932685822581
j2c_eig_always = False
Set _CCGDFBuilder.direct_scf_tol to 2.08488e-14
make compensating basis, num shells = 26, num cGTOs = 180
chgcell.rcut 19.456718497139043
Traceback (most recent call last):
  File "/pauli-storage/pokhilko/NdNiO2_green_test/scf.py", line 49, in <module>
    mydf.build()
  File "/home/pokhilko/dev/pyscf_250/pyscf/pbc/df/df.py", line 265, in build
    self._make_j3c(self.cell, self.auxcell, None, cderi)
  File "/home/pokhilko/dev/pyscf_250/pyscf/pbc/df/df.py", line 292, in _make_j3c
    dfbuilder.make_j3c(cderi_file, j_only=j_only, dataname=self._dataname,
  File "/home/pokhilko/dev/pyscf_250/pyscf/pbc/df/rsdf_builder.py", line 897, in make_j3c
    self.build()
  File "/home/pokhilko/dev/pyscf_250/pyscf/pbc/df/gdf_builder.py", line 113, in build
    self.fused_cell, self.fuse = fuse_auxcell(auxcell, self.eta)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pokhilko/dev/pyscf_250/pyscf/pbc/df/gdf_builder.py", line 821, in fuse_auxcell
    modchg_offset[ia,l] = smooth_loc[i]
    ~~~~~~~~~~~~~^^^^^^
IndexError: index 8 is out of bounds for axis 1 with size 8

At the same time with mydf._prefer_ccdf = False, the range-separated version proceeds further, but prints a long verbose output with messages of this type:

libcint qrys_wheeler singular value n=8 i=7 b=-2.13845e-06
libcint qrys_wheeler singular value n=8 i=7 b=-2.13845e-06
libcint qrys_wheeler singular value n=8 i=7 b=-1.00747e-05
libcint qrys_wheeler singular value n=8 i=7 b=-1.17559e-05
libcint qrys_wheeler singular value n=8 i=7 b=-1.00747e-05

From my understanding, these messages can indicate to a numerical instability of the Rys algorithm.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions