gpu4pyscf 1.0__tar.gz → 1.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gpu4pyscf-1.0/gpu4pyscf.egg-info → gpu4pyscf-1.0.2}/PKG-INFO +1 -1
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/README.md +29 -3
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/__init__.py +1 -1
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/df/df.py +7 -3
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/df/grad/rhf.py +4 -2
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/df/int3c2e.py +7 -4
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/dft/gen_grid.py +5 -8
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/dft/libxc.py +145 -48
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/dft/libxc_structs.py +133 -6
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/dft/numint.py +4 -3
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/dft/rks.py +1 -1
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/dft/uks.py +1 -1
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/drivers/dft_driver.py +119 -62
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/drivers/opt_driver.py +23 -11
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/grad/rhf.py +4 -1
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/lib/cupy_helper.py +0 -1
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/lib/cutensor.py +1 -1
- gpu4pyscf-1.0.2/gpu4pyscf/qmmm/chelpg.py +271 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/scf/hf.py +56 -12
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/scf/uhf.py +2 -4
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/solvent/_attach_solvent.py +1 -1
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2/gpu4pyscf.egg-info}/PKG-INFO +1 -1
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf.egg-info/requires.txt +1 -1
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/setup.py +1 -1
- gpu4pyscf-1.0/gpu4pyscf/qmmm/chelpg.py +0 -366
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/LICENSE +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/MANIFEST.in +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/__config__.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/cc/__init__.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/cc/ccsd_incore.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/df/__init__.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/df/cderi.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/df/df_jk.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/df/grad/__init__.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/df/grad/rks.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/df/grad/uhf.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/df/grad/uks.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/df/hessian/__init__.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/df/hessian/rhf.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/df/hessian/rks.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/df/hessian/uhf.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/df/hessian/uks.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/dft/__init__.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/dft/gks.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/dft/radi.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/dft/roks.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/dft/xc_alias.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/dft/xc_deriv.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/drivers/__init__.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/fci/__init__.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/fci/direct_spin1.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/grad/__init__.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/grad/dispersion.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/grad/rks.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/grad/uhf.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/grad/uks.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/gto/__init__.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/gto/mole.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/hessian/__init__.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/hessian/dispersion.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/hessian/rhf.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/hessian/rks.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/hessian/uhf.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/hessian/uks.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/lib/__init__.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/lib/cublas.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/lib/cusolver.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/lib/diis.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/lib/logger.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/lib/utils.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/mp/__init__.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/mp/dfmp2.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/mp/mp2.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/properties/__init__.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/properties/ir.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/properties/polarizability.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/properties/shielding.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/qmmm/__init__.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/scf/__init__.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/scf/_response_functions.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/scf/cphf.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/scf/diis.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/scf/dispersion.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/scf/ghf.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/scf/int4c2e.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/scf/rohf.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/scf/ucphf.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/solvent/__init__.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/solvent/grad/__init__.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/solvent/grad/pcm.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/solvent/grad/smd.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/solvent/grad/smd_experiment.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/solvent/hessian/__init__.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/solvent/hessian/pcm.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/solvent/hessian/smd.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/solvent/hessian/smd_experiment.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/solvent/pcm.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/solvent/smd.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf/solvent/smd_experiment.py +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf.egg-info/SOURCES.txt +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf.egg-info/dependency_links.txt +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/gpu4pyscf.egg-info/top_level.txt +0 -0
- {gpu4pyscf-1.0 → gpu4pyscf-1.0.2}/setup.cfg +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
GPU plugin for PySCF
|
|
2
2
|
====================
|
|
3
|
-
[](https://arxiv.org/abs/2404.09452)
|
|
4
3
|

|
|
5
4
|
[](https://badge.fury.io/py/gpu4pyscf-cuda11x)
|
|
6
5
|
|
|
@@ -28,9 +27,13 @@ cmake --build build/temp.gpu4pyscf -j 4
|
|
|
28
27
|
CURRENT_PATH=`pwd`
|
|
29
28
|
export PYTHONPATH="${PYTHONPATH}:${CURRENT_PATH}"
|
|
30
29
|
```
|
|
31
|
-
Then install cutensor for acceleration
|
|
30
|
+
Then install cutensor and cupy for acceleration (please switch the versions according to your nvcc version!)
|
|
32
31
|
```sh
|
|
33
|
-
pip3 install cutensor-
|
|
32
|
+
pip3 install cutensor-cu12 cupy-cuda12x
|
|
33
|
+
```
|
|
34
|
+
There shouldn't be cupy or cutensor compilation during pip install process. If you see the following warning at the beginning of a gpu4pyscf job, it implies problems with cupy and cutensor installation (likely a version mismatch, or multiple versions of same package installed).
|
|
35
|
+
```
|
|
36
|
+
<repo_path>/gpu4pyscf/lib/cutensor.py:<line_number>: UserWarning: using cupy as the tensor contraction engine.
|
|
34
37
|
```
|
|
35
38
|
|
|
36
39
|
The package also provides multiple dockerfiles in ```dockerfiles```. One can use them as references to create the compilation envrionment.
|
|
@@ -125,3 +128,26 @@ Speedup with GPU4PySCF v0.6.0 on A100-80G over Q-Chem 6.1 on 32-cores CPU (Desit
|
|
|
125
128
|
|
|
126
129
|
Find more benchmarks in [gpu4pyscf/benchmarks](https://github.com/pyscf/gpu4pyscf/tree/master/benchmarks)
|
|
127
130
|
|
|
131
|
+
References
|
|
132
|
+
---------
|
|
133
|
+
```
|
|
134
|
+
@misc{li2024introducting,
|
|
135
|
+
title={Introducing GPU-acceleration into the Python-based Simulations of Chemistry Framework},
|
|
136
|
+
author={Rui Li and Qiming Sun and Xing Zhang and Garnet Kin-Lic Chan},
|
|
137
|
+
year={2024},
|
|
138
|
+
eprint={2407.09700},
|
|
139
|
+
archivePrefix={arXiv},
|
|
140
|
+
primaryClass={physics.comp-ph},
|
|
141
|
+
url={https://arxiv.org/abs/2407.09700},
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@misc{wu2024enhancing,
|
|
145
|
+
title={Enhancing GPU-acceleration in the Python-based Simulations of Chemistry Framework},
|
|
146
|
+
author={Xiaojie Wu and Qiming Sun and Zhichen Pu and Tianze Zheng and Wenzhi Ma and Wen Yan and Xia Yu and Zhengxiao Wu and Mian Huo and Xiang Li and Weiluo Ren and Sheng Gong and Yumin Zhang and Weihao Gao},
|
|
147
|
+
year={2024},
|
|
148
|
+
eprint={2404.09452},
|
|
149
|
+
archivePrefix={arXiv},
|
|
150
|
+
primaryClass={physics.comp-ph},
|
|
151
|
+
url={https://arxiv.org/abs/2404.09452},
|
|
152
|
+
}
|
|
153
|
+
```
|
|
@@ -273,12 +273,15 @@ def cholesky_eri_gpu(intopt, mol, auxmol, cd_low, omega=None, sr_only=False):
|
|
|
273
273
|
row = intopt.ao_pairs_row[cp_ij_id] - i0
|
|
274
274
|
col = intopt.ao_pairs_col[cp_ij_id] - j0
|
|
275
275
|
|
|
276
|
-
|
|
276
|
+
ints_slices_f= cupy.empty([naoaux,len(row)], order='F')
|
|
277
|
+
ints_slices_f[:] = ints_slices[:,col,row]
|
|
278
|
+
ints_slices = None
|
|
279
|
+
|
|
277
280
|
if cd_low.tag == 'eig':
|
|
278
|
-
cderi_block = cupy.dot(cd_low.T,
|
|
281
|
+
cderi_block = cupy.dot(cd_low.T, ints_slices_f)
|
|
279
282
|
ints_slices = None
|
|
280
283
|
elif cd_low.tag == 'cd':
|
|
281
|
-
cderi_block = solve_triangular(cd_low_f,
|
|
284
|
+
cderi_block = solve_triangular(cd_low_f, ints_slices_f, lower=True, overwrite_b=True)
|
|
282
285
|
ij0, ij1 = count, count+cderi_block.shape[1]
|
|
283
286
|
count = ij1
|
|
284
287
|
if isinstance(cderi, cupy.ndarray):
|
|
@@ -288,6 +291,7 @@ def cholesky_eri_gpu(intopt, mol, auxmol, cd_low, omega=None, sr_only=False):
|
|
|
288
291
|
for i in range(naux):
|
|
289
292
|
cderi_block[i].get(out=cderi[i,ij0:ij1])
|
|
290
293
|
t1 = log.timer_debug1(f'solve {cp_ij_id} / {nq}', *t1)
|
|
294
|
+
|
|
291
295
|
if not use_gpu_memory:
|
|
292
296
|
cupy.cuda.Device().synchronize()
|
|
293
297
|
return cderi
|
|
@@ -268,8 +268,10 @@ class Gradients(rhf_grad.Gradients):
|
|
|
268
268
|
auxbasis_response = True
|
|
269
269
|
get_jk = get_jk
|
|
270
270
|
grad_elec = rhf_grad.grad_elec
|
|
271
|
-
|
|
272
|
-
|
|
271
|
+
|
|
272
|
+
def check_sanity(self):
|
|
273
|
+
assert isinstance(self.base, df.df_jk._DFHF)
|
|
274
|
+
|
|
273
275
|
def get_j(self, mol=None, dm=None, hermi=0):
|
|
274
276
|
vj, _, vjaux, _ = self.get_jk(mol, dm, with_k=False)
|
|
275
277
|
return vj, vjaux
|
|
@@ -632,15 +632,17 @@ def get_aux2atom(intopt, auxslices):
|
|
|
632
632
|
aux2atom[p0:p1,ia] = 1.0
|
|
633
633
|
return aux2atom[aux_ao_idx,:]
|
|
634
634
|
|
|
635
|
-
def get_j_int3c2e_pass1(intopt, dm0):
|
|
635
|
+
def get_j_int3c2e_pass1(intopt, dm0, sort_j=True):
|
|
636
636
|
'''
|
|
637
637
|
get rhoj pass1 for int3c2e
|
|
638
638
|
'''
|
|
639
639
|
n_dm = 1
|
|
640
640
|
|
|
641
|
-
naux = len(intopt.cart_aux_idx)
|
|
641
|
+
naux = intopt.cart_aux_loc[-1]#len(intopt.cart_aux_idx)
|
|
642
642
|
rhoj = cupy.zeros([naux])
|
|
643
643
|
coeff = intopt.coeff
|
|
644
|
+
if dm0.ndim == 3:
|
|
645
|
+
dm0 = dm0[0] + dm0[1]
|
|
644
646
|
dm_cart = coeff @ dm0 @ coeff.T
|
|
645
647
|
|
|
646
648
|
num_cp_ij = [len(log_qs) for log_qs in intopt.log_qs]
|
|
@@ -666,8 +668,9 @@ def get_j_int3c2e_pass1(intopt, dm0):
|
|
|
666
668
|
if err != 0:
|
|
667
669
|
raise RuntimeError('CUDA error in get_j_pass1')
|
|
668
670
|
|
|
669
|
-
|
|
670
|
-
|
|
671
|
+
if sort_j:
|
|
672
|
+
aux_coeff = intopt.aux_coeff
|
|
673
|
+
rhoj = cupy.dot(rhoj, aux_coeff)
|
|
671
674
|
return rhoj
|
|
672
675
|
|
|
673
676
|
def get_j_int3c2e_pass2(intopt, rhoj):
|
|
@@ -30,14 +30,15 @@ import ctypes
|
|
|
30
30
|
import numpy
|
|
31
31
|
import cupy
|
|
32
32
|
from pyscf import lib
|
|
33
|
-
from pyscf.lib import logger
|
|
34
33
|
from pyscf import gto
|
|
35
34
|
from pyscf.gto.eval_gto import BLKSIZE, NBINS, CUTOFF, make_screen_index
|
|
36
35
|
from pyscf import __config__
|
|
37
36
|
from cupyx.scipy.spatial.distance import cdist
|
|
37
|
+
from gpu4pyscf.lib import logger
|
|
38
38
|
from gpu4pyscf.dft import radi
|
|
39
39
|
from gpu4pyscf.lib.cupy_helper import load_library
|
|
40
40
|
from gpu4pyscf import __config__ as __gpu4pyscf_config__
|
|
41
|
+
|
|
41
42
|
libdft = lib.load_library('libdft')
|
|
42
43
|
libgdft = load_library('libgdft')
|
|
43
44
|
|
|
@@ -189,7 +190,7 @@ def gen_grids_partition(atm_coords, coords, a):
|
|
|
189
190
|
assert ngrids < 65535 * 16
|
|
190
191
|
|
|
191
192
|
pbecke = cupy.empty([natm, ngrids], order='C')
|
|
192
|
-
atm_coords = cupy.asarray(atm_coords, order='F')
|
|
193
|
+
#atm_coords = cupy.asarray(atm_coords, order='F')
|
|
193
194
|
err = libgdft.GDFTgen_grid_partition(
|
|
194
195
|
ctypes.cast(stream.ptr, ctypes.c_void_p),
|
|
195
196
|
ctypes.cast(pbecke.data.ptr, ctypes.c_void_p),
|
|
@@ -200,7 +201,7 @@ def gen_grids_partition(atm_coords, coords, a):
|
|
|
200
201
|
ctypes.c_int(natm)
|
|
201
202
|
)
|
|
202
203
|
if err != 0:
|
|
203
|
-
raise RuntimeError('CUDA Error')
|
|
204
|
+
raise RuntimeError('CUDA Error in grids_partition kernel')
|
|
204
205
|
return pbecke
|
|
205
206
|
|
|
206
207
|
def gen_atomic_grids(mol, atom_grid={}, radi_method=radi.gauss_chebyshev,
|
|
@@ -334,6 +335,7 @@ def get_partition(mol, atom_grids_tab,
|
|
|
334
335
|
assert radii_adjust == radi.treutler_atomic_radii_adjust
|
|
335
336
|
a = -radi.get_treutler_fac(mol, atomic_radii)
|
|
336
337
|
#a = -radi.get_becke_fac(mol, atomic_radii)
|
|
338
|
+
atm_coords = cupy.asarray(atm_coords, order='F')
|
|
337
339
|
for ia in range(mol.natm):
|
|
338
340
|
coords, vol = atom_grids_tab[mol.atom_symbol(ia)]
|
|
339
341
|
coords = coords + atm_coords[ia]
|
|
@@ -341,7 +343,6 @@ def get_partition(mol, atom_grids_tab,
|
|
|
341
343
|
weights = vol * pbecke[ia] * (1./pbecke.sum(axis=0))
|
|
342
344
|
coords_all.append(coords)
|
|
343
345
|
weights_all.append(weights)
|
|
344
|
-
|
|
345
346
|
if concat:
|
|
346
347
|
coords_all = cupy.vstack(coords_all)
|
|
347
348
|
weights_all = cupy.hstack(weights_all)
|
|
@@ -403,7 +404,6 @@ def atomic_group_grids(mol, coords):
|
|
|
403
404
|
next_node = numpy.argmin(distances_to_unvisited)
|
|
404
405
|
path.append(next_node)
|
|
405
406
|
current_node = next_node
|
|
406
|
-
|
|
407
407
|
atom_coords = cupy.asarray(atom_coords[path])
|
|
408
408
|
|
|
409
409
|
coords = cupy.asarray(coords, order='F')
|
|
@@ -420,7 +420,6 @@ def atomic_group_grids(mol, coords):
|
|
|
420
420
|
)
|
|
421
421
|
if err != 0:
|
|
422
422
|
raise RuntimeError('CUDA Error')
|
|
423
|
-
|
|
424
423
|
idx = group_ids.argsort()
|
|
425
424
|
return idx
|
|
426
425
|
|
|
@@ -505,7 +504,6 @@ class Grids(lib.StreamObject):
|
|
|
505
504
|
mol, self.atom_grid, self.radi_method, self.level, self.prune, **kwargs)
|
|
506
505
|
self.coords, self.weights = self.get_partition(
|
|
507
506
|
mol, atom_grids_tab, self.radii_adjust, self.atomic_radii, self.becke_scheme)
|
|
508
|
-
|
|
509
507
|
if self.alignment > 1:
|
|
510
508
|
padding = _padding_size(self.size, self.alignment)
|
|
511
509
|
logger.debug(self, 'Padding %d grids', padding)
|
|
@@ -514,7 +512,6 @@ class Grids(lib.StreamObject):
|
|
|
514
512
|
self.coords = cupy.vstack(
|
|
515
513
|
[self.coords, numpy.repeat([[1e4]*3], padding, axis=0)])
|
|
516
514
|
self.weights = cupy.hstack([self.weights, numpy.zeros(padding)])
|
|
517
|
-
|
|
518
515
|
if sort_grids:
|
|
519
516
|
#idx = arg_group_grids(mol, self.coords)
|
|
520
517
|
idx = atomic_group_grids(mol, self.coords)
|
|
@@ -20,8 +20,12 @@ import numpy as np
|
|
|
20
20
|
import ctypes
|
|
21
21
|
import ctypes.util
|
|
22
22
|
import cupy
|
|
23
|
+
import copy
|
|
24
|
+
from ctypes import POINTER
|
|
23
25
|
from pyscf import dft
|
|
24
|
-
from gpu4pyscf.dft.libxc_structs import xc_func_type
|
|
26
|
+
from gpu4pyscf.dft.libxc_structs import xc_func_type, xc_lda_out_params, xc_gga_out_params, xc_mgga_out_params
|
|
27
|
+
from gpu4pyscf.lib.cupy_helper import load_library
|
|
28
|
+
from gpu4pyscf.dft import libxc_structs
|
|
25
29
|
|
|
26
30
|
import site
|
|
27
31
|
path_list = [os.path.abspath(os.path.join(__file__, '..', '..', '..'))] + site.getsitepackages()
|
|
@@ -33,14 +37,44 @@ is_hybrid_xc = dft.libxc.is_hybrid_xc
|
|
|
33
37
|
test_deriv_order = dft.libxc.test_deriv_order
|
|
34
38
|
|
|
35
39
|
for path in path_list:
|
|
40
|
+
libxc_path = os.path.abspath(os.path.join(path, 'gpu4pyscf', 'lib', 'deps', 'lib'))
|
|
36
41
|
try:
|
|
37
|
-
_libxc = np.ctypeslib.load_library(
|
|
38
|
-
'libxc', os.path.abspath(os.path.join(path, 'gpu4pyscf', 'lib', 'deps', 'lib')))
|
|
42
|
+
_libxc = np.ctypeslib.load_library('libxc', libxc_path)
|
|
39
43
|
except Exception:
|
|
40
44
|
_libxc = None
|
|
45
|
+
|
|
41
46
|
if _libxc is not None:
|
|
42
47
|
break
|
|
43
48
|
|
|
49
|
+
libgdft = load_library('libgdft')
|
|
50
|
+
libgdft.GDFT_xc_lda.argtypes = (
|
|
51
|
+
ctypes.c_void_p,
|
|
52
|
+
ctypes.c_void_p,
|
|
53
|
+
ctypes.c_int,
|
|
54
|
+
ctypes.c_void_p,
|
|
55
|
+
POINTER(xc_lda_out_params),
|
|
56
|
+
POINTER(xc_lda_out_params))
|
|
57
|
+
|
|
58
|
+
libgdft.GDFT_xc_gga.argtypes = (
|
|
59
|
+
ctypes.c_void_p,
|
|
60
|
+
ctypes.c_void_p,
|
|
61
|
+
ctypes.c_int,
|
|
62
|
+
ctypes.c_void_p,
|
|
63
|
+
ctypes.c_void_p,
|
|
64
|
+
POINTER(xc_gga_out_params),
|
|
65
|
+
POINTER(xc_gga_out_params))
|
|
66
|
+
|
|
67
|
+
libgdft.GDFT_xc_mgga.argtypes = (
|
|
68
|
+
ctypes.c_void_p,
|
|
69
|
+
ctypes.c_void_p,
|
|
70
|
+
ctypes.c_int,
|
|
71
|
+
ctypes.c_void_p,
|
|
72
|
+
ctypes.c_void_p,
|
|
73
|
+
ctypes.c_void_p,
|
|
74
|
+
ctypes.c_void_p,
|
|
75
|
+
POINTER(xc_mgga_out_params),
|
|
76
|
+
POINTER(xc_mgga_out_params))
|
|
77
|
+
|
|
44
78
|
if _libxc is None:
|
|
45
79
|
import warnings
|
|
46
80
|
warnings.warn(
|
|
@@ -51,6 +85,43 @@ if _libxc is None:
|
|
|
51
85
|
`pip3 install gpu4pyscf-libxc-cuda12x`"
|
|
52
86
|
)
|
|
53
87
|
|
|
88
|
+
LDA_OUTPUT_LABELS = [
|
|
89
|
+
"zk", # 1, 1
|
|
90
|
+
"vrho", # 1, 2
|
|
91
|
+
"v2rho2", # 1, 3
|
|
92
|
+
"v3rho3", # 1, 4
|
|
93
|
+
"v4rho4" # 1, 5
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
GGA_OUTPUT_LABELS = [
|
|
97
|
+
"zk", # 1, 1
|
|
98
|
+
"vrho", "vsigma", # 2, 3
|
|
99
|
+
"v2rho2", "v2rhosigma", "v2sigma2", # 3, 6
|
|
100
|
+
"v3rho3", "v3rho2sigma", "v3rhosigma2", "v3sigma3", # 4, 10
|
|
101
|
+
"v4rho4", "v4rho3sigma", "v4rho2sigma2", "v4rhosigma3", "v4sigma4" # 5, 15
|
|
102
|
+
]
|
|
103
|
+
|
|
104
|
+
MGGA_OUTPUT_LABELS = [
|
|
105
|
+
"zk", # 1, 1
|
|
106
|
+
"vrho", "vsigma", "vlapl", "vtau", # 4, 5
|
|
107
|
+
"v2rho2", "v2rhosigma", "v2rholapl", "v2rhotau", "v2sigma2", # 10, 15
|
|
108
|
+
"v2sigmalapl", "v2sigmatau", "v2lapl2", "v2lapltau", "v2tau2",
|
|
109
|
+
"v3rho3", "v3rho2sigma", "v3rho2lapl", "v3rho2tau", "v3rhosigma2", # 20, 35
|
|
110
|
+
"v3rhosigmalapl", "v3rhosigmatau", "v3rholapl2", "v3rholapltau",
|
|
111
|
+
"v3rhotau2", "v3sigma3", "v3sigma2lapl", "v3sigma2tau",
|
|
112
|
+
"v3sigmalapl2", "v3sigmalapltau", "v3sigmatau2", "v3lapl3",
|
|
113
|
+
"v3lapl2tau", "v3lapltau2", "v3tau3",
|
|
114
|
+
"v4rho4", "v4rho3sigma", "v4rho3lapl", "v4rho3tau", "v4rho2sigma2", # 35, 70
|
|
115
|
+
"v4rho2sigmalapl", "v4rho2sigmatau", "v4rho2lapl2", "v4rho2lapltau",
|
|
116
|
+
"v4rho2tau2", "v4rhosigma3", "v4rhosigma2lapl", "v4rhosigma2tau",
|
|
117
|
+
"v4rhosigmalapl2", "v4rhosigmalapltau", "v4rhosigmatau2",
|
|
118
|
+
"v4rholapl3", "v4rholapl2tau", "v4rholapltau2", "v4rhotau3",
|
|
119
|
+
"v4sigma4", "v4sigma3lapl", "v4sigma3tau", "v4sigma2lapl2",
|
|
120
|
+
"v4sigma2lapltau", "v4sigma2tau2", "v4sigmalapl3", "v4sigmalapl2tau",
|
|
121
|
+
"v4sigmalapltau2", "v4sigmatau3", "v4lapl4", "v4lapl3tau",
|
|
122
|
+
"v4lapl2tau2", "v4lapltau3", "v4tau4"
|
|
123
|
+
]
|
|
124
|
+
|
|
54
125
|
def _check_arrays(current_arrays, fields, sizes, factor, required):
|
|
55
126
|
"""
|
|
56
127
|
A specialized function built to construct and check the sizes of arrays given to the LibXCFunctional class.
|
|
@@ -78,7 +149,6 @@ if _libxc is not None:
|
|
|
78
149
|
_libxc.xc_func_init.argtypes = (_xc_func_p, ctypes.c_int, ctypes.c_int)
|
|
79
150
|
_libxc.xc_func_end.argtypes = (_xc_func_p, )
|
|
80
151
|
_libxc.xc_func_free.argtypes = (_xc_func_p, )
|
|
81
|
-
_libxc.xc_func_alloc()
|
|
82
152
|
|
|
83
153
|
class XCfun:
|
|
84
154
|
def __init__(self, xc, spin):
|
|
@@ -100,9 +170,9 @@ class XCfun:
|
|
|
100
170
|
def __del__(self):
|
|
101
171
|
if self.xc_func is None:
|
|
102
172
|
return
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
173
|
+
if _libxc is not None:
|
|
174
|
+
_libxc.xc_func_end(self.xc_func)
|
|
175
|
+
_libxc.xc_func_free(self.xc_func)
|
|
106
176
|
|
|
107
177
|
def needs_laplacian(self):
|
|
108
178
|
return dft.libxc.needs_laplacian(self.func_id)
|
|
@@ -128,14 +198,7 @@ class XCfun:
|
|
|
128
198
|
if self._family == 'LDA':
|
|
129
199
|
input_labels = ["rho"]
|
|
130
200
|
input_num_args = 1
|
|
131
|
-
|
|
132
|
-
output_labels = [
|
|
133
|
-
"zk", # 1, 1
|
|
134
|
-
"vrho", # 1, 2
|
|
135
|
-
"v2rho2", # 1, 3
|
|
136
|
-
"v3rho3", # 1, 4
|
|
137
|
-
"v4rho4" # 1, 5
|
|
138
|
-
]
|
|
201
|
+
output_labels = LDA_OUTPUT_LABELS
|
|
139
202
|
|
|
140
203
|
# Build input args
|
|
141
204
|
output = _check_arrays(output, output_labels[0:1], xc_func_sizes, npoints, do_exc)
|
|
@@ -151,18 +214,30 @@ class XCfun:
|
|
|
151
214
|
if(isinstance(arg, cupy.ndarray)):
|
|
152
215
|
arg = ctypes.cast(arg.data.ptr, ctypes.c_void_p)
|
|
153
216
|
cuda_args.append(arg)
|
|
154
|
-
_libxc.xc_lda(*cuda_args)
|
|
217
|
+
#_libxc.xc_lda(*cuda_args)
|
|
218
|
+
|
|
219
|
+
out_params = xc_lda_out_params()
|
|
220
|
+
buf_params = xc_lda_out_params()
|
|
221
|
+
buf = copy.deepcopy(output)
|
|
222
|
+
for i, label in enumerate(output_labels):
|
|
223
|
+
if output[label] is not None:
|
|
224
|
+
setattr(buf_params, label, buf[label].data.ptr)
|
|
225
|
+
setattr(out_params, label, output[label].data.ptr)
|
|
226
|
+
stream = cupy.cuda.get_current_stream()
|
|
227
|
+
err = libgdft.GDFT_xc_lda(
|
|
228
|
+
stream.ptr,
|
|
229
|
+
self.xc_func,
|
|
230
|
+
npoints,
|
|
231
|
+
inp['rho'].data.ptr,
|
|
232
|
+
ctypes.byref(out_params),
|
|
233
|
+
ctypes.byref(buf_params)
|
|
234
|
+
)
|
|
235
|
+
if err != 0:
|
|
236
|
+
raise RuntimeError('Failed in xc_gga')
|
|
155
237
|
elif self._family == 'GGA':
|
|
156
238
|
input_labels = ["rho", "sigma"]
|
|
157
239
|
input_num_args = 2
|
|
158
|
-
|
|
159
|
-
output_labels = [
|
|
160
|
-
"zk", # 1, 1
|
|
161
|
-
"vrho", "vsigma", # 2, 3
|
|
162
|
-
"v2rho2", "v2rhosigma", "v2sigma2", # 3, 6
|
|
163
|
-
"v3rho3", "v3rho2sigma", "v3rhosigma2", "v3sigma3", # 4, 10
|
|
164
|
-
"v4rho4", "v4rho3sigma", "v4rho2sigma2", "v4rhosigma3", "v4sigma4" # 5, 15
|
|
165
|
-
]
|
|
240
|
+
output_labels = GGA_OUTPUT_LABELS
|
|
166
241
|
|
|
167
242
|
# Build input args
|
|
168
243
|
output = _check_arrays(output, output_labels[0:1], xc_func_sizes, npoints, do_exc)
|
|
@@ -178,7 +253,28 @@ class XCfun:
|
|
|
178
253
|
if(isinstance(arg, cupy.ndarray)):
|
|
179
254
|
arg = ctypes.cast(arg.data.ptr, ctypes.c_void_p)
|
|
180
255
|
cuda_args.append(arg)
|
|
181
|
-
_libxc.xc_gga(*cuda_args)
|
|
256
|
+
#_libxc.xc_gga(*cuda_args)
|
|
257
|
+
|
|
258
|
+
out_params = xc_gga_out_params()
|
|
259
|
+
buf_params = xc_gga_out_params()
|
|
260
|
+
buf = copy.deepcopy(output)
|
|
261
|
+
for i, label in enumerate(output_labels):
|
|
262
|
+
if output[label] is not None:
|
|
263
|
+
setattr(buf_params, label, buf[label].data.ptr)
|
|
264
|
+
setattr(out_params, label, output[label].data.ptr)
|
|
265
|
+
|
|
266
|
+
stream = cupy.cuda.get_current_stream()
|
|
267
|
+
err = libgdft.GDFT_xc_gga(
|
|
268
|
+
stream.ptr,
|
|
269
|
+
self.xc_func,
|
|
270
|
+
npoints,
|
|
271
|
+
inp['rho'].data.ptr,
|
|
272
|
+
inp['sigma'].data.ptr,
|
|
273
|
+
ctypes.byref(out_params),
|
|
274
|
+
ctypes.byref(buf_params)
|
|
275
|
+
)
|
|
276
|
+
if err != 0:
|
|
277
|
+
raise RuntimeError('Failed in xc_gga')
|
|
182
278
|
|
|
183
279
|
elif self._family == 'MGGA':
|
|
184
280
|
# Build input args
|
|
@@ -187,27 +283,7 @@ class XCfun:
|
|
|
187
283
|
else:
|
|
188
284
|
input_labels = ["rho", "sigma", "tau"]
|
|
189
285
|
input_num_args = 4
|
|
190
|
-
|
|
191
|
-
output_labels = [
|
|
192
|
-
"zk", # 1, 1
|
|
193
|
-
"vrho", "vsigma", "vlapl", "vtau", # 4, 5
|
|
194
|
-
"v2rho2", "v2rhosigma", "v2rholapl", "v2rhotau", "v2sigma2", # 10, 15
|
|
195
|
-
"v2sigmalapl", "v2sigmatau", "v2lapl2", "v2lapltau", "v2tau2",
|
|
196
|
-
"v3rho3", "v3rho2sigma", "v3rho2lapl", "v3rho2tau", "v3rhosigma2", # 20, 35
|
|
197
|
-
"v3rhosigmalapl", "v3rhosigmatau", "v3rholapl2", "v3rholapltau",
|
|
198
|
-
"v3rhotau2", "v3sigma3", "v3sigma2lapl", "v3sigma2tau",
|
|
199
|
-
"v3sigmalapl2", "v3sigmalapltau", "v3sigmatau2", "v3lapl3",
|
|
200
|
-
"v3lapl2tau", "v3lapltau2", "v3tau3",
|
|
201
|
-
"v4rho4", "v4rho3sigma", "v4rho3lapl", "v4rho3tau", "v4rho2sigma2", # 35, 70
|
|
202
|
-
"v4rho2sigmalapl", "v4rho2sigmatau", "v4rho2lapl2", "v4rho2lapltau",
|
|
203
|
-
"v4rho2tau2", "v4rhosigma3", "v4rhosigma2lapl", "v4rhosigma2tau",
|
|
204
|
-
"v4rhosigmalapl2", "v4rhosigmalapltau", "v4rhosigmatau2",
|
|
205
|
-
"v4rholapl3", "v4rholapl2tau", "v4rholapltau2", "v4rhotau3",
|
|
206
|
-
"v4sigma4", "v4sigma3lapl", "v4sigma3tau", "v4sigma2lapl2",
|
|
207
|
-
"v4sigma2lapltau", "v4sigma2tau2", "v4sigmalapl3", "v4sigmalapl2tau",
|
|
208
|
-
"v4sigmalapltau2", "v4sigmatau3", "v4lapl4", "v4lapl3tau",
|
|
209
|
-
"v4lapl2tau2", "v4lapltau3", "v4tau4"
|
|
210
|
-
]
|
|
286
|
+
output_labels = MGGA_OUTPUT_LABELS
|
|
211
287
|
|
|
212
288
|
# Build input args
|
|
213
289
|
output = _check_arrays(output, output_labels[0:1], xc_func_sizes, npoints, do_exc)
|
|
@@ -226,10 +302,31 @@ class XCfun:
|
|
|
226
302
|
if(isinstance(arg, cupy.ndarray)):
|
|
227
303
|
arg = ctypes.cast(arg.data.ptr, ctypes.c_void_p)
|
|
228
304
|
cuda_args.append(arg)
|
|
229
|
-
_libxc.xc_mgga(*cuda_args)
|
|
305
|
+
#_libxc.xc_mgga(*cuda_args)
|
|
306
|
+
|
|
307
|
+
out_params = xc_mgga_out_params()
|
|
308
|
+
buf_params = xc_mgga_out_params()
|
|
309
|
+
buf = copy.deepcopy(output)
|
|
310
|
+
for i, label in enumerate(output_labels):
|
|
311
|
+
if output[label] is not None:
|
|
312
|
+
setattr(buf_params, label, buf[label].data.ptr)
|
|
313
|
+
setattr(out_params, label, output[label].data.ptr)
|
|
314
|
+
stream = cupy.cuda.get_current_stream()
|
|
315
|
+
err = libgdft.GDFT_xc_mgga(
|
|
316
|
+
stream.ptr,
|
|
317
|
+
self.xc_func,
|
|
318
|
+
npoints,
|
|
319
|
+
inp['rho'].data.ptr,
|
|
320
|
+
inp['sigma'].data.ptr,
|
|
321
|
+
cupy.empty(1).data.ptr,
|
|
322
|
+
inp['tau'].data.ptr,
|
|
323
|
+
ctypes.byref(out_params),
|
|
324
|
+
ctypes.byref(buf_params)
|
|
325
|
+
)
|
|
326
|
+
if err != 0:
|
|
327
|
+
raise RuntimeError('Failed in xc_mgga')
|
|
230
328
|
else:
|
|
231
329
|
raise KeyError("Functional kind not recognized!")
|
|
232
330
|
|
|
233
331
|
return {k: v for k, v in zip(output_labels, args[2+input_num_args:]) if v is not None}
|
|
234
332
|
|
|
235
|
-
|
|
@@ -24,6 +24,14 @@ Modified source code from libXC
|
|
|
24
24
|
import ctypes
|
|
25
25
|
import numpy as np
|
|
26
26
|
|
|
27
|
+
XC_FAMILY_LDA = 1
|
|
28
|
+
XC_FAMILY_GGA = 2
|
|
29
|
+
XC_FAMILY_MGGA = 4
|
|
30
|
+
XC_FAMILY_LCA = 8
|
|
31
|
+
XC_FAMILY_OEP = 16
|
|
32
|
+
XC_FAMILY_HYB_GGA = 32
|
|
33
|
+
XC_FAMILY_HYB_MGGA= 64
|
|
34
|
+
XC_FAMILY_HYB_LDA = 128
|
|
27
35
|
|
|
28
36
|
class func_reference_type(ctypes.Structure):
|
|
29
37
|
"""
|
|
@@ -78,7 +86,7 @@ class xc_dimensions(ctypes.Structure):
|
|
|
78
86
|
("vrho", ctypes.c_int),
|
|
79
87
|
("vsigma", ctypes.c_int),
|
|
80
88
|
("vlapl", ctypes.c_int),
|
|
81
|
-
("vtau", ctypes.c_int),
|
|
89
|
+
("vtau", ctypes.c_int),
|
|
82
90
|
|
|
83
91
|
("v2rho2", ctypes.c_int),
|
|
84
92
|
("v2rhosigma", ctypes.c_int),
|
|
@@ -146,7 +154,7 @@ class xc_dimensions(ctypes.Structure):
|
|
|
146
154
|
("v4lapl3tau", ctypes.c_int),
|
|
147
155
|
("v4lapl2tau2", ctypes.c_int),
|
|
148
156
|
("v4lapltau3", ctypes.c_int),
|
|
149
|
-
("v4tau4", ctypes.c_int)
|
|
157
|
+
("v4tau4", ctypes.c_int)]
|
|
150
158
|
|
|
151
159
|
|
|
152
160
|
class xc_func_type(ctypes.Structure):
|
|
@@ -162,10 +170,9 @@ class xc_func_type(ctypes.Structure):
|
|
|
162
170
|
("mix_coef", ctypes.POINTER(ctypes.c_double)),
|
|
163
171
|
|
|
164
172
|
# Hybrids
|
|
165
|
-
("
|
|
166
|
-
("
|
|
167
|
-
("
|
|
168
|
-
("hyb_omega", ctypes.POINTER(ctypes.c_double)),
|
|
173
|
+
("cam_omega", ctypes.c_double),
|
|
174
|
+
("cam_alpha", ctypes.c_double),
|
|
175
|
+
("cam_beta", ctypes.c_double),
|
|
169
176
|
|
|
170
177
|
# VV10
|
|
171
178
|
("nlc_b", ctypes.c_double),
|
|
@@ -174,6 +181,126 @@ class xc_func_type(ctypes.Structure):
|
|
|
174
181
|
("dim", xc_dimensions),
|
|
175
182
|
|
|
176
183
|
# parameters
|
|
184
|
+
("ext_params", ctypes.POINTER(ctypes.c_double)),
|
|
177
185
|
("params", ctypes.c_void_p), # void *params;
|
|
186
|
+
|
|
178
187
|
("dens_threshold", ctypes.c_double),
|
|
188
|
+
("zeta_threshold", ctypes.c_double),
|
|
189
|
+
("sigma_threshold", ctypes.c_double),
|
|
190
|
+
("tau_threshold", ctypes.c_double)
|
|
191
|
+
]
|
|
192
|
+
|
|
193
|
+
class xc_lda_out_params(ctypes.Structure):
|
|
194
|
+
"""
|
|
195
|
+
Holds the output parameters for LDA functions
|
|
196
|
+
"""
|
|
197
|
+
_fields_ = [
|
|
198
|
+
("zk", ctypes.c_void_p),
|
|
199
|
+
("vrho", ctypes.c_void_p),
|
|
200
|
+
("v2rho2", ctypes.c_void_p),
|
|
201
|
+
("v3rho3", ctypes.c_void_p),
|
|
202
|
+
("v4rho4", ctypes.c_void_p),
|
|
203
|
+
]
|
|
204
|
+
|
|
205
|
+
class xc_gga_out_params(ctypes.Structure):
|
|
206
|
+
"""
|
|
207
|
+
Holds the output parameters for GGA functions
|
|
208
|
+
"""
|
|
209
|
+
_fields_ = [
|
|
210
|
+
("zk", ctypes.c_void_p),
|
|
211
|
+
("vrho", ctypes.c_void_p),
|
|
212
|
+
("vsigma", ctypes.c_void_p),
|
|
213
|
+
("v2rho2", ctypes.c_void_p),
|
|
214
|
+
("v2rhosigma", ctypes.c_void_p),
|
|
215
|
+
("v2sigma2", ctypes.c_void_p),
|
|
216
|
+
("v3rho3", ctypes.c_void_p),
|
|
217
|
+
("v3rho2sigma", ctypes.c_void_p),
|
|
218
|
+
("v3rhosigma2", ctypes.c_void_p),
|
|
219
|
+
("v3sigma3", ctypes.c_void_p),
|
|
220
|
+
("v4rho4", ctypes.c_void_p),
|
|
221
|
+
("v4rho3sigma", ctypes.c_void_p),
|
|
222
|
+
("v4rho2sigma2", ctypes.c_void_p),
|
|
223
|
+
("v4rhosigma3", ctypes.c_void_p),
|
|
224
|
+
("v4sigma4", ctypes.c_void_p),
|
|
225
|
+
]
|
|
226
|
+
|
|
227
|
+
class xc_mgga_out_params(ctypes.Structure):
|
|
228
|
+
"""
|
|
229
|
+
Holds the output parameters for MGGA functions
|
|
230
|
+
"""
|
|
231
|
+
_fields_ = [
|
|
232
|
+
("zk", ctypes.c_void_p),
|
|
233
|
+
|
|
234
|
+
("vrho", ctypes.c_void_p),
|
|
235
|
+
("vsigma", ctypes.c_void_p),
|
|
236
|
+
("vlapl", ctypes.c_void_p),
|
|
237
|
+
("vtau", ctypes.c_void_p),
|
|
238
|
+
|
|
239
|
+
("v2rho2", ctypes.c_void_p),
|
|
240
|
+
("v2rhosigma", ctypes.c_void_p),
|
|
241
|
+
("v2rholapl", ctypes.c_void_p),
|
|
242
|
+
("v2rhotau", ctypes.c_void_p),
|
|
243
|
+
("v2sigma2", ctypes.c_void_p),
|
|
244
|
+
("v2sigmalapl", ctypes.c_void_p),
|
|
245
|
+
("v2sigmatau", ctypes.c_void_p),
|
|
246
|
+
("v2lapl2", ctypes.c_void_p),
|
|
247
|
+
("v2lapltau", ctypes.c_void_p),
|
|
248
|
+
("v2tau2", ctypes.c_void_p),
|
|
249
|
+
|
|
250
|
+
("v3rho3", ctypes.c_void_p),
|
|
251
|
+
("v3rho2sigma", ctypes.c_void_p),
|
|
252
|
+
("v3rho2lapl", ctypes.c_void_p),
|
|
253
|
+
("v3rho2tau", ctypes.c_void_p),
|
|
254
|
+
("v3rhosigma2", ctypes.c_void_p),
|
|
255
|
+
("v3rhosigmalapl", ctypes.c_void_p),
|
|
256
|
+
("v3rhosigmatau", ctypes.c_void_p),
|
|
257
|
+
("v3rholapl2", ctypes.c_void_p),
|
|
258
|
+
("v3rholapltau", ctypes.c_void_p),
|
|
259
|
+
("v3rhotau2", ctypes.c_void_p),
|
|
260
|
+
("v3sigma3", ctypes.c_void_p),
|
|
261
|
+
("v3sigma2lapl", ctypes.c_void_p),
|
|
262
|
+
("v3sigma2tau", ctypes.c_void_p),
|
|
263
|
+
("v3sigmalapl2", ctypes.c_void_p),
|
|
264
|
+
("v3sigmalapltau", ctypes.c_void_p),
|
|
265
|
+
("v3sigmatau2", ctypes.c_void_p),
|
|
266
|
+
("v3lapl3", ctypes.c_void_p),
|
|
267
|
+
("v3lapl2tau", ctypes.c_void_p),
|
|
268
|
+
("v3lapltau2", ctypes.c_void_p),
|
|
269
|
+
("v3tau3", ctypes.c_void_p),
|
|
270
|
+
|
|
271
|
+
("v4rho4", ctypes.c_void_p),
|
|
272
|
+
("v4rho3sigma", ctypes.c_void_p),
|
|
273
|
+
("v4rho3lapl", ctypes.c_void_p),
|
|
274
|
+
("v4rho3tau", ctypes.c_void_p),
|
|
275
|
+
("v4rho2sigma2", ctypes.c_void_p),
|
|
276
|
+
("v4rho2sigmalapl", ctypes.c_void_p),
|
|
277
|
+
("v4rho2sigmatau", ctypes.c_void_p),
|
|
278
|
+
("v4rho2lapl2", ctypes.c_void_p),
|
|
279
|
+
("v4rho2lapltau", ctypes.c_void_p),
|
|
280
|
+
("v4rho2tau2", ctypes.c_void_p),
|
|
281
|
+
("v4rhosigma3", ctypes.c_void_p),
|
|
282
|
+
("v4rhosigma2lapl", ctypes.c_void_p),
|
|
283
|
+
("v4rhosigma2tau", ctypes.c_void_p),
|
|
284
|
+
("v4rhosigmalapl2", ctypes.c_void_p),
|
|
285
|
+
("v4rhosigmalapltau", ctypes.c_void_p),
|
|
286
|
+
("v4rhosigmatau2", ctypes.c_void_p),
|
|
287
|
+
("v4rholapl3", ctypes.c_void_p),
|
|
288
|
+
("v4rholapl2tau", ctypes.c_void_p),
|
|
289
|
+
("v4rholapltau2", ctypes.c_void_p),
|
|
290
|
+
("v4rhotau3", ctypes.c_void_p),
|
|
291
|
+
("v4sigma4", ctypes.c_void_p),
|
|
292
|
+
("v4sigma3lapl", ctypes.c_void_p),
|
|
293
|
+
("v4sigma3tau", ctypes.c_void_p),
|
|
294
|
+
("v4sigma2lapl2", ctypes.c_void_p),
|
|
295
|
+
("v4sigma2lapltau", ctypes.c_void_p),
|
|
296
|
+
("v4sigma2tau2", ctypes.c_void_p),
|
|
297
|
+
("v4sigmalapl3", ctypes.c_void_p),
|
|
298
|
+
("v4sigmalapl2tau", ctypes.c_void_p),
|
|
299
|
+
("v4sigmalapltau2", ctypes.c_void_p),
|
|
300
|
+
("v4sigmatau3", ctypes.c_void_p),
|
|
301
|
+
("v4lapl4", ctypes.c_void_p),
|
|
302
|
+
("v4lapl3tau", ctypes.c_void_p),
|
|
303
|
+
("v4lapl2tau2", ctypes.c_void_p),
|
|
304
|
+
("v4lapltau3", ctypes.c_void_p),
|
|
305
|
+
("v4tau4", ctypes.c_void_p),
|
|
179
306
|
]
|