mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-12 20:27:06 +01:00
Optional Twisted BC's added, in "DoubleStore" for WilsonImpl.
Untested but doesn't affect answers when twists are all zero. The zero is the default behaviour for ImplParams.
This commit is contained in:
@ -44,12 +44,15 @@ namespace QCD {
|
|||||||
|
|
||||||
struct WilsonImplParams {
|
struct WilsonImplParams {
|
||||||
bool overlapCommsCompute;
|
bool overlapCommsCompute;
|
||||||
|
std::vector<Real> twist_n_2pi_L;
|
||||||
std::vector<Complex> boundary_phases;
|
std::vector<Complex> boundary_phases;
|
||||||
WilsonImplParams() : overlapCommsCompute(false) {
|
WilsonImplParams() : overlapCommsCompute(false) {
|
||||||
boundary_phases.resize(Nd, 1.0);
|
boundary_phases.resize(Nd, 1.0);
|
||||||
|
twist_n_2pi_L.resize(Nd, 0.0);
|
||||||
};
|
};
|
||||||
WilsonImplParams(const std::vector<Complex> phi)
|
WilsonImplParams(const std::vector<Complex> phi) : boundary_phases(phi), overlapCommsCompute(false) {
|
||||||
: boundary_phases(phi), overlapCommsCompute(false) {}
|
twist_n_2pi_L.resize(Nd, 0.0);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct StaggeredImplParams {
|
struct StaggeredImplParams {
|
||||||
|
@ -240,16 +240,30 @@ namespace QCD {
|
|||||||
GaugeLinkField tmp(GaugeGrid);
|
GaugeLinkField tmp(GaugeGrid);
|
||||||
|
|
||||||
Lattice<iScalar<vInteger> > coor(GaugeGrid);
|
Lattice<iScalar<vInteger> > coor(GaugeGrid);
|
||||||
|
////////////////////////////////////////////////////
|
||||||
|
// apply any boundary phase or twists
|
||||||
|
////////////////////////////////////////////////////
|
||||||
for (int mu = 0; mu < Nd; mu++) {
|
for (int mu = 0; mu < Nd; mu++) {
|
||||||
|
|
||||||
auto pha = Params.boundary_phases[mu];
|
////////// boundary phase /////////////
|
||||||
scalar_type phase( real(pha),imag(pha) );
|
auto pha = Params.boundary_phases[mu];
|
||||||
|
scalar_type phase( real(pha),imag(pha) );
|
||||||
|
|
||||||
int Lmu = GaugeGrid->GlobalDimensions()[mu] - 1;
|
int L = GaugeGrid->GlobalDimensions()[mu];
|
||||||
|
int Lmu = L - 1;
|
||||||
|
|
||||||
LatticeCoordinate(coor, mu);
|
LatticeCoordinate(coor, mu);
|
||||||
|
|
||||||
U = PeekIndex<LorentzIndex>(Umu, mu);
|
U = PeekIndex<LorentzIndex>(Umu, mu);
|
||||||
|
|
||||||
|
// apply any twists
|
||||||
|
RealD theta = Params.twist_n_2pi_L[mu] * 2*M_PI / L;
|
||||||
|
if ( theta != 0.0) {
|
||||||
|
scalar_type twphase(::cos(theta),::sin(theta));
|
||||||
|
U = twphase*U;
|
||||||
|
std::cout << GridLogMessage << " Twist ["<<mu<<"] "<< Params.twist_n_2pi_L[mu]<< " phase"<<phase <<std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
tmp = where(coor == Lmu, phase * U, U);
|
tmp = where(coor == Lmu, phase * U, U);
|
||||||
PokeIndex<LorentzIndex>(Uds, tmp, mu);
|
PokeIndex<LorentzIndex>(Uds, tmp, mu);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user