Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Heavy mesons onlinemeas #570

Open
wants to merge 58 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
a3ebafc
input file parameter for heavy meson correlators
simone-romiti May 23, 2023
a4f19a3
light correlators use that mu==md, need for 2 separate functions
simone-romiti May 23, 2023
6d12f79
code skeleton for the onlinemeas of the heavy mesons correlators
simone-romiti Jun 13, 2023
558dd27
first draft version: computing only one correlator for now
simone-romiti Jun 13, 2023
f11e8da
minor changes
simone-romiti Jun 13, 2023
20081dc
initialization of sources and propagator spinores + inversion + even-…
simone-romiti Jun 16, 2023
c80b84b
heavy_correlators_measurement() should be the same as light_correlato…
simone-romiti Jun 16, 2023
ff9bdda
fixed compilation errors
simone-romiti Jun 20, 2023
89674c3
name of function `mul_one_pm_itau2()` is misleading --> it also divid…
simone-romiti Jun 20, 2023
92cf6cf
some documentation for mul_one_pm_itau2_and_div_by_sqrt2()
simone-romiti Jun 20, 2023
df58ec7
todo: check if the handwritten derivation is correct and implement
simone-romiti Jun 20, 2023
02d89c0
documentation on the theoretical form of heavy meson correlators
simone-romiti Jun 27, 2023
c10659c
implementing. next: express correlator using _spinor_prod_re() or _sp…
simone-romiti Jun 27, 2023
1cfb721
contruction of correlators and MPI parallelization.
simone-romiti Jun 28, 2023
46a95f8
typo + writing correlators to file
simone-romiti Jun 28, 2023
1a646b5
fixed some typos
simone-romiti Jul 1, 2023
259019c
is the correlator =0 for i!=j ???
simone-romiti Jul 4, 2023
9d8b489
updated documentation
simone-romiti Jul 6, 2023
87da538
typo
simone-romiti Jul 6, 2023
bbb6c5a
minor comment
simone-romiti Jul 6, 2023
c02db24
outputting to file: appending correlators
simone-romiti Jul 18, 2023
3f57f5b
MPI reduce and gather for bulding correlator C(t)
simone-romiti Jul 18, 2023
159bf49
C(t) volume average over spinor scalar products
simone-romiti Jul 18, 2023
00d9cdc
todo: add gamma_5*Gamma_2 case condition for the light spinor
simone-romiti Jul 18, 2023
0c6a6bc
solved theoretical doubts on the correlator with spin dilution
simone-romiti Jul 26, 2023
a4c1760
code now conceptually true --> debug
simone-romiti Jul 26, 2023
ceecbf9
fixed compile-time bugs
simone-romiti Jul 26, 2023
a012365
small typo
simone-romiti Jul 26, 2023
b127a7e
added a note: testing invert_doublet_eo_quda
simone-romiti Oct 4, 2023
9a9a689
debugging
simone-romiti Dec 7, 2023
ce867bc
still debugging
simone-romiti Jan 5, 2024
9ce7734
probably solved the issue with allocarion of spinor arrays
simone-romiti Jan 5, 2024
5c873a9
making progress: no memory leaks if commenting the 2 lines of the inv…
simone-romiti Jan 8, 2024
abbf92c
some issues when going to the next configuration (even without actual…
simone-romiti Jan 8, 2024
5cf9374
inversions working but the now output contains a bunch of "inf"
simone-romiti Jan 10, 2024
e9447be
solved previous issue: some MPI reduction variables were not properly…
simone-romiti Jan 16, 2024
59f64e7
small typo
simone-romiti Jan 22, 2024
5a5eefd
Merge branch 'heavy_mesons_onlinemeas' of github.com:etmc/tmLQCD into…
simone-romiti Jan 22, 2024
e2d1cea
documentation for ndd correlators: simpler notation
simone-romiti Jan 23, 2024
3d93a01
minor changes
simone-romiti Jan 23, 2024
500705e
typo in doc for ndd_correlators
simone-romiti Jan 23, 2024
44f3ff0
Merge branch 'heavy_mesons_onlinemeas_gamma5herm' of https://github.c…
simone-romiti Jan 23, 2024
7608a7e
documentation for ndd correlators: simpler notation
simone-romiti Jan 23, 2024
f9eb405
minor changes
simone-romiti Jan 23, 2024
cd605f7
typo in doc for ndd_correlators
simone-romiti Jan 23, 2024
88a7891
Merge branch 'heavy_mesons_onlinemeas_gamma5herm' of https://github.c…
simone-romiti Jan 23, 2024
f7a94a3
applied formula in the documentation for ndd_correlators
simone-romiti Jan 23, 2024
13db981
fixed typo
simone-romiti Jan 23, 2024
29086ea
minor change to the ndd documentation
simone-romiti Jan 24, 2024
142b152
no need for the sources when building the correlator
simone-romiti Jan 26, 2024
49cb20a
Merge branch 'heavy_mesons_onlinemeas_gamma5herm' of https://github.c…
simone-romiti Jan 26, 2024
3926b02
updated documentation for ndd correlators
simone-romiti Jan 26, 2024
d4e5b50
Merge branch 'heavy_mesons_onlinemeas_gamma5herm' of github.com:etmc/…
simone-romiti Jan 26, 2024
56dd812
small typo only for correlator at t=0
simone-romiti Apr 9, 2024
4b5e0cd
typo: =+ instead of +=
simone-romiti Apr 10, 2024
ecdfdd5
Merge pull request #614 from etmc/heavy_mesons_onlinemeas_gamma5herm
simone-romiti Sep 25, 2024
911987c
Merge branch 'master' into heavy_mesons_onlinemeas
Marcogarofalo Sep 27, 2024
c713145
volume average for heavy correlators
Marcogarofalo Sep 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
initialization of sources and propagator spinores + inversion + even-…
…odd lexic conversione
  • Loading branch information
simone-romiti committed Jun 16, 2023
commit 20081dc72f513f2373e2ef2e12d4cd0af1b9f7fe
184 changes: 132 additions & 52 deletions meas/correlators.c
Original file line number Diff line number Diff line change
@@ -260,26 +260,15 @@ void light_correlators_measurement(const int traj, const int id, const int ieo)
*current), <S,S>, <S,P>, <P,P> for all the choices of h1 and h2 (see eq. 18 and 20 of
*https://arxiv.org/pdf/1005.2042.pdf)
*
* i1, i2 = source and sink operator indices from the list of the operators in the input file.
* i1, i2 = operator indices from the list of the operators in the input file.
*
*
******************************************************/
void heavy_quarks_correlators_measurement(const int traj, const int t0, const int ieo, const int i1,
const int i2) {
tm_stopwatch_push(&g_timers, __func__, ""); // timer for profiling
int i, j, t, tt, t0; // dummy indices
double *Cpp = NULL; // array of the values of the correlator C(t)
double res = 0.; // result of the accumulation of MPI partial sums
float tmp; // dummy variable
operator* optr1; // pointer to the operator (see some lines later)
#ifdef TM_USE_MPI
double mpi_res = 0., mpi_respa = 0., mpi_resp4 = 0.;
// send buffer for MPI_Gather
double *sCpp = NULL; //, *sCpa = NULL, *sCp4 = NULL;
#endif
FILE *ofs; // output file stream
char filename[TM_OMEAS_FILENAME_LENGTH]; // file path
spinor phi; // full spinor of 4 components (we use the spin dilution)

/* building the stichastic propagator spinors needed for the correlators */

init_operators(); // initialize the operators in the action (if not already done)
if (no_operators < 1) {
@@ -294,7 +283,8 @@ void heavy_quarks_correlators_measurement(const int traj, const int t0, const in
}

// selecting the operators i1 and i2 from the list of operators initialized before
optr1 = &operator_list[i1];
operator* optr1 = &operator_list[i1];
operator* optr2 = &operator_list[i2];

bool b1 = (optr1->type != DBTMWILSON && optr1->type != DBCLOVER);
if (b1) {
@@ -345,6 +335,129 @@ void heavy_quarks_correlators_measurement(const int traj, const int t0, const in
optr1->kappa, optr1->mubar, optr1->epsbar);
}


// even-odd spinor fields for the light and heavy doublet correlators
// source+propagator, even-odd, 2 flavors
// psi = psi[(s,p)][eo][f][x][alpha][c]
// Note: propagator in th sense that it is D^{-1}*source after the inversion
init_spinor_field(VOLUMEPLUSRAND / 2, 1); // initialize g_spinor_field so that I can copy it
spinor ****l_eo_spinor_field = (spinor ****)malloc(8 * VOLUME / 2);
spinor ****h_eo_spinor_field = (spinor ****)malloc(8 * VOLUME / 2);
// initalize to zero the source spinor fields (necessary??? isn't it enough to use the source
// generator?)
for (size_t i_sp = 0; i_sp < 2; i_sp++) { // source or propagator

for (size_t i_eo = 0; i_eo < 2; i_eo++) { // even-odd
for (size_t i_f = 0; i_f < 2; i++) { // up-down flavor
assign(l_eo_spinor_field[0][i_eo][i_f], g_spinor_field[0], VOLUME / 2);
assign(h_eo_spinor_field[0][i_eo][i_f], g_spinor_field[0], VOLUME / 2);
}
}
}

// initalize the random sources
// one source for each --> spin dilution
for (size_t i_f = 0; i_f < 2; i_f++) {
for (size_t src_d = 0; src_d < 4; src_d++) {
const unsigned int seed_i = src_d + measurement_list[id].seed;
// light doublet
eo_source_spinor_field_spin_diluted_oet_ts(l_eo_spinor_field[0][0][i_f],
l_eo_spinor_field[0][1][i_f], t0, src_d,
sample, traj, seed_i);
// heavy doublet
eo_source_spinor_field_spin_diluted_oet_ts(h_eo_spinor_field[0][0][i_f],
h_eo_spinor_field[0][1][i_f], t0, src_d,
sample, traj, seed_i);
}
}

// heavy doublet: for each even-odd block, I multiply by (1 + i*tau_2)
// the basis for the inversion should be the same as for the light
// --> I will multiply later by the inverse, namely at the end of the inversion
for (size_t i_eo = 0; i_eo < 2; i_eo++) {
for (size_t i_f = 0; i_f < 2; i_f++) {
// (u,d) --> [(1+i*tau_2)/sqrt(2)] * (u,d) , stored at temporarely in the propagator spinors (used as dummy spinors)
mul_one_pm_itau2(h_eo_spinor_field[1][i_eo][i_f], h_eo_spinor_field[1][i_eo][i_f+1],
h_eo_spinor_field[0][i_eo][i_f], h_eo_spinor_field[0][i_eo][i_f+1], +1.0, VOLUME / 2);
// assigning the result to the first components (the sources).
// The propagators will be overwritten with the inversion
assign(h_eo_spinor_field[0][i_eo][i_f], h_eo_spinor_field[1][i_eo][i_f], VOLUME / 2);
}
}

/*
assign the sources and propagator pointes for the operators
these need to be know when calling the inverter() method
*/

// light doublet
optr1->sr0 = l_eo_spinor_field[0][0][0];
optr1->sr1 = l_eo_spinor_field[0][0][1];
optr1->sr2 = l_eo_spinor_field[0][1][0];
optr1->sr3 = l_eo_spinor_field[0][1][1];

optr1->prop0 = l_eo_spinor_field[1][0][0];
optr1->prop1 = l_eo_spinor_field[1][0][1];
optr1->prop2 = l_eo_spinor_field[1][1][0];
optr1->prop3 = l_eo_spinor_field[1][1][1];

// heavy doublet
optr2->sr0 = h_eo_spinor_field[0][0][0];
optr2->sr1 = h_eo_spinor_field[0][0][1];
optr2->sr2 = h_eo_spinor_field[0][1][0];
optr2->sr3 = h_eo_spinor_field[0][1][1];

optr2->prop0 = h_eo_spinor_field[1][0][0];
optr2->prop1 = h_eo_spinor_field[1][0][1];
optr2->prop2 = h_eo_spinor_field[1][1][0];
optr2->prop3 = h_eo_spinor_field[1][1][1];

// inverting the Dirac operators for the light and heavy doublet
// op_id = i1 or i2, index_start = 0, write_prop = 0
optr1->inverter(i1, 0, 0);
optr2->inverter(i2, 0, 0);

// conclude the change of basis for the heavy doublet
for (size_t i_eo = 0; i_eo < 2; i_eo++) {
for (size_t i_f = 0; i_f < 2; i_f++) {
// (u,d) --> [(1+i*tau_2)/sqrt(2)] * (u,d) , stored at temporarely in the propagator spinors (used as dummy spinors)
mul_one_pm_itau2(h_eo_spinor_field[1][i_eo][i_f], h_eo_spinor_field[1][i_eo][i_f+1],
h_eo_spinor_field[0][i_eo][i_f], h_eo_spinor_field[0][i_eo][i_f+1], -1.0, VOLUME / 2);
// assigning the result to the first components (the sources).
// The propagators will be overwritten with the inversion
assign(h_eo_spinor_field[0][i_eo][i_f], h_eo_spinor_field[1][i_eo][i_f], VOLUME / 2);
}
}

// now we switch from even-odd representation to standard
// propagator, 2 flavors : psi = psi[f][x][alpha][c]
spinor ***l_propagator = (spinor ****)malloc(2 * VOLUME);
spinor ***h_propagator = (spinor ****)malloc(2 * VOLUME);
for (size_t i_f = 0; i_f < 2; i_f++) {
convert_eo_to_lexic(l_propagator[i_f], l_spinor_field[1][0][i_f], l_spinor_field[1][1][i_f]);
convert_eo_to_lexic(h_propagator[i_f], h_spinor_field[1][0][i_f], h_spinor_field[1][1][i_f]);
}

/*
Now that I have all the propagators (all in the basis of
https://arxiv.org/pdf/1005.2042.pdf) I can build the correlators of eq. 20
*/

spinor phi; // dummy spinor

// light-light

int i, j, t, tt, t0; // dummy indices
double *Cpp = NULL; // array of the values of the correlator C(t)
double res = 0.; // result of the accumulation of MPI partial sums
float tmp; // dummy variable
#ifdef TM_USE_MPI
double mpi_res = 0., mpi_respa = 0., mpi_resp4 = 0.;
// send buffer for MPI_Gather
double *sCpp = NULL; //, *sCpa = NULL, *sCp4 = NULL;
#endif
FILE *ofs; // output file stream
char filename[TM_OMEAS_FILENAME_LENGTH]; // file path
#ifdef TM_USE_MPI
sCpp = (double *)calloc(T, sizeof(double));
// sCpa = (double*) calloc(T, sizeof(double));
@@ -357,46 +470,13 @@ void heavy_quarks_correlators_measurement(const int traj, const int t0, const in
#else
Cpp = (double *)calloc(T, sizeof(double));
// Cpa = (double*) calloc(T, sizeof(double));
// Cp4 = (double*) calloc(T, sizeof(double));
#endif
// /// ??? what to use here
// source_generation_pion_only(g_spinor_field[0], g_spinor_field[1], t0, sample, traj,
// measurement_list[id].seed);
// initialize the random sources
for (size_t srd_d = 0; srd_d < 2; srd_d++) {
full_source_spinor_field_spin_diluted_oet_ts(g_bispinor_field[i1][src_d], t0, src_d, sample, traj,
measurement_list[id].seed);
}
// Cp4 = (double*) calloc(T, sizeof(double));// INIT SOME SPINOR FIELD FOR THE LIGHT

// ??? not sure how to use g_bispinor
spinor *up_spinors = &g_bispinor_field[i1][0][0];
spinor *down_spinors = &g_bispinor_field[0][1];
// sources
optr1->sr0 = g_bispinor_field[i1][0][0];
optr1->sr1 = g_bispinor_field[i1][0][1];
optr1->sr2 = down_spinors[0];
optr1->sr3 = down_spinors[1];
// propagators, i.e. D^{-1}*eta (eta = stochastic vector for the inversion)
optr1->prop0 = g_bispinor_field[i1][0][2];
optr1->prop1 = g_bispinor_field[i1][0][3];
optr1->prop2 = down_spinors[2];
optr1->prop3 = down_spinors[3];

// even-odd sites for the down
// sources
optr1->sr2 = g_bispinor_field[1][0];
optr1->sr3 = g_bispinor_field[1][1];
// propagators, i.e. D^{-1}*eta (eta = stochastic vector for the inversion)
optr1->prop2 = g_bispinor_field[1][2];
optr1->prop3 = g_bispinor_field[1][3];
#endif

// op_id = 0, index_start = 0, write_prop = 0
optr1->inverter(i1, 0, 0);
// heavy-light

/* now we bring it to normal format */
/* here we use implicitly DUM_MATRIX and DUM_MATRIX+1 */
convert_eo_to_lexic(down_spinors[DUM_MATRIX], down_spinors[2], down_spinors[3]);
convert_eo_to_lexic(down_spinors[DUM_MATRIX], down_spinors[2], down_spinors[3]);


/* now we sum only over local space for every t */
for (t = 0; t < T; t++) {