@@ -553,7 +553,7 @@ qmckl_get_single_electron_ee_distance(qmckl_context context,
553
553
"distance is a NULL pointer");
554
554
}
555
555
556
- size_t sze = ctx->electron.num * ctx->electron.walker.num;
556
+ int64_t sze = ctx->electron.num * ctx->electron.walker.num;
557
557
if (size_max < sze) {
558
558
return qmckl_failwith( context,
559
559
QMCKL_INVALID_ARG_3,
@@ -821,7 +821,7 @@ qmckl_get_single_electron_en_distance(qmckl_context context,
821
821
"distance is a NULL pointer");
822
822
}
823
823
824
- size_t sze = ctx->nucleus.num * ctx->electron.walker.num;
824
+ int64_t sze = ctx->nucleus.num * ctx->electron.walker.num;
825
825
if (size_max < sze) {
826
826
return qmckl_failwith( context,
827
827
QMCKL_INVALID_ARG_3,
@@ -2848,8 +2848,8 @@ qmckl_exit_code qmckl_provide_een_rescaled_single_e_gl(qmckl_context context)
2848
2848
| ~elec_num~ | ~int64_t~ | in | Number of electrons |
2849
2849
| ~cord_num~ | ~int64_t~ | in | Order of polynomials |
2850
2850
| ~rescale_factor_ee~ | ~double~ | in | Factor to rescale ee distances |
2851
- | ~coord~ | ~double[3]~ | in | Single electron coordinates |
2852
- | ~coord_ee~ | ~double[walk_num][3 ][elec_num]~ | in | Electron coordinates |
2851
+ | ~coord~ | ~double[walk_num][ 3]~ | in | Single electron coordinates |
2852
+ | ~coord_ee~ | ~double[3][walk_num ][elec_num]~ | in | Electron coordinates |
2853
2853
| ~single_ee_distance~ | ~double[walk_num][elec_num]~ | in | Electron-electron single distances |
2854
2854
| ~een_rescaled_single_e~ | ~double[walk_num][0:cord_num][elec_num]~ | in | Electron-electron rescaled single distances |
2855
2855
| ~een_rescaled_single_e_gl~ | ~double[walk_num][0:cord_num][elec_num][4]~ | out | Electron-electron rescaled single distances derivative |
@@ -2870,7 +2870,7 @@ integer function qmckl_compute_een_rescaled_single_e_gl_doc( &
2870
2870
integer(c_int64_t) , intent(in), value :: cord_num
2871
2871
real(c_double) , intent(in), value :: rescale_factor_ee
2872
2872
real(c_double) , intent(in) :: coord(3,walk_num)
2873
- real(c_double) , intent(in) :: coord_ee(elec_num,3, walk_num)
2873
+ real(c_double) , intent(in) :: coord_ee(elec_num,walk_num,3 )
2874
2874
real(c_double) , intent(in) :: single_ee_distance(elec_num,walk_num)
2875
2875
real(c_double) , intent(in) :: een_rescaled_single_e(elec_num,0:cord_num,walk_num)
2876
2876
real(c_double) , intent(out) :: een_rescaled_single_e_gl(4,elec_num,0:cord_num,walk_num)
@@ -2912,13 +2912,17 @@ integer function qmckl_compute_een_rescaled_single_e_gl_doc( &
2912
2912
2913
2913
do nw = 1, walk_num
2914
2914
do i = 1, elec_num
2915
+ if (i == num) cycle
2915
2916
rij_inv = 1.0d0 / single_ee_distance(i, nw)
2916
2917
do ii = 1, 3
2917
- elec_dist_gl(ii, i) = (coord(ii,nw) - coord_ee(i, ii, nw )) * rij_inv
2918
+ elec_dist_gl(ii, i) = (coord(ii, nw) - coord_ee(i, nw, ii )) * rij_inv
2918
2919
end do
2919
2920
elec_dist_gl(4, i) = 2.0d0 * rij_inv
2920
2921
end do
2921
2922
2923
+ ! print *, single_ee_distance(2, 1), elec_dist_gl(1,2)
2924
+ ! stop
2925
+
2922
2926
elec_dist_gl(:, num) = 0.0d0
2923
2927
2924
2928
do l = 1, cord_num
@@ -3033,6 +3037,13 @@ for (int elec = 0; elec < elec_num; elec++){
3033
3037
coords[1][elec][1] = new_coords[4];
3034
3038
coords[1][elec][2] = new_coords[5];
3035
3039
3040
+ //coords[0][0][elec] = new_coords[0];
3041
+ //coords[1][0][elec] = new_coords[1];
3042
+ //coords[2][0][elec] = new_coords[2];
3043
+ //coords[0][1][elec] = new_coords[3];
3044
+ //coords[1][1][elec] = new_coords[4];
3045
+ //coords[2][1][elec] = new_coords[5];
3046
+
3036
3047
rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3);
3037
3048
assert (rc == QMCKL_SUCCESS);
3038
3049
@@ -4934,7 +4945,7 @@ qmckl_exit_code qmckl_get_ee_rescaled_single_gl(qmckl_context context,
4934
4945
"Array is NULL");
4935
4946
}
4936
4947
4937
- size_t sze = 4 * ctx->electron.num * ctx->electron.walker.num;
4948
+ int64_t sze = 4 * ctx->electron.num * ctx->electron.walker.num;
4938
4949
if (size_max < sze) {
4939
4950
return qmckl_failwith( context,
4940
4951
QMCKL_INVALID_ARG_3,
@@ -5037,7 +5048,7 @@ qmckl_exit_code qmckl_provide_ee_rescaled_single_gl(qmckl_context context)
5037
5048
| ~walk_num~ | ~int64_t~ | in | Number of walkers |
5038
5049
| ~single_ee_distance~ | ~double[elec_num][walk_num]~ | in | Single electron-electron distances |
5039
5050
| ~elec_coord~ | ~double[3][walk_num][elec_num]~ | in | Electron coordinates |
5040
- | ~coord~ | ~double[3]~ | in | Single electron coordinates |
5051
+ | ~coord~ | ~double[walk_num][ 3]~ | in | Single electron coordinates |
5041
5052
| ~ee_rescaled_single_gl~ | ~double[walk_num][elec_num][4]~ | out | Electron-electron rescaled single distance derivatives |
5042
5053
|-------------------------+---------------------------------+--------+--------------------------------------------------------|
5043
5054
@@ -5055,7 +5066,7 @@ function qmckl_compute_ee_rescaled_single_gl_doc(context, num_in, &
5055
5066
integer (c_int64_t) , intent(in) , value :: walk_num
5056
5067
real (c_double ) , intent(in) :: single_ee_distance(elec_num,walk_num)
5057
5068
real (c_double ) , intent(in) :: elec_coord(elec_num,walk_num,3)
5058
- real (c_double ) , intent(in) :: coord(3)
5069
+ real (c_double ) , intent(in) :: coord(3,walk_num )
5059
5070
real (c_double ) , intent(out) :: ee_rescaled_single_gl(4,elec_num,walk_num)
5060
5071
integer(qmckl_exit_code) :: info
5061
5072
@@ -5089,7 +5100,7 @@ function qmckl_compute_ee_rescaled_single_gl_doc(context, num_in, &
5089
5100
do i = 1, elec_num
5090
5101
rij_inv = 1.0d0 / single_ee_distance(i, nw)
5091
5102
do ii = 1, 3
5092
- elel_dist_gl(ii, i) = (elec_coord(i,nw, ii) - coord(ii)) * rij_inv
5103
+ elel_dist_gl(ii, i) = (elec_coord(i,nw, ii) - coord(ii,nw )) * rij_inv
5093
5104
end do
5094
5105
elel_dist_gl(4, i) = 2.0d0 * rij_inv
5095
5106
end do
@@ -6322,6 +6333,11 @@ for (int elec = 0; elec < elec_num; elec++){
6322
6333
assert (rc == QMCKL_SUCCESS);
6323
6334
6324
6335
for (int nw = 0; nw < walk_num; nw++) {
6336
+ //printf("electron %d walk %d \n", elec, nw);
6337
+ //printf("jastrow_en_new %f\n", jastrow_en_new[nw]);
6338
+ //printf("jastrow_en_old %f\n", jastrow_en_old[nw]);
6339
+ //printf("delta_en %f\n", delta_en[nw]);
6340
+ //printf("diff %f\n", jastrow_en_new[nw] - jastrow_en_old[nw] - delta_en[nw]);
6325
6341
assert(fabs((jastrow_en_new[nw] - jastrow_en_old[nw]) - delta_en[nw]) < 1.e-12);
6326
6342
}
6327
6343
}
@@ -6458,7 +6474,7 @@ qmckl_exit_code qmckl_provide_en_rescaled_single_gl(qmckl_context context)
6458
6474
| ~rescale_factor_en~ | ~double[nucl_num]~ | in | The factors for rescaled distances |
6459
6475
| ~walk_num~ | ~int64_t~ | in | Number of walkers |
6460
6476
| ~single_en_distance~ | ~double[walk_num][nucl_num]~ | in | Single electorn distances |
6461
- | ~coord~ | ~double[3]~ | in | Single electron coordinates |
6477
+ | ~coord~ | ~double[walk_num][ 3]~ | in | Single electron coordinates |
6462
6478
| ~nucl_coord~ | ~double[3][nucl_num]~ | in | Nucleus coordinates |
6463
6479
| ~en_rescaled_single_gl~ | ~double[walk_num][nucl_num][4]~ | out | Electron-nucleus rescaled single distance derivatives |
6464
6480
|-------------------------+---------------------------------+--------+-------------------------------------------------------|
@@ -6477,7 +6493,7 @@ integer function qmckl_compute_en_rescaled_single_gl_doc_f(context, nucl_num, &
6477
6493
double precision , intent(in) :: rescale_factor_en(nucl_num)
6478
6494
integer*8 , intent(in) :: walk_num
6479
6495
double precision , intent(in) :: single_en_distance(nucl_num, walk_num)
6480
- double precision , intent(in) :: coord(3)
6496
+ double precision , intent(in) :: coord(3,walk_num )
6481
6497
double precision , intent(in) :: nucl_coord(nucl_num,3)
6482
6498
double precision , intent(out) :: en_rescaled_single_gl(4,nucl_num,walk_num)
6483
6499
@@ -6510,7 +6526,7 @@ integer function qmckl_compute_en_rescaled_single_gl_doc_f(context, nucl_num, &
6510
6526
do a = 1, nucl_num
6511
6527
ria_inv = 1.0d0 / single_en_distance(a, nw)
6512
6528
do ii = 1, 3
6513
- elnuc_dist_gl(ii, a) = (coord(ii) - nucl_coord(a, ii)) * ria_inv
6529
+ elnuc_dist_gl(ii, a) = (coord(ii,nw ) - nucl_coord(a, ii)) * ria_inv
6514
6530
end do
6515
6531
elnuc_dist_gl(4, a) = 2.0d0 * ria_inv
6516
6532
end do
@@ -6611,7 +6627,7 @@ qmckl_exit_code qmckl_compute_en_rescaled_single_gl (
6611
6627
real (c_double ) , intent(in) :: rescale_factor_en(nucl_num)
6612
6628
integer (c_int64_t) , intent(in) , value :: walk_num
6613
6629
real (c_double ) , intent(in) :: single_en_distance(nucl_num,walk_num)
6614
- real (c_double ) , intent(in) :: coord(3)
6630
+ real (c_double ) , intent(in) :: coord(3,walk_num )
6615
6631
real (c_double ) , intent(in) :: nucl_coord(nucl_num,3)
6616
6632
real (c_double ) , intent(out) :: en_rescaled_single_gl(4,nucl_num,walk_num)
6617
6633
@@ -7133,7 +7149,8 @@ qmckl_get_jastrow_champ_single_accept_alt(qmckl_context context)
7133
7149
7134
7150
double metric[4] = {-1.0, -1.0, -1.0, 1.0};
7135
7151
7136
- int old_date, do_update;
7152
+ uint64_t old_date;
7153
+ int do_update;
7137
7154
7138
7155
int shift1, shift2, shift3, shift4, shift5, shift6, shift7;
7139
7156
@@ -7736,7 +7753,7 @@ qmckl_get_jastrow_champ_single_accept(qmckl_context context)
7736
7753
7737
7754
for (int nw = 0; nw < ctx->electron.walker.num; nw++) {
7738
7755
for (int k = 0; k < 3; k++) {
7739
- ctx->point.coord.data[nw*3 *ctx->electron.num + k *ctx->electron.num + ctx->single_point.num] = ctx->single_point.coord.data[nw*3 + k];
7756
+ ctx->point.coord.data[k*ctx->electron.walker.num *ctx->electron.num + nw *ctx->electron.num + ctx->single_point.num] = ctx->single_point.coord.data[nw*3 + k];
7740
7757
}
7741
7758
}
7742
7759
0 commit comments