1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-09-20 09:15:38 +01:00

Hadrons: support for twisted boundary conditions

This commit is contained in:
Antonin Portelli 2018-11-12 17:16:18 +00:00
parent f3f24b3017
commit 8e0d2f3402
10 changed files with 39 additions and 18 deletions

View File

@ -49,7 +49,8 @@ public:
unsigned int, Ls, unsigned int, Ls,
double , mass, double , mass,
double , M5, double , M5,
std::string , boundary); std::string , boundary,
std::string , twist);
}; };
template <typename FImpl> template <typename FImpl>
@ -119,8 +120,9 @@ void TDWF<FImpl>::setup(void)
auto &grb4 = *envGetRbGrid(FermionField); auto &grb4 = *envGetRbGrid(FermionField);
auto &g5 = *envGetGrid(FermionField, par().Ls); auto &g5 = *envGetGrid(FermionField, par().Ls);
auto &grb5 = *envGetRbGrid(FermionField, par().Ls); auto &grb5 = *envGetRbGrid(FermionField, par().Ls);
std::vector<Complex> boundary = strToVec<Complex>(par().boundary); typename DomainWallFermion<FImpl>::ImplParams implParams;
typename DomainWallFermion<FImpl>::ImplParams implParams(boundary); implParams.boundary_phases = strToVec<Complex>(par().boundary);
implParams.twist_n_2pi_L = strToVec<Real>(par().twist);
envCreateDerived(FMat, DomainWallFermion<FImpl>, getName(), par().Ls, U, g5, envCreateDerived(FMat, DomainWallFermion<FImpl>, getName(), par().Ls, U, g5,
grb5, g4, grb4, par().mass, par().M5, implParams); grb5, g4, grb4, par().mass, par().M5, implParams);
} }

View File

@ -49,7 +49,8 @@ public:
double , M5, double , M5,
double , b, double , b,
double , c, double , c,
std::string , boundary); std::string , boundary,
std::string , twist);
}; };
template <typename FImpl> template <typename FImpl>
@ -119,8 +120,9 @@ void TMobiusDWF<FImpl>::setup(void)
auto &grb4 = *envGetRbGrid(FermionField); auto &grb4 = *envGetRbGrid(FermionField);
auto &g5 = *envGetGrid(FermionField, par().Ls); auto &g5 = *envGetGrid(FermionField, par().Ls);
auto &grb5 = *envGetRbGrid(FermionField, par().Ls); auto &grb5 = *envGetRbGrid(FermionField, par().Ls);
std::vector<Complex> boundary = strToVec<Complex>(par().boundary); typename MobiusFermion<FImpl>::ImplParams implParams;
typename MobiusFermion<FImpl>::ImplParams implParams(boundary); implParams.boundary_phases = strToVec<Complex>(par().boundary);
implParams.twist_n_2pi_L = strToVec<Real>(par().twist);
envCreateDerived(FMat, MobiusFermion<FImpl>, getName(), par().Ls, U, g5, envCreateDerived(FMat, MobiusFermion<FImpl>, getName(), par().Ls, U, g5,
grb5, g4, grb4, par().mass, par().M5, par().b, par().c, grb5, g4, grb4, par().mass, par().M5, par().b, par().c,
implParams); implParams);

View File

@ -48,7 +48,8 @@ public:
double , mass, double , mass,
double , M5, double , M5,
double , scale, double , scale,
std::string , boundary); std::string , boundary,
std::string , twist);
}; };
template <typename FImpl> template <typename FImpl>
@ -118,8 +119,9 @@ void TScaledDWF<FImpl>::setup(void)
auto &grb4 = *envGetRbGrid(FermionField); auto &grb4 = *envGetRbGrid(FermionField);
auto &g5 = *envGetGrid(FermionField, par().Ls); auto &g5 = *envGetGrid(FermionField, par().Ls);
auto &grb5 = *envGetRbGrid(FermionField, par().Ls); auto &grb5 = *envGetRbGrid(FermionField, par().Ls);
std::vector<Complex> boundary = strToVec<Complex>(par().boundary); typename ScaledShamirFermion<FImpl>::ImplParams implParams;
typename MobiusFermion<FImpl>::ImplParams implParams(boundary); implParams.boundary_phases = strToVec<Complex>(par().boundary);
implParams.twist_n_2pi_L = strToVec<Real>(par().twist);
envCreateDerived(FMat, ScaledShamirFermion<FImpl>, getName(), par().Ls, U, g5, envCreateDerived(FMat, ScaledShamirFermion<FImpl>, getName(), par().Ls, U, g5,
grb5, g4, grb4, par().mass, par().M5, par().scale, grb5, g4, grb4, par().mass, par().M5, par().scale,
implParams); implParams);

View File

@ -47,7 +47,9 @@ public:
GRID_SERIALIZABLE_CLASS_MEMBERS(WilsonPar, GRID_SERIALIZABLE_CLASS_MEMBERS(WilsonPar,
std::string, gauge, std::string, gauge,
double , mass, double , mass,
std::string, boundary); std::string, boundary,
std::string, string,
std::string, twist);
}; };
template <typename FImpl> template <typename FImpl>
@ -113,8 +115,9 @@ void TWilson<FImpl>::setup(void)
auto &U = envGet(GaugeField, par().gauge); auto &U = envGet(GaugeField, par().gauge);
auto &grid = *envGetGrid(FermionField); auto &grid = *envGetGrid(FermionField);
auto &gridRb = *envGetRbGrid(FermionField); auto &gridRb = *envGetRbGrid(FermionField);
std::vector<Complex> boundary = strToVec<Complex>(par().boundary); typename WilsonFermion<FImpl>::ImplParams implParams;
typename WilsonFermion<FImpl>::ImplParams implParams(boundary); implParams.boundary_phases = strToVec<Complex>(par().boundary);
implParams.twist_n_2pi_L = strToVec<Real>(par().twist);
envCreateDerived(FMat, WilsonFermion<FImpl>, getName(), 1, U, grid, gridRb, envCreateDerived(FMat, WilsonFermion<FImpl>, getName(), 1, U, grid, gridRb,
par().mass, implParams); par().mass, implParams);
} }

View File

@ -51,7 +51,8 @@ public:
double , csw_r, double , csw_r,
double , csw_t, double , csw_t,
WilsonAnisotropyCoefficients ,clover_anisotropy, WilsonAnisotropyCoefficients ,clover_anisotropy,
std::string, boundary std::string, boundary,
std::string, twist
); );
}; };
@ -119,8 +120,9 @@ void TWilsonClover<FImpl>::setup(void)
auto &U = envGet(GaugeField, par().gauge); auto &U = envGet(GaugeField, par().gauge);
auto &grid = *envGetGrid(FermionField); auto &grid = *envGetGrid(FermionField);
auto &gridRb = *envGetRbGrid(FermionField); auto &gridRb = *envGetRbGrid(FermionField);
std::vector<Complex> boundary = strToVec<Complex>(par().boundary); typename WilsonCloverFermion<FImpl>::ImplParams implParams;
typename WilsonCloverFermion<FImpl>::ImplParams implParams(boundary); implParams.boundary_phases = strToVec<Complex>(par().boundary);
implParams.twist_n_2pi_L = strToVec<Real>(par().twist);
envCreateDerived(FMat, WilsonCloverFermion<FImpl>, getName(), 1, U, grid, envCreateDerived(FMat, WilsonCloverFermion<FImpl>, getName(), 1, U, grid,
gridRb, par().mass, par().csw_r, par().csw_t, gridRb, par().mass, par().csw_r, par().csw_t,
par().clover_anisotropy, implParams); par().clover_anisotropy, implParams);

View File

@ -50,7 +50,8 @@ public:
double , b, double , b,
double , c, double , c,
std::vector<std::complex<double>>, omega, std::vector<std::complex<double>>, omega,
std::string , boundary); std::string , boundary,
std::string , twist);
}; };
template <typename FImpl> template <typename FImpl>
@ -127,8 +128,9 @@ void TZMobiusDWF<FImpl>::setup(void)
auto &g5 = *envGetGrid(FermionField, par().Ls); auto &g5 = *envGetGrid(FermionField, par().Ls);
auto &grb5 = *envGetRbGrid(FermionField, par().Ls); auto &grb5 = *envGetRbGrid(FermionField, par().Ls);
auto omega = par().omega; auto omega = par().omega;
std::vector<Complex> boundary = strToVec<Complex>(par().boundary); typename ZMobiusFermion<FImpl>::ImplParams implParams;
typename ZMobiusFermion<FImpl>::ImplParams implParams(boundary); implParams.boundary_phases = strToVec<Complex>(par().boundary);
implParams.twist_n_2pi_L = strToVec<Real>(par().twist);
envCreateDerived(FMat, ZMobiusFermion<FImpl>, getName(), par().Ls, U, g5, envCreateDerived(FMat, ZMobiusFermion<FImpl>, getName(), par().Ls, U, g5,
grb5, g4, grb4, par().mass, par().M5, omega, grb5, g4, grb4, par().mass, par().M5, omega,
par().b, par().c, implParams); par().b, par().c, implParams);

View File

@ -72,6 +72,7 @@ int main(int argc, char *argv[])
// set fermion boundary conditions to be periodic space, antiperiodic time. // set fermion boundary conditions to be periodic space, antiperiodic time.
std::string boundary = "1 1 1 -1"; std::string boundary = "1 1 1 -1";
std::string twist = "0. 0. 0. 0.";
//stochastic photon field //stochastic photon field
MGauge::StochEm::Par photonPar; MGauge::StochEm::Par photonPar;
@ -90,6 +91,7 @@ int main(int argc, char *argv[])
actionPar.M5 = 1.8; actionPar.M5 = 1.8;
actionPar.mass = mass[i]; actionPar.mass = mass[i];
actionPar.boundary = boundary; actionPar.boundary = boundary;
actionPar.twist = "0. 0. 0. 0.";
application.createModule<MAction::DWF>("DWF_" + flavour[i], actionPar); application.createModule<MAction::DWF>("DWF_" + flavour[i], actionPar);

View File

@ -126,6 +126,7 @@ inline void makeWilsonAction(Application &application, std::string actionName,
actionPar.gauge = gaugeField; actionPar.gauge = gaugeField;
actionPar.mass = mass; actionPar.mass = mass;
actionPar.boundary = boundary; actionPar.boundary = boundary;
actionPar.twist = "0. 0. 0. 0.";
application.createModule<MAction::Wilson>(actionName, actionPar); application.createModule<MAction::Wilson>(actionName, actionPar);
} }
} }
@ -154,6 +155,7 @@ inline void makeDWFAction(Application &application, std::string actionName,
actionPar.M5 = M5; actionPar.M5 = M5;
actionPar.mass = mass; actionPar.mass = mass;
actionPar.boundary = boundary; actionPar.boundary = boundary;
actionPar.twist = "0. 0. 0. 0.";
application.createModule<MAction::DWF>(actionName, actionPar); application.createModule<MAction::DWF>(actionName, actionPar);
} }
} }

View File

@ -66,6 +66,7 @@ int main(int argc, char *argv[])
// set fermion boundary conditions to be periodic space, antiperiodic time. // set fermion boundary conditions to be periodic space, antiperiodic time.
std::string boundary = "1 1 1 -1"; std::string boundary = "1 1 1 -1";
std::string twist = "0. 0. 0. 0.";
// sink // sink
MSink::Point::Par sinkPar; MSink::Point::Par sinkPar;
@ -80,6 +81,7 @@ int main(int argc, char *argv[])
actionPar.M5 = 1.8; actionPar.M5 = 1.8;
actionPar.mass = mass[i]; actionPar.mass = mass[i];
actionPar.boundary = boundary; actionPar.boundary = boundary;
actionPar.twist = twist;
application.createModule<MAction::DWF>("DWF_" + flavour[i], actionPar); application.createModule<MAction::DWF>("DWF_" + flavour[i], actionPar);
// solvers // solvers

View File

@ -72,6 +72,7 @@ int main(int argc, char *argv[])
// set fermion boundary conditions to be periodic space, antiperiodic time. // set fermion boundary conditions to be periodic space, antiperiodic time.
std::string boundary = "1 1 1 -1"; std::string boundary = "1 1 1 -1";
std::string twist = "0. 0. 0. 0.";
for (unsigned int i = 0; i < flavour.size(); ++i) for (unsigned int i = 0; i < flavour.size(); ++i)
{ {
@ -82,6 +83,7 @@ int main(int argc, char *argv[])
actionPar.M5 = 1.8; actionPar.M5 = 1.8;
actionPar.mass = mass[i]; actionPar.mass = mass[i];
actionPar.boundary = boundary; actionPar.boundary = boundary;
actionPar.twist = twist;
application.createModule<MAction::DWF>("DWF_" + flavour[i], actionPar); application.createModule<MAction::DWF>("DWF_" + flavour[i], actionPar);
// solvers // solvers