forked from pyscf/gpu4pyscf
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
587 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# 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/>. | ||
|
||
import pyscf | ||
from pyscf import lib | ||
from pyscf.dft import rks | ||
lib.num_threads(8) | ||
|
||
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, basis='def2-tzvpp', max_memory=32000, output='./pyscf.log') | ||
|
||
mol.verbose = 4 | ||
mf = rks.RKS(mol, xc='B3LYP').density_fit() | ||
mf_GPU = mf.to_gpu() | ||
|
||
# Compute Energy | ||
e_dft = mf_GPU.kernel() | ||
print(f"total energy = {e_dft}") | ||
|
||
# Compute Gradient | ||
g = mf_GPU.nuc_grad_method() | ||
g.max_memory = 20000 | ||
g.auxbasis_response = True | ||
g_dft = g.kernel() | ||
|
||
# Compute Hessian | ||
h = mf_GPU.Hessian() | ||
h.auxbasis_response = 2 | ||
h_dft = h.kernel() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# 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/>. | ||
|
||
import numpy as np | ||
import pyscf | ||
from pyscf import lib, df | ||
from gpu4pyscf.dft import rks | ||
from pyscf.geomopt.geometric_solver import optimize | ||
lib.num_threads(8) | ||
|
||
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, basis='def2-tzvpp', verbose=0) | ||
|
||
mf = rks.RKS(mol, xc='HYB_GGA_XC_B3LYP').density_fit() | ||
mf = mf.PCM() | ||
mf.verbose = 3 | ||
mf.grids.atom_grid = (99,590) | ||
mf.small_rho_cutoff = 1e-10 | ||
mf.with_solvent.lebedev_order = 29 # 302 Lebedev grids | ||
mf.with_solvent.method = 'C-PCM' | ||
mf.with_solvent.eps = 78.3553 | ||
|
||
mol_eq = optimize(mf, maxsteps=20) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.