Replies: 11 comments
-
|
qchem uses different grids for different functionals. https://manual.q-chem.com/latest/sect_standard-quad.html |
Beta Was this translation helpful? Give feedback.
-
|
For backward compatibility it may be better to keep the current default scheme and add a new option to apply a set of settings (including (99, 590) size, pruning method, radial scheme, and grid scheme for properties) which aligns with Gaussian. |
Beta Was this translation helpful? Give feedback.
-
|
Just add some more details. The motivation is not to align with Gaussian. It is more about the accuracy. IMO, the default grids should be a safe option for most cases. I tested the grids on a diverse dataset (unfortunately, I am not able to share the data). From my tests, the energy difference between (99,590) and coarser grids can be ~0.1 kcal/mol. SG1 grids (default grids by qchem) can lead to an error more than 1 kcal/mol. Geometry optimization is even more sensitive to the grids. I guess Gaussian changes the default grids from (75,302) to (99,590) for the same reason. Using the different default grids for different functionals is tricky. We probably cannot test all the functionals on a diverse dataset. Users should choose grids for efficiency based on their applications. But we probably can support different grids for different tasks. For example, SG1 grids is used for CPHF in Gaussian by default. It usually is enough. It should be OK if we don't support it. Here is a simple example. import numpy as np
import pyscf
from pyscf import gto, dft
atom = '''
I 0.000000 0.000000 0.000000
I 2.666000 0.000000 0.000000
'''
mol = gto.M(atom=atom, basis='def2-tzvpp', verbose=4)
mf = dft.rks.RKS(mol, xc='b3lyp')
e_default = mf.kernel()
gobj = mf.nuc_grad_method()
g_default = gobj.kernel()
mf = dft.rks.RKS(mol, xc='b3lyp')
mf.grids.atom_grid = (99,590)
e_99_590 = mf.kernel()
gobj = mf.nuc_grad_method()
g_99_590 = gobj.kernel()
print('Energy diff', e_default - e_99_590)
print('Gradient diff:', np.linalg.norm(g_default - g_99_590))
# Energy diff -3.515079333737958e-05
# Gradient diff: 0.00012460487559732365 |
Beta Was this translation helpful? Give feedback.
-
Does PySCF include the contributions from the grid weight derivatives in the force calculations? |
Beta Was this translation helpful? Give feedback.
-
|
@susilehtola PySCF has the functionality to include the grid response contributions. But it is disabled by default. |
Beta Was this translation helpful? Give feedback.
-
|
I think a thorough benchmark is needed. SG1 should not give so large errors. |
Beta Was this translation helpful? Give feedback.
-
SG1 is pruned from (50,194) which is already very coarse. Here is a simple example of I2, calculated by Q-Chem 6.1. I am not sure if we are able to run over all the cases for benchmarking. But we should upgrade the default setting when it is not enough for new functionals or complex molecules. B3LYP wb97m-v |
Beta Was this translation helpful? Give feedback.
-
This is then probably the reason for the large errors of SG1 in geometry optimization; the grid was parametrized including the weight response, which is pretty much free to calculate. |
Beta Was this translation helpful? Give feedback.
-
@susilehtola Yes, if SG1 grid is generally good, we can reduce the error of SG1 in geometry optimization, probably count the grids response by default and optimize the code for efficiency. But I doubt if SG1 is accurate enough for some energy calculations. In this example, #2229 (comment) |
Beta Was this translation helpful? Give feedback.
-
|
Well yeah sure, the example is for the iodine dimer which doesn't even have a SG-1 grid that was only parametrized for H-Ar! E.g. Gaussian (where SG-1 was originally implemented) seems to default to using 78 radial points for SG-1 for I. |
Beta Was this translation helpful? Give feedback.
-
|
Making the grid an easy parameter to adjust is probably the best way to move forward. We cannot anticipate what replications of past calculations will need to be done, nor which systems will need even finer grains grids in the future. Setting the integration grid size is a pretty standard parameter across various QC softwares so it should not be a difficult adoption so long as it is documented what default is and how to change it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
@wxj6000 suggests to increase the density of DFT grids to (99, 590) as the default scheme, so as to align with the newest settings in Gaussian 16. Additionally, adding a different grids scheme for post-DFT and property calculations (such as Gradients, Hessian).
What do you think about this change? Please leave your comments.
Beta Was this translation helpful? Give feedback.
All reactions