Skip to content

Commit

Permalink
Modified for multiple walkers
Browse files Browse the repository at this point in the history
  • Loading branch information
scemama committed Dec 14, 2024
1 parent 0f041bd commit abb486f
Showing 1 changed file with 62 additions and 2 deletions.
64 changes: 62 additions & 2 deletions org/qmckl_jastrow_champ_single.org
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ for (int i=0 ; i<type_nucl_num ; ++i) {
/* Check if Jastrow is properly initialized */
assert(qmckl_jastrow_champ_provided(context));

double new_coords[3] = {1.0,2.0,3.0};
double new_coords[6] = {1.0,2.0,3.0,4.0,5.0,6.0};

double coords[walk_num][elec_num][3];

Expand Down Expand Up @@ -704,6 +704,9 @@ assert (rc == QMCKL_SUCCESS);
coords[0][2][0] = new_coords[0];
coords[0][2][1] = new_coords[1];
coords[0][2][2] = new_coords[2];
coords[1][2][0] = new_coords[3];
coords[1][2][1] = new_coords[4];
coords[1][2][2] = new_coords[5];

rc = qmckl_check(context,
qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3)
Expand All @@ -718,10 +721,13 @@ assert (rc == QMCKL_SUCCESS);
for (int nw = 0; nw < walk_num; nw++){
for (int i = 0; i < elec_num; i++) {
if (i == 2) continue;
if (fabs((ee_distance[nw][2][i]-single_ee_distance[nw][i])) > 1.e-12) {
printf("%d %d ee_distance %f single_ee_distance %f\n", nw, i, ee_distance[nw][2][i], single_ee_distance[nw][i]);
fflush(stdout);
}
assert(fabs((ee_distance[nw][2][i]-single_ee_distance[nw][i])) < 1.e-12);
}
}

#+end_src

* ee distance rescaled single point
Expand Down Expand Up @@ -1021,6 +1027,9 @@ assert (rc == QMCKL_SUCCESS);
coords[0][2][0] = new_coords[0];
coords[0][2][1] = new_coords[1];
coords[0][2][2] = new_coords[2];
coords[1][2][0] = new_coords[3];
coords[1][2][1] = new_coords[4];
coords[1][2][2] = new_coords[5];

rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3);
assert (rc == QMCKL_SUCCESS);
Expand Down Expand Up @@ -1274,6 +1283,9 @@ assert (rc == QMCKL_SUCCESS);
coords[0][2][0] = new_coords[0];
coords[0][2][1] = new_coords[1];
coords[0][2][2] = new_coords[2];
coords[1][2][0] = new_coords[3];
coords[1][2][1] = new_coords[4];
coords[1][2][2] = new_coords[5];

rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3);
assert (rc == QMCKL_SUCCESS);
Expand Down Expand Up @@ -1550,6 +1562,9 @@ assert (rc == QMCKL_SUCCESS);
coords[0][2][0] = new_coords[0];
coords[0][2][1] = new_coords[1];
coords[0][2][2] = new_coords[2];
coords[1][2][0] = new_coords[3];
coords[1][2][1] = new_coords[4];
coords[1][2][2] = new_coords[5];

rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3);
assert (rc == QMCKL_SUCCESS);
Expand Down Expand Up @@ -1860,6 +1875,9 @@ assert (rc == QMCKL_SUCCESS);
coords[0][2][0] = new_coords[0];
coords[0][2][1] = new_coords[1];
coords[0][2][2] = new_coords[2];
coords[1][2][0] = new_coords[3];
coords[1][2][1] = new_coords[4];
coords[1][2][2] = new_coords[5];

rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3);
assert (rc == QMCKL_SUCCESS);
Expand Down Expand Up @@ -2226,6 +2244,9 @@ assert (rc == QMCKL_SUCCESS);
coords[0][2][0] = new_coords[0];
coords[0][2][1] = new_coords[1];
coords[0][2][2] = new_coords[2];
coords[1][2][0] = new_coords[3];
coords[1][2][1] = new_coords[4];
coords[1][2][2] = new_coords[5];

rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3);
assert (rc == QMCKL_SUCCESS);
Expand Down Expand Up @@ -2489,6 +2510,9 @@ assert (rc == QMCKL_SUCCESS);
coords[0][2][0] = new_coords[0];
coords[0][2][1] = new_coords[1];
coords[0][2][2] = new_coords[2];
coords[1][2][0] = new_coords[3];
coords[1][2][1] = new_coords[4];
coords[1][2][2] = new_coords[5];

rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3);
assert (rc == QMCKL_SUCCESS);
Expand Down Expand Up @@ -2765,6 +2789,9 @@ assert (rc == QMCKL_SUCCESS);
coords[0][2][0] = new_coords[0];
coords[0][2][1] = new_coords[1];
coords[0][2][2] = new_coords[2];
coords[1][2][0] = new_coords[3];
coords[1][2][1] = new_coords[4];
coords[1][2][2] = new_coords[5];

rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3);
assert (rc == QMCKL_SUCCESS);
Expand Down Expand Up @@ -3122,6 +3149,9 @@ assert (rc == QMCKL_SUCCESS);
coords[0][2][0] = new_coords[0];
coords[0][2][1] = new_coords[1];
coords[0][2][2] = new_coords[2];
coords[1][2][0] = new_coords[3];
coords[1][2][1] = new_coords[4];
coords[1][2][2] = new_coords[5];

rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3);
assert (rc == QMCKL_SUCCESS);
Expand Down Expand Up @@ -3477,6 +3507,9 @@ assert (rc == QMCKL_SUCCESS);
coords[0][2][0] = new_coords[0];
coords[0][2][1] = new_coords[1];
coords[0][2][2] = new_coords[2];
coords[1][2][0] = new_coords[3];
coords[1][2][1] = new_coords[4];
coords[1][2][2] = new_coords[5];

rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3);
assert (rc == QMCKL_SUCCESS);
Expand Down Expand Up @@ -3770,6 +3803,9 @@ assert (rc == QMCKL_SUCCESS);
coords[0][2][0] = new_coords[0];
coords[0][2][1] = new_coords[1];
coords[0][2][2] = new_coords[2];
coords[1][2][0] = new_coords[3];
coords[1][2][1] = new_coords[4];
coords[1][2][2] = new_coords[5];

rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3);
assert (rc == QMCKL_SUCCESS);
Expand Down Expand Up @@ -4112,6 +4148,9 @@ assert (rc == QMCKL_SUCCESS);
coords[0][2][0] = new_coords[0];
coords[0][2][1] = new_coords[1];
coords[0][2][2] = new_coords[2];
coords[1][2][0] = new_coords[3];
coords[1][2][1] = new_coords[4];
coords[1][2][2] = new_coords[5];

rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3);
assert (rc == QMCKL_SUCCESS);
Expand Down Expand Up @@ -4492,6 +4531,9 @@ assert (rc == QMCKL_SUCCESS);
coords[0][2][0] = new_coords[0];
coords[0][2][1] = new_coords[1];
coords[0][2][2] = new_coords[2];
coords[1][2][0] = new_coords[3];
coords[1][2][1] = new_coords[4];
coords[1][2][2] = new_coords[5];

rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3);
assert (rc == QMCKL_SUCCESS);
Expand Down Expand Up @@ -4913,6 +4955,9 @@ assert (rc == QMCKL_SUCCESS);
coords[0][2][0] = new_coords[0];
coords[0][2][1] = new_coords[1];
coords[0][2][2] = new_coords[2];
coords[1][2][0] = new_coords[3];
coords[1][2][1] = new_coords[4];
coords[1][2][2] = new_coords[5];

rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3);
assert (rc == QMCKL_SUCCESS);
Expand Down Expand Up @@ -5233,6 +5278,9 @@ assert (rc == QMCKL_SUCCESS);
coords[0][2][0] = new_coords[0];
coords[0][2][1] = new_coords[1];
coords[0][2][2] = new_coords[2];
coords[1][2][0] = new_coords[3];
coords[1][2][1] = new_coords[4];
coords[1][2][2] = new_coords[5];

rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3);
assert (rc == QMCKL_SUCCESS);
Expand Down Expand Up @@ -5588,6 +5636,9 @@ assert (rc == QMCKL_SUCCESS);
coords[0][2][0] = new_coords[0];
coords[0][2][1] = new_coords[1];
coords[0][2][2] = new_coords[2];
coords[1][2][0] = new_coords[3];
coords[1][2][1] = new_coords[4];
coords[1][2][2] = new_coords[5];

rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3);
assert (rc == QMCKL_SUCCESS);
Expand Down Expand Up @@ -6033,6 +6084,9 @@ assert (rc == QMCKL_SUCCESS);
coords[0][2][0] = new_coords[0];
coords[0][2][1] = new_coords[1];
coords[0][2][2] = new_coords[2];
coords[1][2][0] = new_coords[3];
coords[1][2][1] = new_coords[4];
coords[1][2][2] = new_coords[5];

rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3);
assert (rc == QMCKL_SUCCESS);
Expand Down Expand Up @@ -6454,6 +6508,9 @@ assert (rc == QMCKL_SUCCESS);
coords[0][2][0] = new_coords[0];
coords[0][2][1] = new_coords[1];
coords[0][2][2] = new_coords[2];
coords[1][2][0] = new_coords[3];
coords[1][2][1] = new_coords[4];
coords[1][2][2] = new_coords[5];

rc = qmckl_set_electron_coord(context, 'N', walk_num, elec_coord, walk_num*elec_num*3);
assert (rc == QMCKL_SUCCESS);
Expand Down Expand Up @@ -6855,6 +6912,9 @@ assert (rc == QMCKL_SUCCESS);
coords[0][2][0] = new_coords[0];
coords[0][2][1] = new_coords[1];
coords[0][2][2] = new_coords[2];
coords[1][2][0] = new_coords[3];
coords[1][2][1] = new_coords[4];
coords[1][2][2] = new_coords[5];

rc = qmckl_get_jastrow_champ_single_accept(context);
assert (rc == QMCKL_SUCCESS);
Expand Down

0 comments on commit abb486f

Please sign in to comment.