mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2024-12-22 12:23:56 +01:00
Jastrow ee and en OK in QMC=Chem
This commit is contained in:
parent
edbe33f40f
commit
e3f99d0030
@ -19,9 +19,9 @@
|
||||
|
||||
\[
|
||||
J_{\text{eN}}(\mathbf{r},\mathbf{R}) =
|
||||
\sum_{\alpha=1}^{N_\text{nucl}} \sum_{i=1}^{N_\text{elec}} -
|
||||
\sum_{\alpha=1}^{N_\text{nucl}} \sum_{i=1}^{N_\text{elec}}
|
||||
\frac{a_{1\,\alpha}\, f_\alpha(R_{i\alpha})}{1+a_{2\,\alpha}\, f_\alpha(R_{i\alpha})} +
|
||||
\sum_{p=2}^{N_\text{ord}^a} - a_{p+1\,\alpha}\, [f_\alpha(R_{i\alpha})]^p - J_{\text{eN}}^{\infty \alpha}
|
||||
\sum_{p=2}^{N_\text{ord}^a} a_{p+1\,\alpha}\, [f_\alpha(R_{i\alpha})]^p - J_{\text{eN}}^{\infty \alpha}
|
||||
\]
|
||||
|
||||
$J_{\text{ee}}$ contains electron-electron terms:
|
||||
@ -3808,12 +3808,12 @@ integer function qmckl_compute_jastrow_champ_asymp_jasa_f(context, aord_num, typ
|
||||
|
||||
kappa_inv = 1.0d0 / rescale_factor_en(i)
|
||||
|
||||
asymp_jasa(i) = - a_vector(1,i) * kappa_inv / (1.0d0 + a_vector(2,i) * kappa_inv)
|
||||
asymp_jasa(i) = a_vector(1,i) * kappa_inv / (1.0d0 + a_vector(2,i) * kappa_inv)
|
||||
|
||||
x = kappa_inv
|
||||
do p = 2, aord_num
|
||||
x = x * kappa_inv
|
||||
asymp_jasa(i) = asymp_jasa(i) - a_vector(p+1, i) * x
|
||||
asymp_jasa(i) = asymp_jasa(i) + a_vector(p+1, i) * x
|
||||
end do
|
||||
|
||||
end do
|
||||
@ -3866,25 +3866,24 @@ import numpy as np
|
||||
|
||||
<<jastrow_data>>
|
||||
|
||||
asymp_jasa = -a_vector[0] * kappa_inv / (1.0 + a_vector[1]*kappa_inv)
|
||||
asymp_jasa = a_vector[0] * kappa_inv / (1.0 + a_vector[1]*kappa_inv)
|
||||
x = kappa_inv
|
||||
for p in range(1,aord_num):
|
||||
x = x * kappa_inv
|
||||
asymp_jasa -= a_vector[p + 1] * x
|
||||
asymp_jasa += a_vector[p + 1] * x
|
||||
print("asymp_jasa[i] : ", asymp_jasa)
|
||||
|
||||
#+end_src
|
||||
|
||||
#+RESULTS: asymp_jasa
|
||||
: asymp_jasa[i] : [1.75529774]
|
||||
: asymp_jasa[i] : [-1.75529774]
|
||||
|
||||
#+begin_src c :tangle (eval c_test)
|
||||
double asymp_jasa[2];
|
||||
rc = qmckl_get_jastrow_champ_asymp_jasa(context, asymp_jasa, type_nucl_num);
|
||||
|
||||
// calculate asymp_jasb
|
||||
printf("%e %e\n", asymp_jasa[0], 1.75529774);
|
||||
assert(fabs(1.75529774 - asymp_jasa[0]) < 1.e-8);
|
||||
printf("%e %e\n", asymp_jasa[0], -1.75529774);
|
||||
assert(fabs(-1.75529774 - asymp_jasa[0]) < 1.e-8);
|
||||
|
||||
#+end_src
|
||||
|
||||
@ -4127,12 +4126,12 @@ integer function qmckl_compute_jastrow_champ_factor_en_doc_f( &
|
||||
do i = 1, elec_num
|
||||
x = en_distance_rescaled(i, a, nw)
|
||||
|
||||
factor_en(nw) = factor_en(nw) - a_vector(1, type_nucl_vector(a)+1) * x / &
|
||||
factor_en(nw) = factor_en(nw) + a_vector(1, type_nucl_vector(a)+1) * x / &
|
||||
(1.0d0 + a_vector(2, type_nucl_vector(a)+1) * x) - asymp_jasa(type_nucl_vector(a)+1)
|
||||
|
||||
do p = 2, aord_num
|
||||
x = x * en_distance_rescaled(i, a, nw)
|
||||
factor_en(nw) = factor_en(nw) - a_vector(p + 1, type_nucl_vector(a)+1) * x
|
||||
factor_en(nw) = factor_en(nw) + a_vector(p + 1, type_nucl_vector(a)+1) * x
|
||||
end do
|
||||
|
||||
end do
|
||||
@ -4263,19 +4262,19 @@ for a in range(0,nucl_num):
|
||||
|
||||
for p in range(2,aord_num+1):
|
||||
x = x * en_distance_rescaled[a][i]
|
||||
pow_ser = pow_ser + a_vector[(p-1) + 1][type_nucl_vector[a]] * x
|
||||
pow_ser += a_vector[(p-1) + 1][type_nucl_vector[a]] * x
|
||||
|
||||
factor_en = factor_en - a_vector[0][type_nucl_vector[a]] * x \
|
||||
factor_en += a_vector[0][type_nucl_vector[a]] * x \
|
||||
/ (1.0 + a_vector[1][type_nucl_vector[a]] * x) \
|
||||
- pow_ser
|
||||
+ pow_ser
|
||||
factor_en -= asymp_jasa[type_nucl_vector[a]]
|
||||
print("factor_en :",factor_en)
|
||||
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
: asymp_jasa[i] : [1.75529774]
|
||||
: factor_en :
|
||||
: asymp_jasa[i] : [-1.75529774]
|
||||
: factor_en : 22.781375792083587
|
||||
|
||||
|
||||
#+begin_src c :tangle (eval c_test)
|
||||
@ -4286,8 +4285,8 @@ double factor_en[walk_num];
|
||||
rc = qmckl_get_jastrow_champ_factor_en(context, factor_en,walk_num);
|
||||
|
||||
// calculate factor_en
|
||||
printf("%f %f\n", factor_en[0], -22.781375792083587);
|
||||
assert(fabs(-22.781375792083587 - factor_en[0]) < 1.e-12);
|
||||
printf("%f %f\n", factor_en[0], 2.781375792083587);
|
||||
assert(fabs(22.781375792083587 - factor_en[0]) < 1.e-12);
|
||||
|
||||
#+end_src
|
||||
|
||||
@ -4547,9 +4546,9 @@ integer function qmckl_compute_jastrow_champ_factor_en_gl_f( &
|
||||
|
||||
lap3 = lap3 - 2.0d0 * a_vector(2, type_nucl_vector(a)+1) * dx(ii) * dx(ii)
|
||||
|
||||
factor_en_gl(i, ii, nw) = factor_en_gl(i, ii, nw) - a_vector(1, type_nucl_vector(a)+1) &
|
||||
factor_en_gl(i, ii, nw) = factor_en_gl(i, ii, nw) + a_vector(1, type_nucl_vector(a)+1) &
|
||||
,* dx(ii) * invden2 &
|
||||
- power_ser_g(ii)
|
||||
+ power_ser_g(ii)
|
||||
|
||||
end do
|
||||
|
||||
@ -4557,7 +4556,7 @@ integer function qmckl_compute_jastrow_champ_factor_en_gl_f( &
|
||||
lap2 = lap2 * dx(ii) * third
|
||||
lap3 = lap3 + den * dx(ii)
|
||||
lap3 = lap3 * a_vector(1, type_nucl_vector(a)+1) * invden3
|
||||
factor_en_gl(i, ii, nw) = factor_en_gl(i, ii, nw) - lap1 - lap2 - lap3
|
||||
factor_en_gl(i, ii, nw) = factor_en_gl(i, ii, nw) + lap1 + lap2 + lap3
|
||||
|
||||
end do
|
||||
end do
|
||||
@ -4738,10 +4737,10 @@ double factor_en_gl[walk_num][4][elec_num];
|
||||
rc = qmckl_get_jastrow_champ_factor_en_gl(context, &(factor_en_gl[0][0][0]),walk_num*4*elec_num);
|
||||
|
||||
// check factor_en_gl
|
||||
assert(fabs( -0.19656663796630847 - factor_en_gl[0][0][0]) < 1.e-12);
|
||||
assert(fabs( 0.3945140890522283 - factor_en_gl[0][1][0]) < 1.e-12);
|
||||
assert(fabs( -0.5082964671286118 - factor_en_gl[0][2][0]) < 1.e-12);
|
||||
assert(fabs( 1.8409460670666289 - factor_en_gl[0][3][0]) < 1.e-12);
|
||||
assert(fabs( 0.19656663796630847 - factor_en_gl[0][0][0]) < 1.e-12);
|
||||
assert(fabs( -0.3945140890522283 - factor_en_gl[0][1][0]) < 1.e-12);
|
||||
assert(fabs( 0.5082964671286118 - factor_en_gl[0][2][0]) < 1.e-12);
|
||||
assert(fabs( -1.8409460670666289 - factor_en_gl[0][3][0]) < 1.e-12);
|
||||
|
||||
#+end_src
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user