fcdft 1.0.2__tar.gz → 1.1.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.
- fcdft-1.1.2/PKG-INFO +6 -0
- fcdft-1.1.2/fcdft/__init__.py +1 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/df/grad/rks.py +11 -5
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/grad/rks.py +3 -3
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/lib/dft/quadrature.c +40 -4
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/lib/fcdft_helper.c +8237 -8277
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/lib/pbe/CMakeLists.txt +3 -2
- fcdft-1.1.2/fcdft/lib/pbe/poisson.c +81 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/lib/pbe_helper.c +11666 -11691
- fcdft-1.1.2/fcdft/solvent/boundary.py +384 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/solvent/esp.py +8 -12
- fcdft-1.0.2/fcdft/solvent/pbe_grad.py → fcdft-1.1.2/fcdft/solvent/grad/pbe.py +180 -78
- fcdft-1.1.2/fcdft/solvent/ions.py +159 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/solvent/pbe.py +96 -300
- fcdft-1.1.2/fcdft/solvent/solver.py +217 -0
- fcdft-1.1.2/fcdft/tools/__init__.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/tools/molden.py +2 -1
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/wbl/rks.py +31 -23
- fcdft-1.1.2/fcdft.egg-info/PKG-INFO +6 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft.egg-info/SOURCES.txt +6 -1
- fcdft-1.0.2/PKG-INFO +0 -5
- fcdft-1.0.2/fcdft/__init__.py +0 -1
- fcdft-1.0.2/fcdft.egg-info/PKG-INFO +0 -5
- {fcdft-1.0.2 → fcdft-1.1.2}/AUTHORS +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/LICENSE +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/MANIFEST.in +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/README.md +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/df/__init__.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/df/df_jk.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/df/grad/__init__.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/df/grad/uks.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/dft/__init__.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/dft/numint.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/grad/__init__.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/grad/lifcdft.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/grad/uks.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/hessian/__init__.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/hessian/lifcdft.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/hessian/numhess.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/hessian/thermo.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/jellium/__init__.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/jellium/jellium.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/lib/CMakeLists.txt +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/lib/__init__.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/lib/dft/CMakeLists.txt +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/lib/dft/nr_numint.c +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/lib/dft/nr_numint.h +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/lib/fcdft_helper.pyx +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/lib/misc.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/lib/pbe/boundary_condition.c +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/lib/pbe/boundary_condition.h +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/lib/pbe/constant.h +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/lib/pbe_helper.pyx +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/lifcdft/__init__.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/lifcdft/lifcdft.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/solvent/__init__.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/solvent/_attach_solvent.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/solvent/calculus_helper.py +0 -0
- {fcdft-1.0.2/fcdft/tools → fcdft-1.1.2/fcdft/solvent/grad}/__init__.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/solvent/radii.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/tools/addons.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/wbl/__init__.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/wbl/abscissas.npy +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/wbl/uks.py +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft/wbl/weights.npy +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft.egg-info/dependency_links.txt +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/fcdft.egg-info/top_level.txt +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/setup.cfg +0 -0
- {fcdft-1.0.2 → fcdft-1.1.2}/setup.py +0 -0
fcdft-1.1.2/PKG-INFO
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '1.1.2'
|
|
@@ -95,7 +95,8 @@ def get_jk(mf_grad, mol=None, dm=None, hermi=0, with_j=True, with_k=True,
|
|
|
95
95
|
tmp = tmpRe + 1.0j * tmpIm
|
|
96
96
|
t2 = logger.timer_debug1 (mf_grad, "df grad einsum (P|mn') u_mi = dg_Pin", *t2)
|
|
97
97
|
rhok = get_rhok (i, p0, p1)
|
|
98
|
-
vk[i] += lib.einsum('xpoi,pok->xik', tmp, rhok)
|
|
98
|
+
# vk[i] += lib.einsum('xpoi,pok->xik', tmp, rhok)
|
|
99
|
+
vk[i] += numpy.tensordot(tmp, rhok, axes=([1,2], [0,1]))
|
|
99
100
|
t2 = logger.timer_debug1 (mf_grad, "df grad einsum D_Pim dg_Pin = v_ij", *t2)
|
|
100
101
|
rhok = tmp = None
|
|
101
102
|
int3c = None
|
|
@@ -114,7 +115,9 @@ def get_jk(mf_grad, mol=None, dm=None, hermi=0, with_j=True, with_k=True,
|
|
|
114
115
|
# dPiu C_uj -> dPij. *Not* symmetric i<->j: "i" has an occupancy
|
|
115
116
|
# factor and "j" must not.
|
|
116
117
|
max_memory = mf_grad.max_memory - lib.current_memory()[0]
|
|
117
|
-
blksize = int(min(max(max_memory * .5e6/8 / (nao*max (nocc)), 20), naux))
|
|
118
|
+
# blksize = int(min(max(max_memory * .5e6/8 / (nao*max (nocc)), 20), naux))
|
|
119
|
+
# In principe, all occupation numbers are non-zero for open quantum systems.
|
|
120
|
+
blksize = int(min(max(max_memory * .5e6/8 / (nao*nao), 20), naux))
|
|
118
121
|
rhok_oo = []
|
|
119
122
|
for i, j in product (range (nset), repeat=2):
|
|
120
123
|
tmp = numpy.empty ((naux,nocc[i],nocc[j]), numpy.complex128)
|
|
@@ -182,7 +185,8 @@ def get_jk(mf_grad, mol=None, dm=None, hermi=0, with_j=True, with_k=True,
|
|
|
182
185
|
for i, j in product (range (nset), repeat=2):
|
|
183
186
|
k = (i*nset) + j
|
|
184
187
|
l = (j*nset) + i
|
|
185
|
-
tmp = lib.einsum('pij,qji->pq', rhok_oo[k], rhok_oo[l])
|
|
188
|
+
# tmp = lib.einsum('pij,qji->pq', rhok_oo[k], rhok_oo[l])
|
|
189
|
+
tmp = numpy.tensordot(rhok_oo[k], rhok_oo[l], axes=([1,2], [2,1]))
|
|
186
190
|
vkaux[i,j] -= lib.einsum('xpq,pq->xp', int2c_e1, tmp)
|
|
187
191
|
t1 = logger.timer_debug1 (mf_grad, "df grad vj and vk aux (P'|Q) eval", *t1)
|
|
188
192
|
|
|
@@ -237,7 +241,8 @@ def get_j(mf_grad, mol=None, dm=None, hermi=0):
|
|
|
237
241
|
for shl0, shl1, nL in ao_ranges:
|
|
238
242
|
int3c = get_int3c_s1((0, nbas, 0, nbas, shl0, shl1)) # (i,j|P)
|
|
239
243
|
p0, p1 = aux_loc[shl0], aux_loc[shl1]
|
|
240
|
-
rhoj[:,p0:p1] = lib.einsum('ijp,aij->ap', int3c, dms)
|
|
244
|
+
# rhoj[:,p0:p1] = lib.einsum('ijp,aij->ap', int3c, dms)
|
|
245
|
+
rhoj[:,p0:p1] = numpy.tensordot(dms, int3c, axes=([1,2], [0,1]))
|
|
241
246
|
int3c = None
|
|
242
247
|
|
|
243
248
|
# (P|Q), (naux, naux)
|
|
@@ -250,7 +255,8 @@ def get_j(mf_grad, mol=None, dm=None, hermi=0):
|
|
|
250
255
|
for shl0, shl1, nL in ao_ranges:
|
|
251
256
|
int3c = get_int3c_ip1((0, nbas, 0, nbas, shl0, shl1))
|
|
252
257
|
p0, p1 = aux_loc[shl0], aux_loc[shl1]
|
|
253
|
-
vj += lib.einsum('xijp,ap->axij', int3c, rhoj[:,p0:p1])
|
|
258
|
+
# vj += lib.einsum('xijp,ap->axij', int3c, rhoj[:,p0:p1])
|
|
259
|
+
vj += numpy.tensordot(rhoj[:,p0:p1], int3c, axes=([1], [3]))
|
|
254
260
|
int3c = None
|
|
255
261
|
|
|
256
262
|
if mf_grad.auxbasis_response:
|
|
@@ -42,10 +42,10 @@ def grad_elec(mf_grad, mo_energy=None, mo_coeff=None, mo_occ=None, atmlst=None):
|
|
|
42
42
|
for k, ia in enumerate(atmlst):
|
|
43
43
|
p0, p1 = aoslices [ia,2:]
|
|
44
44
|
h1ao = hcore_deriv(ia)
|
|
45
|
-
de[k] += numpy.
|
|
45
|
+
de[k] += numpy.tensordot(h1ao, dm0, axes=([1,2], [0,1]))
|
|
46
46
|
# nabla was applied on bra in vhf, *2 for the contributions of nabla|ket>
|
|
47
|
-
de[k] += numpy.
|
|
48
|
-
de[k] -= numpy.
|
|
47
|
+
de[k] += numpy.tensordot(vhf[:,p0:p1], dm0[p0:p1], axes=([1,2], [0,1])) * 2
|
|
48
|
+
de[k] -= numpy.tensordot(s1[:,p0:p1], dme0[p0:p1], axes=([1,2], [0,1])) * 2
|
|
49
49
|
|
|
50
50
|
de[k] += mf_grad.extra_force(ia, locals())
|
|
51
51
|
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
#include <omp.h>
|
|
5
5
|
#include <stdio.h>
|
|
6
6
|
|
|
7
|
+
double const TWO_PI = 2.0 * M_PI;
|
|
8
|
+
|
|
7
9
|
void roots_legendre(int n, double *abscissas, double *weights){
|
|
8
10
|
double z, z1, pp, p1, p2, p3;
|
|
9
11
|
int m = (n + 1) / 2;
|
|
@@ -34,26 +36,60 @@ void roots_legendre(int n, double *abscissas, double *weights){
|
|
|
34
36
|
|
|
35
37
|
double occ_drv(double sampling, double moe_energy, double fermi, double broad, double smear) {
|
|
36
38
|
double dist = 1 / (exp((sampling - fermi)/smear) + 1);
|
|
37
|
-
return dist * broad / (pow(sampling - moe_energy, 2) + pow(broad / 2, 2)) /
|
|
39
|
+
return dist * broad / (pow(sampling - moe_energy, 2) + pow(broad / 2, 2)) / TWO_PI;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
double occ_grad_drv(double sampling, double moe_energy, double fermi, double broad, double smear) {
|
|
41
43
|
double dist = 1 / (exp((sampling - fermi)/smear) + 1);
|
|
42
|
-
return dist * (1 - dist) * broad / (pow(sampling - moe_energy, 2) + pow(broad / 2, 2)) /
|
|
44
|
+
return dist * (1 - dist) * broad / (pow(sampling - moe_energy, 2) + pow(broad / 2, 2)) / TWO_PI / smear;
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
void fermi_level_drv(double *moe_energy, double *abscissas, double *weights, double fermi, double broad, double smear, double window, int pts, int nbas, double *mo_occ, double *mo_grad) {
|
|
46
48
|
int i, n;
|
|
47
49
|
double sampling;
|
|
48
50
|
double _mo_grad = 0.0;
|
|
51
|
+
double *window_weights = (double *)malloc(sizeof(double) * pts);
|
|
52
|
+
|
|
53
|
+
#pragma omp parallel for private(n)
|
|
54
|
+
for (n = 0; n < pts; n++) {
|
|
55
|
+
window_weights[n] = window * weights[n];
|
|
56
|
+
}
|
|
57
|
+
|
|
49
58
|
#pragma omp parallel for private(n, sampling) reduction(+:_mo_grad)
|
|
50
59
|
for (i = 0; i < nbas; i++) {
|
|
51
60
|
mo_occ[i] = 0;
|
|
52
61
|
for (n = 0; n < pts; n++) {
|
|
53
62
|
sampling = abscissas[n] * window + moe_energy[i];
|
|
54
|
-
mo_occ[i] +=
|
|
55
|
-
_mo_grad +=
|
|
63
|
+
mo_occ[i] += window_weights[n] * occ_drv(sampling, moe_energy[i], fermi, broad, smear);
|
|
64
|
+
_mo_grad += window_weights[n] * occ_grad_drv(sampling, moe_energy[i], fermi, broad, smear);
|
|
56
65
|
}
|
|
57
66
|
}
|
|
58
67
|
*mo_grad = _mo_grad;
|
|
68
|
+
free(window_weights);
|
|
59
69
|
}
|
|
70
|
+
|
|
71
|
+
void occupation_drv(double *moe_energy, double *abscissas, double *weights, double fermi, double broad, double smear, double window, int pts, int nbas, double *mo_occ) {
|
|
72
|
+
int i, n;
|
|
73
|
+
double sampling;
|
|
74
|
+
#pragma omp parallel for private(n, sampling)
|
|
75
|
+
for (i = 0; i < nbas; i++) {
|
|
76
|
+
mo_occ[i] = 0;
|
|
77
|
+
for (n = 0; n < pts; n++) {
|
|
78
|
+
sampling = abscissas[n] * window + moe_energy[i];
|
|
79
|
+
mo_occ[i] += window * weights[n] * occ_drv(sampling, moe_energy[i], fermi, broad, smear);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
void occupation_grad_drv(double *moe_energy, double *abscissas, double *weights, double fermi, double broad, double smear, double window, int pts, int nbas, double *occ_grad) {
|
|
85
|
+
int i, n;
|
|
86
|
+
double sampling;
|
|
87
|
+
#pragma omp parallel for private(n, sampling)
|
|
88
|
+
for (i = 0; i < nbas; i++) {
|
|
89
|
+
occ_grad[i] = 0;
|
|
90
|
+
for (n = 0; n < pts; n++) {
|
|
91
|
+
sampling = abscissas[n] * window + moe_energy[i];
|
|
92
|
+
occ_grad[i] += window * weights[n] * occ_grad_drv(sampling, moe_energy[i], fermi, broad, smear);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|