-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wB97m-D3BJ #95
Comments
Yes, it is possible. There will some script to work around the xc functional names. In libXC, there is only one functional for import numpy as np
import cupy
import pyscf
from pyscf import lib
from gpu4pyscf.dft import rks, libxc
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
'''
xc = 'wb97m-v'
bas = 'def2-tzvpp'
scf_tol = 1e-10
max_scf_cycles = 50
grids_level = 5
mol = pyscf.M(atom=atom, basis=bas)
mol.verbose = 3
mf = rks.RKS(mol, xc=xc).density_fit()
# turn off nonlocal correction
mf.nlc = None
mf._numint.libxc.is_nlc = lambda x: False
mf.grids.level = grids_level
mf.grids.atom_grid = (99,590)
mf.conv_tol = scf_tol
mf.max_cycle = max_scf_cycles
e_dft = mf.kernel()
# calculate dispersion correction
from gpu4pyscf.lib import dftd3
dftd3_model = dftd3.DFTD3Dispersion(mol, xc='wb97m', version='d3bj')
e_disp = res = dftd3_model.get_dispersion()['energy']
e_tot = e_dft + e_disp
print(f"total energy = {e_tot}") |
thank you very much for the clear example! I will try it out |
Hello. I only now got around to trying this. I have used the new syntax I found in the example: https://github.com/pyscf/gpu4pyscf/blob/master/examples/01-h2o_with_dispersion.py I get an error when computing the gradient. How do I also compute the gradient with the D3bj? here is the error:
and here is my script: import numpy as np
import pyscf
from gpu4pyscf.dft import rks
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, # water molecule
basis='def2-tzvppd', # basis set
verbose=1 # control the level of print info
)
mf_GPU = rks.RKS( # restricted Kohn-Sham DFT
mol, # pyscf.gto.object
xc='wB97m-V' # xc funtionals, such as pbe0, wb97m-v, tpss,
).density_fit() # density fitting
# turn off nlc
mf_GPU.nlc = None
mf_GPU._numint.libxc.is_nlc = lambda x: False
mf_GPU.disp = 'd3bj'
# Compute Energy
e_dft = mf_GPU.kernel()
print(f"total energy = {e_dft}")
# Compute Gradient
g = mf_GPU.nuc_grad_method()
g_dft = g.kernel()
print(g_dft) Thank you |
can now be done with: mf_GPU = rks.RKS(
mol,
xc='wB97m-d3bj'
).density_fit() thank you @wxj6000 |
@sef43 Yes, PySCF v2.6 and GPU4PySCF v0.8 support |
#173 |
Hello,
is it possible to use the functional wB97m-D3BJ in gpu4pyscf?
It is wB97m-V with the VV10 replaced with D3(BJ). https://pubs.acs.org/doi/abs/10.1021/acs.jctc.8b00842
It is available in PSI4 but I would like to use PySCF for the GPU acceleration
The text was updated successfully, but these errors were encountered: