-
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
FYI: difference in chemical shielding calculations between gpu4pyscf and pyscf #259
Comments
@steto123 Hi Steffen, can you share the xyz file? I didn't find the large discrepancy. The difference should be less than 1e-5 ppm. And I added some checks of consistency between PySCF and GPU4PySCF for a simple molecule. |
Attached is the xyz file for acetonitrile. The structure comes from the test data of the CSESHIRE data collection. For security reasons i must rename this to .txt |
@steto123 Sorry for the delay. The inconsistency between PySCF and GPU4PySCF is due to the inconsistent setup. In your code, import pyscf
import gpu4pyscf
from gpu4pyscf import dft
from gpu4pyscf.properties.shielding import eval_shielding
mol = pyscf.M(atom=xyzin, basis='6-31g*', output=logfile)
mf = dft.RKS(mol)
mf.xc = 'b3lyp'
mf.kernel()
tensor = eval_shielding(mf)
abschirmung = tensor[0].get()+tensor[1].get()
for i in range(mol.natm):
shift = (abschirmung[i,0,0] + abschirmung[i,1,1] + abschirmung[i,2,2])/3
print(shift) |
Hello and many thanks for your help and explanations. IndexError Traceback (most recent call last) File ~/miniconda3/lib/python3.12/site-packages/gpu4pyscf/properties/shielding.py:232, in eval_shielding(mf) File ~/miniconda3/lib/python3.12/site-packages/gpu4pyscf/scf/cphf.py:43, in solve(fvind, mo_energy, mo_occ, h1, s1, max_cycle, tol, hermi, verbose, level_shift) File ~/miniconda3/lib/python3.12/site-packages/gpu4pyscf/scf/cphf.py:70, in solve_nos1(fvind, mo_energy, mo_occ, h1, max_cycle, tol, hermi, verbose, level_shift) File ~/miniconda3/lib/python3.12/site-packages/gpu4pyscf/lib/cupy_helper.py:530, in krylov(aop, b, x0, tol, max_cycle, dot, lindep, callback, hermi, verbose) File ~/miniconda3/lib/python3.12/site-packages/gpu4pyscf/scf/cphf.py:65, in solve_nos1..vind_vo(mo1) File ~/miniconda3/lib/python3.12/site-packages/gpu4pyscf/properties/shielding.py:55, in gen_vind..fx(mo1) File cupy/_core/core.pyx:1527, in cupy._core.core._ndarray_base.getitem() File cupy/_core/_routines_indexing.pyx:33, in cupy._core._routines_indexing._ndarray_getitem() File cupy/_core/_routines_indexing.pyx:410, in cupy._core._routines_indexing._view_getitem() IndexError: Index 1 is out of bounds for axis 0 with size 1 |
@steto123 Can you upload your script and xyz file? I am not able to reproduce the issue with the above code and molecules with oxygen or nitrogen. |
Hello, nmr-shift2g.ipynb.txt |
Today i have checked this on a other machine with older CUDA driver (11.6 i think) with the same result. Running well for cyclobutane and crash for acetone. |
I have updated my installation with your fixes manually and now it works. Many Thanks! |
Hello,
for your information: i found some small differences between the isotropic shieldings calculated with gpu4pyscf and pyscf (i know the experimental character of this calculations). I have shared a pdf with detailed information because my former issue was not saved here.
Is there a simple reason for this differences. Is there a mistake or error in my code?
https://acrobat.adobe.com/id/urn:aaid:sc:EU:96d4d829-8366-4887-aef5-3e6c411dc82e
Many thanks for your great work.
Steffen
The text was updated successfully, but these errors were encountered: