2018-09-07 20:10:07 +01:00
|
|
|
/*************************************************************************************
|
|
|
|
|
|
|
|
Grid physics library, www.github.com/paboyle/Grid
|
|
|
|
|
|
|
|
Source file: Tests/Hadrons/Test_hadrons_spectrum.cc
|
|
|
|
|
|
|
|
Copyright (C) 2015-2018
|
|
|
|
|
2016-12-05 02:44:58 +00:00
|
|
|
Author: Antonin Portelli <antonin.portelli@me.com>
|
2018-09-07 20:10:07 +01:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along
|
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
|
|
|
|
See the full license in the file "LICENSE" in the top level distribution directory
|
|
|
|
*************************************************************************************/
|
|
|
|
/* END LEGAL */
|
2016-12-05 02:44:58 +00:00
|
|
|
|
2018-08-28 15:00:40 +01:00
|
|
|
#include <Hadrons/Application.hpp>
|
|
|
|
#include <Hadrons/Modules.hpp>
|
2016-12-05 02:44:58 +00:00
|
|
|
|
|
|
|
using namespace Grid;
|
|
|
|
using namespace Hadrons;
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
// initialization //////////////////////////////////////////////////////////
|
|
|
|
Grid_init(&argc, &argv);
|
|
|
|
HadronsLogError.Active(GridLogError.isActive());
|
|
|
|
HadronsLogWarning.Active(GridLogWarning.isActive());
|
|
|
|
HadronsLogMessage.Active(GridLogMessage.isActive());
|
|
|
|
HadronsLogIterative.Active(GridLogIterative.isActive());
|
|
|
|
HadronsLogDebug.Active(GridLogDebug.isActive());
|
|
|
|
LOG(Message) << "Grid initialized" << std::endl;
|
|
|
|
|
|
|
|
// run setup ///////////////////////////////////////////////////////////////
|
2016-12-14 18:04:21 +00:00
|
|
|
Application application;
|
2016-12-05 02:44:58 +00:00
|
|
|
std::vector<std::string> flavour = {"l", "s", "c1", "c2", "c3"};
|
2019-10-08 13:19:47 +01:00
|
|
|
std::vector<std::string> flavour_baryon = {"l", "s", "a", "b", "c"}; //needs to be a single character
|
2016-12-05 02:44:58 +00:00
|
|
|
std::vector<double> mass = {.01, .04, .2 , .25 , .3 };
|
|
|
|
|
|
|
|
// global parameters
|
|
|
|
Application::GlobalPar globalPar;
|
|
|
|
globalPar.trajCounter.start = 1500;
|
|
|
|
globalPar.trajCounter.end = 1520;
|
|
|
|
globalPar.trajCounter.step = 20;
|
2018-09-10 15:32:13 +01:00
|
|
|
globalPar.runId = "test";
|
2016-12-05 02:44:58 +00:00
|
|
|
application.setPar(globalPar);
|
|
|
|
// gauge field
|
2016-12-05 04:53:31 +00:00
|
|
|
application.createModule<MGauge::Unit>("gauge");
|
2016-12-05 02:44:58 +00:00
|
|
|
// sources
|
2016-12-05 04:53:31 +00:00
|
|
|
MSource::Z2::Par z2Par;
|
2016-12-05 02:44:58 +00:00
|
|
|
z2Par.tA = 0;
|
|
|
|
z2Par.tB = 0;
|
2016-12-05 04:53:31 +00:00
|
|
|
application.createModule<MSource::Z2>("z2", z2Par);
|
|
|
|
MSource::Point::Par ptPar;
|
2016-12-05 02:44:58 +00:00
|
|
|
ptPar.position = "0 0 0 0";
|
2016-12-05 04:53:31 +00:00
|
|
|
application.createModule<MSource::Point>("pt", ptPar);
|
2017-06-06 17:45:30 +01:00
|
|
|
// sink
|
|
|
|
MSink::Point::Par sinkPar;
|
|
|
|
sinkPar.mom = "0 0 0";
|
|
|
|
application.createModule<MSink::ScalarPoint>("sink", sinkPar);
|
2017-05-26 15:59:15 +01:00
|
|
|
|
|
|
|
// set fermion boundary conditions to be periodic space, antiperiodic time.
|
|
|
|
std::string boundary = "1 1 1 -1";
|
2018-11-12 17:16:18 +00:00
|
|
|
std::string twist = "0. 0. 0. 0.";
|
2017-05-26 15:59:15 +01:00
|
|
|
|
2016-12-05 02:44:58 +00:00
|
|
|
for (unsigned int i = 0; i < flavour.size(); ++i)
|
|
|
|
{
|
|
|
|
// actions
|
2016-12-05 04:53:31 +00:00
|
|
|
MAction::DWF::Par actionPar;
|
2016-12-05 02:44:58 +00:00
|
|
|
actionPar.gauge = "gauge";
|
|
|
|
actionPar.Ls = 12;
|
|
|
|
actionPar.M5 = 1.8;
|
|
|
|
actionPar.mass = mass[i];
|
2017-05-26 15:59:15 +01:00
|
|
|
actionPar.boundary = boundary;
|
2018-11-12 17:16:18 +00:00
|
|
|
actionPar.twist = twist;
|
2016-12-05 04:53:31 +00:00
|
|
|
application.createModule<MAction::DWF>("DWF_" + flavour[i], actionPar);
|
2016-12-05 02:44:58 +00:00
|
|
|
|
|
|
|
// solvers
|
2016-12-05 04:53:31 +00:00
|
|
|
MSolver::RBPrecCG::Par solverPar;
|
2018-03-09 19:53:55 +00:00
|
|
|
solverPar.action = "DWF_" + flavour[i];
|
|
|
|
solverPar.residual = 1.0e-8;
|
|
|
|
solverPar.maxIteration = 10000;
|
2016-12-05 04:53:31 +00:00
|
|
|
application.createModule<MSolver::RBPrecCG>("CG_" + flavour[i],
|
|
|
|
solverPar);
|
2016-12-05 02:44:58 +00:00
|
|
|
|
|
|
|
// propagators
|
2017-06-08 02:10:48 +01:00
|
|
|
MFermion::GaugeProp::Par quarkPar;
|
2016-12-05 02:44:58 +00:00
|
|
|
quarkPar.solver = "CG_" + flavour[i];
|
2016-12-05 08:41:58 +00:00
|
|
|
quarkPar.source = "pt";
|
2017-06-08 02:10:48 +01:00
|
|
|
application.createModule<MFermion::GaugeProp>("Qpt_" + flavour[i], quarkPar);
|
2016-12-05 08:41:58 +00:00
|
|
|
quarkPar.source = "z2";
|
2017-06-08 02:10:48 +01:00
|
|
|
application.createModule<MFermion::GaugeProp>("QZ2_" + flavour[i], quarkPar);
|
2016-12-05 02:44:58 +00:00
|
|
|
}
|
2016-12-05 08:26:57 +00:00
|
|
|
for (unsigned int i = 0; i < flavour.size(); ++i)
|
|
|
|
for (unsigned int j = i; j < flavour.size(); ++j)
|
2016-12-05 02:44:58 +00:00
|
|
|
{
|
2016-12-05 04:53:31 +00:00
|
|
|
MContraction::Meson::Par mesPar;
|
2016-12-05 02:44:58 +00:00
|
|
|
|
2017-06-06 17:45:30 +01:00
|
|
|
mesPar.output = "mesons/pt_" + flavour[i] + flavour[j];
|
|
|
|
mesPar.q1 = "Qpt_" + flavour[i];
|
|
|
|
mesPar.q2 = "Qpt_" + flavour[j];
|
|
|
|
mesPar.gammas = "all";
|
|
|
|
mesPar.sink = "sink";
|
2016-12-05 08:41:58 +00:00
|
|
|
application.createModule<MContraction::Meson>("meson_pt_"
|
|
|
|
+ flavour[i] + flavour[j],
|
|
|
|
mesPar);
|
2017-06-06 17:45:30 +01:00
|
|
|
mesPar.output = "mesons/Z2_" + flavour[i] + flavour[j];
|
|
|
|
mesPar.q1 = "QZ2_" + flavour[i];
|
|
|
|
mesPar.q2 = "QZ2_" + flavour[j];
|
|
|
|
mesPar.gammas = "all";
|
|
|
|
mesPar.sink = "sink";
|
2016-12-05 08:41:58 +00:00
|
|
|
application.createModule<MContraction::Meson>("meson_Z2_"
|
2016-12-05 04:53:31 +00:00
|
|
|
+ flavour[i] + flavour[j],
|
|
|
|
mesPar);
|
2016-12-05 02:44:58 +00:00
|
|
|
}
|
2016-12-05 08:26:57 +00:00
|
|
|
for (unsigned int i = 0; i < flavour.size(); ++i)
|
|
|
|
for (unsigned int j = i; j < flavour.size(); ++j)
|
|
|
|
for (unsigned int k = j; k < flavour.size(); ++k)
|
|
|
|
{
|
|
|
|
MContraction::Baryon::Par barPar;
|
|
|
|
|
2016-12-05 08:41:58 +00:00
|
|
|
barPar.output = "baryons/pt_" + flavour[i] + flavour[j] + flavour[k];
|
|
|
|
barPar.q1 = "Qpt_" + flavour[i];
|
|
|
|
barPar.q2 = "Qpt_" + flavour[j];
|
|
|
|
barPar.q3 = "Qpt_" + flavour[k];
|
2019-10-14 13:41:08 +01:00
|
|
|
barPar.gammas = "(j12 j12) (j32X j32Y)";
|
2019-10-08 13:19:47 +01:00
|
|
|
barPar.quarks = flavour_baryon[i] + flavour_baryon[j] + flavour_baryon[k];
|
|
|
|
barPar.prefactors = "1.0";
|
|
|
|
barPar.sink = "sink";
|
2016-12-05 08:26:57 +00:00
|
|
|
application.createModule<MContraction::Baryon>(
|
2016-12-05 08:41:58 +00:00
|
|
|
"baryon_pt_" + flavour[i] + flavour[j] + flavour[k], barPar);
|
2016-12-05 08:26:57 +00:00
|
|
|
}
|
2016-12-05 02:44:58 +00:00
|
|
|
|
|
|
|
// execution
|
2016-12-14 19:41:51 +00:00
|
|
|
application.saveParameterFile("spectrum.xml");
|
2016-12-05 02:44:58 +00:00
|
|
|
application.run();
|
|
|
|
|
|
|
|
// epilogue
|
|
|
|
LOG(Message) << "Grid is finalizing now" << std::endl;
|
|
|
|
Grid_finalize();
|
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|