From 6012b9decfc324cc984b7d5b70424502c7386095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Coppens?= Date: Fri, 12 Mar 2021 15:47:47 +0100 Subject: [PATCH] 4x4 with 2 updates example is working again after adding update cycle 8169 dataset but with replacement updates instead of additive updates. --- datasets/update_cycle_8169_repl.dat | 32 +++++++++++++++++++++++++++++ src/SM_MaponiA3.cpp | 9 +++++--- tests/QMCChem_dataset_test.f90 | 2 +- 3 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 datasets/update_cycle_8169_repl.dat diff --git a/datasets/update_cycle_8169_repl.dat b/datasets/update_cycle_8169_repl.dat new file mode 100644 index 0000000..46c8522 --- /dev/null +++ b/datasets/update_cycle_8169_repl.dat @@ -0,0 +1,32 @@ +#START_PACKET +#CYCLE_ID: 8169 +#SLATER_MATRIX_DIM: 4 +#NUPDATES: 2 +#SLATER_MATRIX: (i (outer), j (inner)), slater_matrix_alpha(i,j), ddet * slater_matrix_alpha_inv_det(i,j) / ddet +(01,01) 0.100000000000000E+01 0.100000000000000E+01 +(01,02) 0.000000000000000E+00 0.100000000000000E+01 +(01,03) 0.100000000000000E+01 -0.100000000000000E+01 +(01,04) -0.100000000000000E+01 -0.100000000000000E+01 +(02,01) 0.000000000000000E+00 -0.100000000000000E+01 +(02,02) 0.100000000000000E+01 0.000000000000000E+00 +(02,03) 0.100000000000000E+01 0.100000000000000E+01 +(02,04) 0.000000000000000E+00 0.000000000000000E+00 +(03,01) -0.100000000000000E+01 0.100000000000000E+01 +(03,02) 0.000000000000000E+00 0.200000000000000E+01 +(03,03) -0.100000000000000E+01 -0.200000000000000E+01 +(03,04) 0.000000000000000E+00 -0.100000000000000E+01 +(04,01) 0.100000000000000E+01 0.100000000000000E+01 +(04,02) 0.100000000000000E+01 0.100000000000000E+01 +(04,03) 0.100000000000000E+01 -0.100000000000000E+01 +(04,04) 0.100000000000000E+01 0.000000000000000E+00 +#COL_UPDATE_INDEX: 2 +#COL_UPDATE_COMP_(01): 0.000000000000000E+00 +#COL_UPDATE_COMP_(02): -1.000000000000000E+00 +#COL_UPDATE_COMP_(03): 0.000000000000000E+00 +#COL_UPDATE_COMP_(04): 1.000000000000000E+00 +#COL_UPDATE_INDEX: 4 +#COL_UPDATE_COMP_(01): -1.000000000000000E+00 +#COL_UPDATE_COMP_(02): -1.000000000000000E+00 +#COL_UPDATE_COMP_(03): 0.000000000000000E+00 +#COL_UPDATE_COMP_(04): -1.000000000000000E+00 +#END_PACKET diff --git a/src/SM_MaponiA3.cpp b/src/SM_MaponiA3.cpp index ed64470..786da30 100644 --- a/src/SM_MaponiA3.cpp +++ b/src/SM_MaponiA3.cpp @@ -17,7 +17,7 @@ void selectBestUpdate(unsigned int l, unsigned int N_updates, breakdown = abs(1 + ylk[l][index][component]); #ifdef DEBUG cout << "Inside selectBestUpdate()" << endl; - cout << "breakdown = abs(1 + ylk[" << l << "][" << index << "][" << component << "])" << endl; + cout << "breakdown = abs(1 + ylk[" << l << "][" << index << "][" << component << "]) = " << breakdown << endl; cout << endl; #endif if (breakdown > max) { @@ -69,7 +69,7 @@ void MaponiA3(double *Slater_inv, unsigned int Dim, for (k = 1; k < N_updates + 1; k++) { #ifdef DEBUG cout << "Compute y0k: " << endl; - cout << "ylk[0][" << k << "][:]" << endl; + cout << "ylk[0][" << k << "][:]"; cout << endl; #endif for (i = 1; i < Dim + 1; i++) { @@ -78,6 +78,9 @@ void MaponiA3(double *Slater_inv, unsigned int Dim, * Updates[(k-1)*Dim + (j-1)]; } } + #ifdef DEBUG + showVector(ylk[0][k], Dim, ""); + #endif } // Calculate the {y_{l,k}} from the {y_{0,k}} @@ -96,7 +99,7 @@ void MaponiA3(double *Slater_inv, unsigned int Dim, #ifdef DEBUG cout << "p[l+1] = " << p[l+1] << endl; cout << "component = " << component << endl; - cout << "beta = 1 + ylk[" << l << "][" << p[l+1] << "][" << component << "]" << endl; + cout << "beta = 1 + ylk[" << l << "][" << p[l+1] << "][" << component << "] = " << beta << endl; cout << endl; #endif if (fabs(beta) < 1e-6) { diff --git a/tests/QMCChem_dataset_test.f90 b/tests/QMCChem_dataset_test.f90 index 2f537a8..e7b507d 100644 --- a/tests/QMCChem_dataset_test.f90 +++ b/tests/QMCChem_dataset_test.f90 @@ -9,7 +9,7 @@ program QMCChem_dataset_test real(c_double), dimension(:,:), allocatable :: Updates, U real(c_double), dimension(:,:), allocatable :: S, S_inv, S_inv_t - call Read_dataset("datasets/update_cycle_8169.dat", & + call Read_dataset("datasets/update_cycle_8169_repl.dat", & cycle_id, & dim, & n_updates, &