Skip to content

Commit

Permalink
Add chelpg charges in qmmm folder. (#1)
Browse files Browse the repository at this point in the history
* Add chelpg charges in qmmm folder.

* Update chelpg.py

* Update chelpg.py

* Add unit test for chelpg, and compare with Qchem

* Add an example to calculate chelpg
  • Loading branch information
puzhichen authored Oct 25, 2023
1 parent 2fff5f3 commit 095c132
Show file tree
Hide file tree
Showing 4 changed files with 511 additions and 0 deletions.
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]
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 095c132

Please sign in to comment.