Skip to content

Commit

Permalink
Merge branch 'master' into optimize_hessian_3
Browse files Browse the repository at this point in the history
  • Loading branch information
wxj6000 authored Nov 3, 2023
2 parents d153533 + 8635711 commit 6bcc061
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
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.4'
__version__ = '0.6.5'
4 changes: 3 additions & 1 deletion gpu4pyscf/dft/numint.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,11 +451,12 @@ def nr_rks(ni, mol, grids, xc_code, dms, relativity=0, hermi=1,
else:
mo_coeff_mask = mo_coeff[idx,:]
rho = eval_rho2(mol, ao_mask, mo_coeff_mask, mo_occ, None, xctype)

t1 = log.timer_debug1('eval rho', *t0)
exc, vxc = ni.eval_xc_eff(xc_code, rho, deriv=1, xctype=xctype)[:2]
vxc = cupy.asarray(vxc, order='C')
exc = cupy.asarray(exc, order='C')
t1 = log.timer_debug1('eval vxc', *t1)
t1 = log.timer_debug1('eval vxc', *t0)
if xctype == 'LDA':
den = rho * weight
wv = weight * vxc[0]
Expand Down Expand Up @@ -729,6 +730,7 @@ def nr_rks_fxc(ni, mol, grids, xc_code, dm0=None, dms=None, relativity=0, hermi=
fxc_w = fxc[:,:,p0:p1] * weights
wv = contract('axg,xyg->ayg', rho1, fxc_w)


for i in range(nset):
if xctype == 'LDA':
vmat_tmp = ao.dot(_scale_ao(ao, wv[i]).T)
Expand Down
1 change: 0 additions & 1 deletion gpu4pyscf/grad/rks.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ def get_vxc(ni, mol, grids, xc_code, dms, relativity=0, hermi=1,

nset = len(dms)
assert nset == 1

if xctype == 'LDA':
ao_deriv = 1
else:
Expand Down
5 changes: 5 additions & 0 deletions gpu4pyscf/hessian/rks.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,11 @@ def _get_vxc_deriv2(hessobj, mo_coeff, mo_occ, max_memory):
coeff = cupy.asarray(opt.coeff)
dm0 = mf.make_rdm1(mo_coeff, mo_occ)

## transform object in sorted AO
#mo_coeff = coeff @ mo_coeff
#dm0 = coeff @ dm0
#dm0 = dm0 @ coeff.T

vmat = cupy.zeros((mol.natm,3,3,nao,nao))
ipip = cupy.zeros((3,3,nao,nao))
if xctype == 'LDA':
Expand Down

0 comments on commit 6bcc061

Please sign in to comment.