LapH::Quarklines::Quarklines( const size_t Lt, const size_t dilT, const size_t dilE, const size_t nev, const QuarklineLookup& quarkline_lookuptable, const std::vector<RandomIndexCombinationsQ2>& ric_lookup) : Lt(Lt), dilT(dilT), dilE(dilE), nev(nev) { // needed to construct quarklines on individual time slices int tt2 = 0; if(Lt==1 || Lt==2 || Lt==2*dilT) tt2 = 1; else tt2 = Lt/dilT; Q1.resize(boost::extents[Lt][tt2][quarkline_lookuptable.Q1.size()]); Q2V.resize(boost::extents[Lt][tt2][quarkline_lookuptable.Q2V.size()]); Q2L.resize(boost::extents[Lt][tt2][quarkline_lookuptable.Q2L.size()]); for(size_t t1 = 0; t1 < Lt; t1++){ for(size_t t2 = 0; t2 < tt2; t2++){ for(size_t op = 0; op < quarkline_lookuptable.Q1.size(); op++){ size_t nb_rnd = ric_lookup[(quarkline_lookuptable.Q1[op]). id_ric_lookup].rnd_vec_ids.size(); Q1[t1][t2][op].resize(nb_rnd); for(size_t rnd1 = 0; rnd1 < nb_rnd; rnd1++){ Q1[t1][t2][op][rnd1] = Eigen::MatrixXcd::Zero(4*dilE, 4*dilE); } } for(size_t op = 0; op < quarkline_lookuptable.Q2V.size(); op++){ size_t nb_rnd = ric_lookup[(quarkline_lookuptable.Q2V[op]). id_ric_lookup].rnd_vec_ids.size(); Q2V[t1][t2][op].resize(nb_rnd); for(size_t rnd1 = 0; rnd1 < nb_rnd; rnd1++){ Q2V[t1][t2][op][rnd1] = Eigen::MatrixXcd::Zero(4*dilE, 4*dilE); } } for(size_t op = 0; op < quarkline_lookuptable.Q2L.size(); op++){ size_t nb_rnd = ric_lookup[(quarkline_lookuptable.Q2L[op]). id_ric_lookup].rnd_vec_ids.size(); Q2L[t1][t2][op].resize(nb_rnd); for(size_t rnd1 = 0; rnd1 < nb_rnd; rnd1++){ Q2L[t1][t2][op][rnd1] = Eigen::MatrixXcd::Zero(4*dilE, 4*dilE); } } }} // creating gamma matrices gamma.resize(16); for(int i = 0; i < 16; ++i) create_gamma(gamma, i); }
BasicOperator::BasicOperator() : gamma(), Q2() { const size_t Lt = global_data->get_Lt(); const std::vector<quark> quarks = global_data->get_quarks(); const size_t nb_rnd = quarks[0].number_of_rnd_vec; const size_t dilT = quarks[0].number_of_dilution_T; const size_t Q2_size = 4 * quarks[0].number_of_dilution_E; const vec_pdg_Corr op_Corr = global_data->get_lookup_corr(); const size_t nb_op = op_Corr.size(); // creating gamma matrices gamma.resize(16); for(int i = 0; i < 16; ++i) create_gamma(gamma, i); // TODO: dilT is quark dependent so it must be changed in the future. Right // now it is assumed that the dilution in time is always the same // for all quarks. Q2.resize(boost::extents[Lt][Lt/dilT][3][nb_op]); for(size_t t1 = 0; t1 < Lt; t1++) for(size_t t2 = 0; t2 < Lt/dilT; t2++) for(size_t t3 = 0; t3 < 3; t3++) for(size_t op = 0; op < nb_op; op++){ Q2[t1][t2][t3][op].resize(nb_rnd); for(size_t rnd1 = 0; rnd1 < nb_rnd; rnd1++){ Q2[t1][t2][t3][op][rnd1].resize(nb_rnd); for(size_t rnd2 = 0; rnd2 < nb_rnd; rnd2++) Q2[t1][t2][t3][op][rnd1][rnd2] = Eigen::MatrixXcd::Zero(Q2_size, Q2_size); } } std::cout << "\tallocated memory in BasicOperator" << std::endl; }