Skip to content

Commit

Permalink
Merge branch 'master' into optimize_hessian_2
Browse files Browse the repository at this point in the history
  • Loading branch information
wxj6000 authored Oct 26, 2023
2 parents dd94ea0 + 891ef81 commit 8bf8b05
Show file tree
Hide file tree
Showing 6 changed files with 514 additions and 1 deletion.
39 changes: 39 additions & 0 deletions examples/15-chelpg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 2023 The GPU4PySCF Authors. All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from pyscf import gto
from gpu4pyscf.dft import rks
from gpu4pyscf.qmmm import chelpg


mol = gto.Mole()
mol.verbose = 0
mol.output = None
mol.atom = [
[1 , (1. , 0. , 0.000)],
[1 , (0. , 1. , 0.000)],
[1 , (0. , -1.517 , 1.177)],
[1 , (0. , 1.517 , 1.177)] ]
mol.basis = '631g'
mol.unit = 'B'
mol.build()
mol.verbose = 6

xc = 'b3lyp'
mf = rks.RKS(mol, xc=xc)
mf.grids.level = 5
mf.kernel()
q = chelpg.eval_chelpg_layer_gpu(mf)
print(q) # [ 0.04402311 0.11333945 -0.25767919 0.10031663]
2 changes: 1 addition & 1 deletion gpu4pyscf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from . import lib, grad, hessian, solvent, scf, dft
__version__ = '0.6.3'
__version__ = '0.6.4'
2 changes: 2 additions & 0 deletions gpu4pyscf/df/int3c2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,7 @@ def get_int3c2e_ip1_vjk(intopt, rhoj, rhok, dm0_tag, aoslices, with_k=True, omeg
vk1_ao += contract('xpio,pki->xiko', int3c_ip1_occ, rhok0_slice)
vk1 += contract('xiko,ia->axko', vk1_ao, ao2atom)
count += 1

return vj1_buf, vk1_buf, vj1, vk1

def get_int3c2e_ip2_vjk(intopt, rhoj, rhok, dm0_tag, auxslices, with_k=True, omega=None):
Expand Down Expand Up @@ -822,6 +823,7 @@ def get_int3c2e_ip1_wjk(intopt, dm0_tag, with_k=True, omega=None):
naux_sph = len(intopt.sph_aux_idx)
orbo = cupy.asarray(dm0_tag.occ_coeff, order='C')
nocc = orbo.shape[1]

wj = cupy.zeros([nao_sph,naux_sph,3])
avail_mem = get_avail_mem()
use_gpu_memory = True
Expand Down
16 changes: 16 additions & 0 deletions gpu4pyscf/qmmm/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2023 The GPU4PySCF Authors. All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from gpu4pyscf.qmmm import chelpg
Loading

0 comments on commit 8bf8b05

Please sign in to comment.