pyscf / gpu4pyscf

A plugin to use Nvidia GPU in PySCF package
GNU General Public License v3.0
117 stars 21 forks source link

Computing electrostatic potential #201

Closed JunHyeong1 closed 2 weeks ago

JunHyeong1 commented 2 weeks ago

Hi. Thanks for developing this nice code.

I am wondering whether gpu4pyscf supports computing electrostatic potential generated by atomic orbitals using cartesian grids.

Specifically, I am interested in calculating the following term, which can be computed by pyscf.df.incore.aux_e2.

image

wxj6000 commented 2 weeks ago

@JunHyeong1 We haven't implemented this function yet. But you can use other routines for this functionality. Here is the script.

import pyscf
import numpy as np
from pyscf import gto, df
from gpu4pyscf.df import int3c2e

atom = '''
O       0.0000000000    -0.0000000000     0.1174000000
H      -0.7570000000    -0.0000000000    -0.4696000000
H       0.7570000000     0.0000000000    -0.4696000000
'''

mol = pyscf.M(atom=atom)
coords = np.random.rand(10,3)

fakemol = gto.fakemol_for_charges(coords)
int3c_gpu = int3c2e.get_int3c2e(mol, fakemol)

int3c_cpu = df.incore.aux_e2(mol, fakemol)

print(np.linalg.norm(int3c_cpu - int3c_gpu.get()))
JunHyeong1 commented 2 weeks ago

@wxj6000 Thank you very much!