Skip to content

[UNEXPECTED BEHAVIOR] Large memory cost in generating 3c2e integral #2973

@RHSong

Description

@RHSong

Here is my script

import numpy as np
from pyscf.pbc import gto, scf

atom = '''
Cu      0.0 0.0 0.0
Cu      0.0    , 1.8075, 1.8075
Cu      1.8075 , 0.0, 1.8075
Cu      1.8075 , 1.8075, 0.0
'''
a = np.eye(3) * 3.615

cell = gto.Cell(atom=atom, a=a, basis='cc-pvdz')
cell.verbose = 6
cell.build()
cell.max_memory = 80 * 1024

nk = [2,1,1]
tw = np.array([0.81,0.57,0.27])
kpts = cell.make_kpts(nk, scaled_center=tw)
kmf = scf.KRHF(cell, kpts).density_fit()
kmf.kernel()

I ran this code with 24 cores/96 GB mem, but it still had an OOM issue and got stuck at generating PBCint3c2e_sph. I checked the function 'gen_int3c_kernel' in pbc/df/incore.py and found that it costs a lot of memory when calculating int3c.

Also, when I make the change 'tw = np.array([0.0,0.0,0.0])' or 'tw = np.array([0.1,0.0,0.2])', the code works with no problem.

Edit: using rs_density_fit() can avoid the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions