mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2024-08-17 10:51:44 +02:00
Test added for een_rescale_n_deriv_e.
This commit is contained in:
parent
06c02101e4
commit
e4beaff674
@ -4094,6 +4094,14 @@ for i in range(elec_num):
|
|||||||
for a in range(nucl_num):
|
for a in range(nucl_num):
|
||||||
elnuc_dist[i, a] = np.linalg.norm(elec_coord[i] - nucl_coord[:,a])
|
elnuc_dist[i, a] = np.linalg.norm(elec_coord[i] - nucl_coord[:,a])
|
||||||
|
|
||||||
|
elnuc_dist_deriv_e = np.zeros(shape=(4, elec_num, nucl_num),dtype=float)
|
||||||
|
for a in range(nucl_num):
|
||||||
|
for i in range(elec_num):
|
||||||
|
rij_inv = 1.0 / elnuc_dist[i, a]
|
||||||
|
for ii in range(3):
|
||||||
|
elnuc_dist_deriv_e[ii, i, a] = (elec_coord[i][ii] - nucl_coord[ii][a]) * rij_inv
|
||||||
|
elnuc_dist_deriv_e[3, i, a] = 2.0 * rij_inv
|
||||||
|
|
||||||
kappa = 1.0
|
kappa = 1.0
|
||||||
|
|
||||||
een_rescaled_n = np.zeros(shape=(nucl_num, elec_num, cord_num + 1), dtype=float)
|
een_rescaled_n = np.zeros(shape=(nucl_num, elec_num, cord_num + 1), dtype=float)
|
||||||
@ -4108,21 +4116,36 @@ for l in range(2,cord_num+1):
|
|||||||
for i in range(elec_num):
|
for i in range(elec_num):
|
||||||
een_rescaled_n[a, i, l] = een_rescaled_n[a, i, l - 1] * een_rescaled_n[a, i, 1]
|
een_rescaled_n[a, i, l] = een_rescaled_n[a, i, l - 1] * een_rescaled_n[a, i, 1]
|
||||||
|
|
||||||
print(" een_rescaled_n[0, 2, 1] = ",een_rescaled_n[0, 2, 1])
|
een_rescaled_n_deriv_e = np.zeros(shape=(elec_num,4,nucl_num,cord_num+1),dtype=float)
|
||||||
print(" een_rescaled_n[0, 3, 1] = ",een_rescaled_n[0, 3, 1])
|
for l in range(0,cord_num+1):
|
||||||
print(" een_rescaled_n[0, 4, 1] = ",een_rescaled_n[0, 4, 1])
|
kappa_l = -1.0 * kappa * l
|
||||||
print(" een_rescaled_n[1, 3, 2] = ",een_rescaled_n[1, 3, 2])
|
for j in range(0,elec_num):
|
||||||
print(" een_rescaled_n[1, 4, 2] = ",een_rescaled_n[1, 4, 2])
|
for a in range(0,nucl_num):
|
||||||
print(" een_rescaled_n[1, 5, 2] = ",een_rescaled_n[1, 5, 2])
|
for ii in range(0,4):
|
||||||
|
een_rescaled_n_deriv_e[j,ii,a,l] = kappa_l * elnuc_dist_deriv_e[ii,j,a]
|
||||||
|
een_rescaled_n_deriv_e[j,3,a,l] = een_rescaled_n_deriv_e[j,3,a,l] + \
|
||||||
|
een_rescaled_n_deriv_e[j,0,a,l] * een_rescaled_n_deriv_e[j,0,a,l] + \
|
||||||
|
een_rescaled_n_deriv_e[j,1,a,l] * een_rescaled_n_deriv_e[j,1,a,l] + \
|
||||||
|
een_rescaled_n_deriv_e[j,2,a,l] * een_rescaled_n_deriv_e[j,2,a,l]
|
||||||
|
|
||||||
|
for ii in range(0,4):
|
||||||
|
een_rescaled_n_deriv_e[j,ii,a,l] = een_rescaled_n_deriv_e[j,ii,a,l] * een_rescaled_n[a,j,l]
|
||||||
|
|
||||||
|
print(" een_rescaled_n_deriv_e[1, 1, 3, 1] = ",een_rescaled_n_deriv_e[2, 0, 0, 1])
|
||||||
|
print(" een_rescaled_n_deriv_e[1, 1, 4, 1] = ",een_rescaled_n_deriv_e[3, 0, 0, 1])
|
||||||
|
print(" een_rescaled_n_deriv_e[1, 1, 5, 1] = ",een_rescaled_n_deriv_e[4, 0, 0, 1])
|
||||||
|
print(" een_rescaled_n_deriv_e[2, 1, 4, 2] = ",een_rescaled_n_deriv_e[3, 0, 1, 2])
|
||||||
|
print(" een_rescaled_n_deriv_e[2, 1, 5, 2] = ",een_rescaled_n_deriv_e[4, 0, 1, 2])
|
||||||
|
print(" een_rescaled_n_deriv_e[2, 1, 6, 2] = ",een_rescaled_n_deriv_e[5, 0, 1, 2])
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+RESULTS:
|
#+RESULTS:
|
||||||
: een_rescaled_n[0, 2, 1] = 0.10612983920006765
|
: een_rescaled_n_deriv_e[1, 1, 3, 1] = -0.07633444246999128
|
||||||
: een_rescaled_n[0, 3, 1] = 0.135652809635553
|
: een_rescaled_n_deriv_e[1, 1, 4, 1] = 0.00033282346259738276
|
||||||
: een_rescaled_n[0, 4, 1] = 0.023391817607642338
|
: een_rescaled_n_deriv_e[1, 1, 5, 1] = -0.004775370547333061
|
||||||
: een_rescaled_n[1, 3, 2] = 0.880957224822116
|
: een_rescaled_n_deriv_e[2, 1, 4, 2] = 0.1362654644223866
|
||||||
: een_rescaled_n[1, 4, 2] = 0.027185942659395074
|
: een_rescaled_n_deriv_e[2, 1, 5, 2] = -0.0231253431662794
|
||||||
: een_rescaled_n[1, 5, 2] = 0.01343938025140174
|
: een_rescaled_n_deriv_e[2, 1, 6, 2] = 0.001593334817691633
|
||||||
|
|
||||||
#+begin_src c :tangle (eval c_test)
|
#+begin_src c :tangle (eval c_test)
|
||||||
assert(qmckl_electron_provided(context));
|
assert(qmckl_electron_provided(context));
|
||||||
@ -4130,19 +4153,13 @@ assert(qmckl_electron_provided(context));
|
|||||||
double een_rescaled_n_deriv_e[walk_num][elec_num][4][nucl_num][(cord_num + 1)];
|
double een_rescaled_n_deriv_e[walk_num][elec_num][4][nucl_num][(cord_num + 1)];
|
||||||
rc = qmckl_get_jastrow_een_rescaled_n_deriv_e(context, &(een_rescaled_n_deriv_e[0][0][0][0][0]));
|
rc = qmckl_get_jastrow_een_rescaled_n_deriv_e(context, &(een_rescaled_n_deriv_e[0][0][0][0][0]));
|
||||||
|
|
||||||
printf(" 0 2 0 1 %10.16f\n",een_rescaled_n_deriv_e[0][2][0][0][1]);
|
|
||||||
printf(" 0 3 0 1 %10.16f\n",een_rescaled_n_deriv_e[0][3][0][0][1]);
|
|
||||||
printf(" 0 4 0 1 %10.16f\n",een_rescaled_n_deriv_e[0][4][0][0][1]);
|
|
||||||
printf(" 0 3 1 2 %10.16f\n",een_rescaled_n_deriv_e[0][3][0][1][2]);
|
|
||||||
printf(" 0 4 1 2 %10.16f\n",een_rescaled_n_deriv_e[0][4][0][1][2]);
|
|
||||||
printf(" 0 5 1 2 %10.16f\n",een_rescaled_n_deriv_e[0][5][0][1][2]);
|
|
||||||
// value of (0,2,1)
|
// value of (0,2,1)
|
||||||
//assert(fabs(een_rescaled_n_deriv_e[0][2][0][1]-0.10612983920006765) < 1.e-12);
|
assert(fabs(een_rescaled_n_deriv_e[0][2][0][0][1]+0.07633444246999128 ) < 1.e-12);
|
||||||
//assert(fabs(een_rescaled_n_deriv_e[0][3][0][1]-0.135652809635553) < 1.e-12);
|
assert(fabs(een_rescaled_n_deriv_e[0][3][0][0][1]-0.00033282346259738276) < 1.e-12);
|
||||||
//assert(fabs(een_rescaled_n_deriv_e[0][4][0][1]-0.023391817607642338) < 1.e-12);
|
assert(fabs(een_rescaled_n_deriv_e[0][4][0][0][1]+0.004775370547333061 ) < 1.e-12);
|
||||||
//assert(fabs(een_rescaled_n_deriv_e[0][3][1][2]-0.880957224822116) < 1.e-12);
|
assert(fabs(een_rescaled_n_deriv_e[0][3][0][1][2]-0.1362654644223866 ) < 1.e-12);
|
||||||
//assert(fabs(een_rescaled_n_deriv_e[0][4][1][2]-0.027185942659395074) < 1.e-12);
|
assert(fabs(een_rescaled_n_deriv_e[0][4][0][1][2]+0.0231253431662794 ) < 1.e-12);
|
||||||
//assert(fabs(een_rescaled_n_deriv_e[0][5][1][2]-0.01343938025140174) < 1.e-12);
|
assert(fabs(een_rescaled_n_deriv_e[0][5][0][1][2]-0.001593334817691633 ) < 1.e-12);
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user