mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-13 20:57:06 +01:00
Merge branch 'develop' into feature/bgq-asm
This commit is contained in:
@ -28,130 +28,152 @@ Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
||||
/* END LEGAL */
|
||||
#include <Grid/Grid.h>
|
||||
|
||||
namespace Grid {
|
||||
|
||||
GRID_SERIALIZABLE_ENUM(myenum, undef, red, 1, blue, 2, green, 3);
|
||||
|
||||
class myclass: Serializable {
|
||||
public:
|
||||
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(myclass,
|
||||
myenum, e,
|
||||
std::vector<myenum>, ve,
|
||||
std::string, name,
|
||||
int, x,
|
||||
double, y,
|
||||
bool , b,
|
||||
std::vector<double>, array,
|
||||
std::vector<std::vector<double>>, twodimarray,
|
||||
);
|
||||
|
||||
myclass() {}
|
||||
myclass(int i)
|
||||
: array(4,5.1), twodimarray(3,std::vector<double>(2,1.23456)), ve(2, myenum::blue)
|
||||
{
|
||||
e=myenum::red;
|
||||
x=i;
|
||||
y=2*i;
|
||||
b=true;
|
||||
name="bother said pooh";
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
using namespace Grid;
|
||||
|
||||
int16_t i16 = 1;
|
||||
GRID_SERIALIZABLE_ENUM(myenum, undef, red, 1, blue, 2, green, 3);
|
||||
|
||||
class myclass: Serializable {
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(myclass,
|
||||
myenum, e,
|
||||
std::vector<myenum>, ve,
|
||||
std::string, name,
|
||||
int, x,
|
||||
double, y,
|
||||
bool , b,
|
||||
std::vector<double>, array,
|
||||
std::vector<std::vector<double>>, twodimarray,
|
||||
std::vector<std::vector<std::vector<Complex>>>, cmplx3darray
|
||||
);
|
||||
myclass() {}
|
||||
myclass(int i)
|
||||
: array(4,5.1)
|
||||
, twodimarray(3,std::vector<double>(5, 1.23456))
|
||||
, cmplx3darray(3,std::vector<std::vector<Complex>>(5, std::vector<Complex>(7, Complex(1.2, 3.4))))
|
||||
, ve(2, myenum::blue)
|
||||
{
|
||||
e=myenum::red;
|
||||
x=i;
|
||||
y=2*i;
|
||||
b=true;
|
||||
name="bother said pooh";
|
||||
}
|
||||
};
|
||||
|
||||
int16_t i16 = 1;
|
||||
uint16_t u16 = 2;
|
||||
int32_t i32 = 3;
|
||||
int32_t i32 = 3;
|
||||
uint32_t u32 = 4;
|
||||
int64_t i64 = 5;
|
||||
int64_t i64 = 5;
|
||||
uint64_t u64 = 6;
|
||||
float f = M_PI;
|
||||
double d = 2*M_PI;
|
||||
bool b = false;
|
||||
float f = M_PI;
|
||||
double d = 2*M_PI;
|
||||
bool b = false;
|
||||
|
||||
template <typename W, typename R, typename O>
|
||||
void ioTest(const std::string &filename, const O &object, const std::string &name)
|
||||
{
|
||||
// writer needs to be destroyed so that writing physically happens
|
||||
{
|
||||
W writer(filename);
|
||||
|
||||
write(writer, "testobject", object);
|
||||
}
|
||||
|
||||
R reader(filename);
|
||||
O buf;
|
||||
bool good;
|
||||
|
||||
read(reader, "testobject", buf);
|
||||
good = (object == buf);
|
||||
std::cout << name << " IO test: " << (good ? "success" : "failure");
|
||||
std::cout << std::endl;
|
||||
if (!good) exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
int main(int argc,char **argv)
|
||||
{
|
||||
{
|
||||
XmlWriter WR("bother.xml");
|
||||
|
||||
// test basic type writing
|
||||
push(WR,"BasicTypes");
|
||||
write(WR,std::string("i16"),i16);
|
||||
write(WR,"u16",u16);
|
||||
write(WR,"i32",i32);
|
||||
write(WR,"u32",u32);
|
||||
write(WR,"i64",i64);
|
||||
write(WR,"u64",u64);
|
||||
write(WR,"f",f);
|
||||
write(WR,"d",d);
|
||||
write(WR,"b",b);
|
||||
pop(WR);
|
||||
|
||||
// test serializable class writing
|
||||
myclass obj(1234); // non-trivial constructor
|
||||
write(WR,"obj",obj);
|
||||
WR.write("obj2", obj);
|
||||
std::cout << obj << std::endl;
|
||||
|
||||
std::vector<myclass> vec;
|
||||
vec.push_back(myclass(1234));
|
||||
vec.push_back(myclass(5678));
|
||||
vec.push_back(myclass(3838));
|
||||
write(WR, "objvec", vec);
|
||||
};
|
||||
std::cout << "==== basic IO" << std::endl;
|
||||
XmlWriter WR("bother.xml");
|
||||
|
||||
// test basic type writing
|
||||
std::cout << "-- basic writing to 'bother.xml'..." << std::endl;
|
||||
push(WR,"BasicTypes");
|
||||
write(WR,std::string("i16"),i16);
|
||||
write(WR,"u16",u16);
|
||||
write(WR,"i32",i32);
|
||||
write(WR,"u32",u32);
|
||||
write(WR,"i64",i64);
|
||||
write(WR,"u64",u64);
|
||||
write(WR,"f",f);
|
||||
write(WR,"d",d);
|
||||
write(WR,"b",b);
|
||||
pop(WR);
|
||||
|
||||
// test serializable class writing
|
||||
myclass obj(1234); // non-trivial constructor
|
||||
std::vector<myclass> vec;
|
||||
|
||||
std::cout << "-- serialisable class writing to 'bother.xml'..." << std::endl;
|
||||
write(WR,"obj",obj);
|
||||
WR.write("obj2", obj);
|
||||
vec.push_back(myclass(1234));
|
||||
vec.push_back(myclass(5678));
|
||||
vec.push_back(myclass(3838));
|
||||
write(WR, "objvec", vec);
|
||||
std::cout << "-- serialisable class writing to std::cout:" << std::endl;
|
||||
std::cout << obj << std::endl;
|
||||
std::cout << "-- serialisable class comparison:" << std::endl;
|
||||
std::cout << "vec[0] == obj: " << ((vec[0] == obj) ? "true" : "false") << std::endl;
|
||||
std::cout << "vec[1] == obj: " << ((vec[1] == obj) ? "true" : "false") << std::endl;
|
||||
|
||||
// read tests
|
||||
myclass copy1, copy2, copy3;
|
||||
std::vector<myclass> veccopy1, veccopy2, veccopy3;
|
||||
std::cout << "\n==== IO self-consistency tests" << std::endl;
|
||||
//// XML
|
||||
{
|
||||
XmlReader RD("bother.xml");
|
||||
read(RD,"obj",copy1);
|
||||
read(RD,"objvec", veccopy1);
|
||||
std::cout << "Loaded (XML) -----------------" << std::endl;
|
||||
std::cout << copy1 << std::endl << veccopy1 << std::endl;
|
||||
}
|
||||
ioTest<XmlWriter, XmlReader>("iotest.xml", obj, "XML (object) ");
|
||||
ioTest<XmlWriter, XmlReader>("iotest.xml", vec, "XML (vector of objects)");
|
||||
//// binary
|
||||
{
|
||||
BinaryWriter BWR("bother.bin");
|
||||
write(BWR,"discard",copy1 );
|
||||
write(BWR,"discard",veccopy1 );
|
||||
}
|
||||
{
|
||||
BinaryReader BRD("bother.bin");
|
||||
read (BRD,"discard",copy2 );
|
||||
read (BRD,"discard",veccopy2 );
|
||||
std::cout << "Loaded (bin) -----------------" << std::endl;
|
||||
std::cout << copy2 << std::endl << veccopy2 << std::endl;
|
||||
}
|
||||
ioTest<BinaryWriter, BinaryReader>("iotest.bin", obj, "binary (object) ");
|
||||
ioTest<BinaryWriter, BinaryReader>("iotest.bin", vec, "binary (vector of objects)");
|
||||
//// text
|
||||
{
|
||||
TextWriter TWR("bother.txt");
|
||||
write(TWR,"discard",copy1 );
|
||||
write(TWR,"discard",veccopy1 );
|
||||
}
|
||||
{
|
||||
TextReader TRD("bother.txt");
|
||||
read (TRD,"discard",copy3 );
|
||||
read (TRD,"discard",veccopy3 );
|
||||
std::cout << "Loaded (txt) -----------------" << std::endl;
|
||||
std::cout << copy3 << std::endl << veccopy3 << std::endl;
|
||||
}
|
||||
ioTest<TextWriter, TextReader>("iotest.dat", obj, "text (object) ");
|
||||
ioTest<TextWriter, TextReader>("iotest.dat", vec, "text (vector of objects)");
|
||||
//// HDF5
|
||||
#ifdef HAVE_HDF5
|
||||
ioTest<Hdf5Writer, Hdf5Reader>("iotest.h5", obj, "HDF5 (object) ");
|
||||
ioTest<Hdf5Writer, Hdf5Reader>("iotest.h5", vec, "HDF5 (vector of objects)");
|
||||
#endif
|
||||
|
||||
std::vector<int> iv = strToVec<int>("1 2 2 4");
|
||||
std::vector<std::string> sv = strToVec<std::string>("bli bla blu");
|
||||
std::cout << "\n==== vector flattening/reconstruction" << std::endl;
|
||||
typedef std::vector<std::vector<std::vector<double>>> vec3d;
|
||||
|
||||
for (auto &e: iv)
|
||||
vec3d dv, buf;
|
||||
double d = 0.;
|
||||
|
||||
dv.resize(4);
|
||||
for (auto &v1: dv)
|
||||
{
|
||||
std::cout << e << " ";
|
||||
v1.resize(3);
|
||||
for (auto &v2: v1)
|
||||
{
|
||||
v2.resize(5);
|
||||
for (auto &x: v2)
|
||||
{
|
||||
x = d++;
|
||||
}
|
||||
}
|
||||
}
|
||||
std::cout << std::endl;
|
||||
for (auto &e: sv)
|
||||
{
|
||||
std::cout << e << " ";
|
||||
}
|
||||
std::cout << std::endl;
|
||||
std::cout << "original 3D vector:" << std::endl;
|
||||
std::cout << dv << std::endl;
|
||||
|
||||
Flatten<vec3d> flatdv(dv);
|
||||
|
||||
std::cout << "\ndimensions:" << std::endl;
|
||||
std::cout << flatdv.getDim() << std::endl;
|
||||
std::cout << "\nflattened vector:" << std::endl;
|
||||
std::cout << flatdv.getFlatVector() << std::endl;
|
||||
|
||||
Reconstruct<vec3d> rec(flatdv.getFlatVector(), flatdv.getDim());
|
||||
std::cout << "\nreconstructed vector:" << std::endl;
|
||||
std::cout << flatdv.getVector() << std::endl;
|
||||
}
|
||||
|
@ -36,12 +36,12 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT
|
||||
};
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
typedef DomainWallFermion<DomainWallVec5dImplR> DomainWallVecFermionR;
|
||||
typedef ZMobiusFermion<ZDomainWallVec5dImplR> ZMobiusVecFermionR;
|
||||
@ -340,7 +340,7 @@ void TestMoo(This & Dw, That &sDw)
|
||||
LatticeFermion ndiff(ngrid);
|
||||
LatticeFermion sdiff(sgrid);
|
||||
|
||||
Gamma g5( Gamma::Gamma5 );
|
||||
Gamma g5( Gamma::Algebra::Gamma5 );
|
||||
|
||||
std::vector<int> seeds({1,2,3,4,5,7,8});
|
||||
GridParallelRNG RNG5(ngrid);
|
||||
|
@ -36,11 +36,11 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
int main (int argc, char ** argv)
|
||||
|
@ -36,11 +36,11 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
int main (int argc, char ** argv)
|
||||
|
@ -37,11 +37,11 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
int toint(const char* str){
|
||||
|
@ -36,11 +36,11 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
|
||||
|
@ -37,11 +37,11 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
|
||||
|
@ -37,11 +37,11 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
typedef WilsonFermion5D<DomainWallVec5dImplR> WilsonFermion5DR;
|
||||
|
@ -177,7 +177,7 @@ int main (int argc, char ** argv)
|
||||
const int sdir=0;
|
||||
RealD mass=0.01;
|
||||
RealD M5 =1.0;
|
||||
Gamma G5(Gamma::Gamma5);
|
||||
Gamma G5(Gamma::Algebra::Gamma5);
|
||||
|
||||
GridCartesian * FGrid = SpaceTimeGrid::makeFiveDimGrid(Ls,&GRID);
|
||||
GridRedBlackCartesian * FrbGrid = SpaceTimeGrid::makeFiveDimRedBlackGrid(Ls,&GRID);
|
||||
@ -218,12 +218,12 @@ int main (int argc, char ** argv)
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// work out the predicted from Fourier
|
||||
/////////////////////////////////////////////////////////////////
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT,
|
||||
Gamma::Gamma5
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT,
|
||||
Gamma::Algebra::Gamma5
|
||||
};
|
||||
LatticeFermionD Kinetic(FGrid); Kinetic = zero;
|
||||
LatticeComplexD kmu(FGrid);
|
||||
@ -311,7 +311,7 @@ int main (int argc, char ** argv)
|
||||
std::cout << " Solving by FFT and Feynman rules" <<std::endl;
|
||||
Ddwf.FreePropagator(src,ref,mass) ;
|
||||
|
||||
Gamma G5(Gamma::Gamma5);
|
||||
Gamma G5(Gamma::Algebra::Gamma5);
|
||||
|
||||
LatticeFermionD src5(FGrid); src5=zero;
|
||||
LatticeFermionD tmp5(FGrid);
|
||||
@ -391,7 +391,7 @@ int main (int argc, char ** argv)
|
||||
std::cout << " Solving by FFT and Feynman rules" <<std::endl;
|
||||
Dov.FreePropagator(src,ref,mass) ;
|
||||
|
||||
Gamma G5(Gamma::Gamma5);
|
||||
Gamma G5(Gamma::Algebra::Gamma5);
|
||||
|
||||
LatticeFermionD src5(FGrid); src5=zero;
|
||||
LatticeFermionD tmp5(FGrid);
|
||||
|
@ -1,223 +1,283 @@
|
||||
/*************************************************************************************
|
||||
/*************************************************************************************
|
||||
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
Grid physics library, www.github.com/paboyle/Grid
|
||||
|
||||
Source file: ./tests/Test_gamma.cc
|
||||
Source file: ./tests/Test_gamma.cc
|
||||
|
||||
Copyright (C) 2015
|
||||
Copyright (C) 2015-2017
|
||||
|
||||
Author: Azusa Yamaguchi <ayamaguc@staffmail.ed.ac.uk>
|
||||
Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
||||
Author: Antonin Portelli <antonin.portelli@ed.ac.uk>
|
||||
|
||||
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 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.
|
||||
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.
|
||||
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
|
||||
*************************************************************************************/
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid/Grid.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace Grid;
|
||||
using namespace Grid::QCD;
|
||||
using namespace QCD;
|
||||
|
||||
//template<class vobj> class is_pod< iScalar<vobj> >
|
||||
//{
|
||||
//
|
||||
//};
|
||||
static constexpr double tolerance = 1.0e-6;
|
||||
static std::array<SpinMatrix, Gamma::nGamma> testAlgebra;
|
||||
|
||||
int main (int argc, char ** argv)
|
||||
void print(const SpinMatrix &g)
|
||||
{
|
||||
for(int i = 0; i < Ns; i++)
|
||||
{
|
||||
std::cout << GridLogMessage << "(";
|
||||
for(int j=0;j<Ns;j++){
|
||||
if ( abs(g()(i,j)()) == 0 ) {
|
||||
std::cout<< " 0";
|
||||
} else if ( abs(g()(i,j)() - Complex(0,1)) == 0){
|
||||
std::cout<< " i";
|
||||
} else if ( abs(g()(i,j)() + Complex(0,1)) == 0){
|
||||
std::cout<< "-i";
|
||||
} else if ( abs(g()(i,j)() - Complex(1,0)) == 0){
|
||||
std::cout<< " 1";
|
||||
} else if ( abs(g()(i,j)() + Complex(1,0)) == 0){
|
||||
std::cout<< "-1";
|
||||
}
|
||||
std::cout<<((j == Ns-1) ? ")" : "," );
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
std::cout << GridLogMessage << std::endl;
|
||||
}
|
||||
|
||||
void createTestAlgebra(void)
|
||||
{
|
||||
std::array<SpinMatrix, 4> testg;
|
||||
SpinMatrix testg5;
|
||||
const Complex I(0., 1.), mI(0., -1.);
|
||||
|
||||
testg[0] = zero;
|
||||
testg[0]()(0, 3) = I;
|
||||
testg[0]()(1, 2) = I;
|
||||
testg[0]()(2, 1) = mI;
|
||||
testg[0]()(3, 0) = mI;
|
||||
std::cout << GridLogMessage << "test GammaX= " << std::endl;
|
||||
print(testg[0]);
|
||||
testg[1] = zero;
|
||||
testg[1]()(0, 3) = -1.;
|
||||
testg[1]()(1, 2) = 1.;
|
||||
testg[1]()(2, 1) = 1.;
|
||||
testg[1]()(3, 0) = -1.;
|
||||
std::cout << GridLogMessage << "test GammaY= " << std::endl;
|
||||
print(testg[1]);
|
||||
testg[2] = zero;
|
||||
testg[2]()(0, 2) = I;
|
||||
testg[2]()(1, 3) = mI;
|
||||
testg[2]()(2, 0) = mI;
|
||||
testg[2]()(3, 1) = I;
|
||||
std::cout << GridLogMessage << "test GammaZ= " << std::endl;
|
||||
print(testg[2]);
|
||||
testg[3] = zero;
|
||||
testg[3]()(0, 2) = 1.;
|
||||
testg[3]()(1, 3) = 1.;
|
||||
testg[3]()(2, 0) = 1.;
|
||||
testg[3]()(3, 1) = 1.;
|
||||
std::cout << GridLogMessage << "test GammaT= " << std::endl;
|
||||
print(testg[3]);
|
||||
testg5 = testg[0]*testg[1]*testg[2]*testg[3];
|
||||
|
||||
#define DEFINE_TEST_G(g, exp)\
|
||||
testAlgebra[Gamma::Algebra::g] = exp;\
|
||||
testAlgebra[Gamma::Algebra::Minus##g] = -exp;\
|
||||
|
||||
DEFINE_TEST_G(Identity , 1.);
|
||||
DEFINE_TEST_G(Gamma5 , testg5);
|
||||
DEFINE_TEST_G(GammaX , testg[0]);
|
||||
DEFINE_TEST_G(GammaY , testg[1]);
|
||||
DEFINE_TEST_G(GammaZ , testg[2]);
|
||||
DEFINE_TEST_G(GammaT , testg[3]);
|
||||
DEFINE_TEST_G(GammaXGamma5, testg[0]*testg5);
|
||||
DEFINE_TEST_G(GammaYGamma5, testg[1]*testg5);
|
||||
DEFINE_TEST_G(GammaZGamma5, testg[2]*testg5);
|
||||
DEFINE_TEST_G(GammaTGamma5, testg[3]*testg5);
|
||||
DEFINE_TEST_G(SigmaXY , .5*(testg[0]*testg[1] - testg[1]*testg[0]));
|
||||
DEFINE_TEST_G(SigmaXZ , .5*(testg[0]*testg[2] - testg[2]*testg[0]));
|
||||
DEFINE_TEST_G(SigmaXT , .5*(testg[0]*testg[3] - testg[3]*testg[0]));
|
||||
DEFINE_TEST_G(SigmaYZ , .5*(testg[1]*testg[2] - testg[2]*testg[1]));
|
||||
DEFINE_TEST_G(SigmaYT , .5*(testg[1]*testg[3] - testg[3]*testg[1]));
|
||||
DEFINE_TEST_G(SigmaZT , .5*(testg[2]*testg[3] - testg[3]*testg[2]));
|
||||
|
||||
#undef DEFINE_TEST_G
|
||||
}
|
||||
|
||||
template <typename Expr>
|
||||
void test(const Expr &a, const Expr &b)
|
||||
{
|
||||
if (norm2(a - b) < tolerance)
|
||||
{
|
||||
std::cout << "[OK] ";
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "[fail]" << std::endl;
|
||||
std::cout << GridLogError << "a= " << a << std::endl;
|
||||
std::cout << GridLogError << "is different (tolerance= " << tolerance << ") from " << std::endl;
|
||||
std::cout << GridLogError << "b= " << b << std::endl;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
void checkGamma(const Gamma::Algebra a, GridSerialRNG &rng)
|
||||
{
|
||||
SpinVector v;
|
||||
SpinMatrix m, &testg = testAlgebra[a];
|
||||
Gamma g(a);
|
||||
bool pass = true;
|
||||
|
||||
random(rng, v);
|
||||
random(rng, m);
|
||||
|
||||
std::cout << GridLogMessage << "Checking " << Gamma::name[a] << ": ";
|
||||
std::cout << "vecmul ";
|
||||
test(g*v, testg*v);
|
||||
std::cout << "matlmul ";
|
||||
test(g*m, testg*m);
|
||||
std::cout << "matrmul ";
|
||||
test(m*g, m*testg);
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
void checkProd(const Gamma::Algebra a, const Gamma::Algebra b)
|
||||
{
|
||||
SpinMatrix gm, testg = testAlgebra[a]*testAlgebra[b];
|
||||
Gamma g = Gamma(a)*Gamma(b);
|
||||
bool pass = true;
|
||||
|
||||
std::cout << GridLogMessage << "Checking " << Gamma::name[a] << " * "
|
||||
<< Gamma::name[b] << ": ";
|
||||
gm = 1.0;
|
||||
gm = g*gm;
|
||||
test(gm, testg);
|
||||
std::cout << "(= " << Gamma::name[g.g] << ")" << std::endl;
|
||||
}
|
||||
|
||||
void checkAdj(const Gamma::Algebra a)
|
||||
{
|
||||
SpinMatrix gm, testg = adj(testAlgebra[a]);
|
||||
Gamma g(adj(Gamma(a)));
|
||||
bool pass = true;
|
||||
|
||||
std::cout << GridLogMessage << "Checking adj(" << Gamma::name[a] << "): ";
|
||||
gm = 1.0;
|
||||
gm = g*gm;
|
||||
test(gm, testg);
|
||||
std::cout << "(= " << Gamma::name[g.g] << ")" << std::endl;
|
||||
}
|
||||
|
||||
void checkProject(GridSerialRNG &rng)
|
||||
{
|
||||
SpinVector rv, recon, full;
|
||||
HalfSpinVector hsp, hsm;
|
||||
|
||||
random(rng, rv);
|
||||
|
||||
#define CHECK_PROJ(dir, gamma)\
|
||||
std::cout << GridLogMessage << "Checking " << #dir << " projector: ";\
|
||||
spProj##dir(hsm,rv);\
|
||||
spRecon##dir(recon,hsm);\
|
||||
test(recon, rv + Gamma(Gamma::Algebra::gamma)*rv);\
|
||||
std::cout << std::endl;
|
||||
|
||||
CHECK_PROJ(Xp, GammaX);
|
||||
CHECK_PROJ(Yp, GammaY);
|
||||
CHECK_PROJ(Zp, GammaZ);
|
||||
CHECK_PROJ(Tp, GammaT);
|
||||
CHECK_PROJ(5p, Gamma5);
|
||||
CHECK_PROJ(Xm, MinusGammaX);
|
||||
CHECK_PROJ(Ym, MinusGammaY);
|
||||
CHECK_PROJ(Zm, MinusGammaZ);
|
||||
CHECK_PROJ(Tm, MinusGammaT);
|
||||
CHECK_PROJ(5m, MinusGamma5);
|
||||
|
||||
#undef CHECK_PROJ
|
||||
}
|
||||
|
||||
void checkGammaL(const Gamma::Algebra a, GridSerialRNG &rng)
|
||||
{
|
||||
SpinVector v;
|
||||
SpinMatrix m, &testg = testAlgebra[a], pl;
|
||||
GammaL gl(a);
|
||||
bool pass = true;
|
||||
|
||||
random(rng, v);
|
||||
random(rng, m);
|
||||
|
||||
pl = testAlgebra[Gamma::Algebra::Identity]
|
||||
- testAlgebra[Gamma::Algebra::Gamma5];
|
||||
std::cout << GridLogMessage << "Checking left-projected " << Gamma::name[a] << ": ";
|
||||
std::cout << "vecmul ";
|
||||
test(gl*v, testg*pl*v);
|
||||
std::cout << "matlmul ";
|
||||
test(gl*m, testg*pl*m);
|
||||
std::cout << "matrmul ";
|
||||
test(m*gl, m*testg*pl);
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Grid_init(&argc,&argv);
|
||||
|
||||
|
||||
std::vector<int> latt_size = GridDefaultLatt();
|
||||
std::vector<int> simd_layout = GridDefaultSimd(4,vComplex::Nsimd());
|
||||
std::vector<int> mpi_layout = GridDefaultMpi();
|
||||
|
||||
GridCartesian Grid(latt_size,simd_layout,mpi_layout);
|
||||
|
||||
GridParallelRNG pRNG(&Grid);
|
||||
pRNG.SeedRandomDevice();
|
||||
|
||||
GridSerialRNG sRNG;
|
||||
|
||||
GridCartesian Grid(latt_size,simd_layout,mpi_layout);
|
||||
GridSerialRNG sRNG;
|
||||
|
||||
sRNG.SeedRandomDevice();
|
||||
|
||||
SpinMatrix ident; ident=zero;
|
||||
SpinMatrix rnd ; random(sRNG,rnd);
|
||||
|
||||
SpinMatrix ll; ll=zero;
|
||||
SpinMatrix rr; rr=zero;
|
||||
SpinMatrix result;
|
||||
|
||||
SpinVector lv; random(sRNG,lv);
|
||||
SpinVector rv; random(sRNG,rv);
|
||||
|
||||
// std::cout<<GridLogMessage << " Is pod " << std::is_pod<SpinVector>::value << std::endl;
|
||||
// std::cout<<GridLogMessage << " Is pod double " << std::is_pod<double>::value << std::endl;
|
||||
// std::cout<<GridLogMessage << " Is pod ComplexF " << std::is_pod<ComplexF>::value << std::endl;
|
||||
// std::cout<<GridLogMessage << " Is triv double " << std::has_trivial_default_constructor<double>::value << std::endl;
|
||||
// std::cout<<GridLogMessage << " Is triv ComplexF " << std::has_trivial_default_constructor<ComplexF>::value << std::endl;
|
||||
// std::cout<<GridLogMessage << " Is pod Scalar<double> " << std::is_pod<iScalar<double> >::value << std::endl;
|
||||
// std::cout<<GridLogMessage << " Is pod Scalar<ComplexF> " << std::is_pod<iScalar<ComplexF> >::value << std::endl;
|
||||
// std::cout<<GridLogMessage << " Is pod Scalar<vComplexF> " << std::is_pod<iScalar<vComplexF> >::value << std::endl;
|
||||
// std::cout<<GridLogMessage << " Is pod Scalar<vComplexD> " << std::is_pod<iScalar<vComplexD> >::value << std::endl;
|
||||
// std::cout<<GridLogMessage << " Is pod Scalar<vRealF> " << std::is_pod<iScalar<vRealF> >::value << std::endl;
|
||||
// std::cout<<GridLogMessage << " Is pod Scalar<vRealD> " << std::is_pod<iScalar<vRealD> >::value << std::endl;
|
||||
// std::cout<<GridLogMessage << " Is triv Scalar<double> " <<std::has_trivial_default_constructor<iScalar<double> >::value << std::endl;
|
||||
// std::cout<<GridLogMessage << " Is triv Scalar<vComplexD> "<<std::has_trivial_default_constructor<iScalar<vComplexD> >::value << std::endl;
|
||||
|
||||
for(int a=0;a<Ns;a++){
|
||||
ident()(a,a) = ComplexF(1.0);
|
||||
|
||||
std::cout << GridLogMessage << "======== Test algebra" << std::endl;
|
||||
createTestAlgebra();
|
||||
std::cout << GridLogMessage << "======== Multiplication operators check" << std::endl;
|
||||
for (int i = 0; i < Gamma::nGamma; ++i)
|
||||
{
|
||||
checkGamma(i, sRNG);
|
||||
}
|
||||
|
||||
const Gamma::GammaMatrix *g = Gamma::GammaMatrices;
|
||||
const char **list = Gamma::GammaMatrixNames;
|
||||
|
||||
result =ll*Gamma(g[0])*rr;
|
||||
result =ll*Gamma(g[0]);
|
||||
rv = Gamma(g[0])*lv;
|
||||
|
||||
for(int mu=0;mu<12;mu++){
|
||||
|
||||
result = Gamma(g[mu])* ident;
|
||||
|
||||
for(int i=0;i<Ns;i++){
|
||||
|
||||
if(i==0) std::cout<<GridLogMessage << list[mu];
|
||||
else std::cout<<GridLogMessage << list[12];
|
||||
|
||||
std::cout<<"(";
|
||||
for(int j=0;j<Ns;j++){
|
||||
if ( abs(result()(i,j)())==0 ) {
|
||||
std::cout<< " 0";
|
||||
} else if ( abs(result()(i,j)() - Complex(0,1))==0){
|
||||
std::cout<< " i";
|
||||
} else if ( abs(result()(i,j)() + Complex(0,1))==0){
|
||||
std::cout<< "-i";
|
||||
} else if ( abs(result()(i,j)() - Complex(1,0))==0){
|
||||
std::cout<< " 1";
|
||||
} else if ( abs(result()(i,j)() + Complex(1,0))==0){
|
||||
std::cout<< "-1";
|
||||
}
|
||||
std::cout<<((j==Ns-1) ? ")" : "," );
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
std::cout << std::endl;
|
||||
|
||||
std::cout << GridLogMessage << std::endl;
|
||||
std::cout << GridLogMessage << "======== Algebra multiplication table check" << std::endl;
|
||||
for (int i = 0; i < Gamma::nGamma; ++i)
|
||||
for (int j = 0; j < Gamma::nGamma; ++j)
|
||||
{
|
||||
checkProd(i, j);
|
||||
}
|
||||
|
||||
std::cout << "Testing Gamma^2 - 1 = 0"<<std::endl;
|
||||
for(int mu=0;mu<6;mu++){
|
||||
result = Gamma(g[mu])* ident * Gamma(g[mu]);
|
||||
result = result - ident;
|
||||
RealD mag = norm2(result);
|
||||
std::cout << list[mu]<<" " << mag<<std::endl;
|
||||
std::cout << GridLogMessage << std::endl;
|
||||
std::cout << GridLogMessage << "======== Adjoints check" << std::endl;
|
||||
for (int i = 0; i < Gamma::nGamma; ++i)
|
||||
{
|
||||
checkAdj(i);
|
||||
}
|
||||
|
||||
std::cout << "Testing (MinusGamma + G )M = 0"<<std::endl;
|
||||
for(int mu=0;mu<6;mu++){
|
||||
result = rnd * Gamma(g[mu]);
|
||||
result = result + rnd * Gamma(g[mu+6]);
|
||||
RealD mag = norm2(result);
|
||||
std::cout << list[mu]<<" " << mag<<std::endl;
|
||||
std::cout << GridLogMessage << std::endl;
|
||||
std::cout << GridLogMessage << "======== Spin projectors check" << std::endl;
|
||||
checkProject(sRNG);
|
||||
std::cout << GridLogMessage << std::endl;
|
||||
std::cout << GridLogMessage << "======== Gamma-left matrices check" << std::endl;
|
||||
for (int i = 0; i < Gamma::nGamma; ++i)
|
||||
{
|
||||
checkGammaL(i, sRNG);
|
||||
}
|
||||
|
||||
std::cout << "Testing M(MinusGamma + G ) = 0"<<std::endl;
|
||||
for(int mu=0;mu<6;mu++){
|
||||
result = Gamma(g[mu]) *rnd;
|
||||
result = result + Gamma(g[mu+6])*rnd;
|
||||
RealD mag = norm2(result);
|
||||
std::cout << list[mu]<<" " << mag<<std::endl;
|
||||
}
|
||||
|
||||
// Testing spins and reconstructs
|
||||
SpinVector recon; random(sRNG,rv);
|
||||
SpinVector full;
|
||||
HalfSpinVector hsp,hsm;
|
||||
|
||||
// Xp
|
||||
double mag;
|
||||
spProjXp(hsm,rv);
|
||||
spReconXp(recon,hsm);
|
||||
full = rv + Gamma(Gamma::GammaX) *rv;
|
||||
mag = TensorRemove(norm2(full-recon));
|
||||
std::cout << "Xp "<< mag<<std::endl;
|
||||
|
||||
// Xm
|
||||
spProjXm(hsm,rv);
|
||||
spReconXm(recon,hsm);
|
||||
full = rv - Gamma(Gamma::GammaX) *rv;
|
||||
mag = TensorRemove(norm2(full-recon));
|
||||
std::cout << "Xm "<< mag<<std::endl;
|
||||
|
||||
// Yp
|
||||
spProjYp(hsm,rv);
|
||||
spReconYp(recon,hsm);
|
||||
full = rv + Gamma(Gamma::GammaY) *rv;
|
||||
mag = TensorRemove(norm2(full-recon));
|
||||
std::cout << "Yp "<< mag<<std::endl;
|
||||
|
||||
// Ym
|
||||
spProjYm(hsm,rv);
|
||||
spReconYm(recon,hsm);
|
||||
full = rv - Gamma(Gamma::GammaY) *rv;
|
||||
mag = TensorRemove(norm2(full-recon));
|
||||
std::cout << "Ym "<< mag<<std::endl;
|
||||
|
||||
// Zp
|
||||
spProjZp(hsm,rv);
|
||||
spReconZp(recon,hsm);
|
||||
full = rv + Gamma(Gamma::GammaZ) *rv;
|
||||
mag = TensorRemove(norm2(full-recon));
|
||||
std::cout << "Zp "<< mag<<std::endl;
|
||||
|
||||
// Zm
|
||||
spProjZm(hsm,rv);
|
||||
spReconZm(recon,hsm);
|
||||
full = rv - Gamma(Gamma::GammaZ) *rv;
|
||||
mag = TensorRemove(norm2(full-recon));
|
||||
std::cout << "Zm "<< mag<<std::endl;
|
||||
|
||||
// Tp
|
||||
spProjTp(hsm,rv);
|
||||
spReconTp(recon,hsm);
|
||||
full = rv + Gamma(Gamma::GammaT) *rv;
|
||||
mag = TensorRemove(norm2(full-recon));
|
||||
std::cout << "Tp "<< mag<<std::endl;
|
||||
|
||||
// Tm
|
||||
spProjTm(hsm,rv);
|
||||
spReconTm(recon,hsm);
|
||||
full = rv - Gamma(Gamma::GammaT) *rv;
|
||||
mag = TensorRemove(norm2(full-recon));
|
||||
std::cout << "Tm "<< mag<<std::endl;
|
||||
|
||||
// 5p
|
||||
spProj5p(hsm,rv);
|
||||
spRecon5p(recon,hsm);
|
||||
full = rv + Gamma(Gamma::Gamma5) *rv;
|
||||
mag = TensorRemove(norm2(full-recon));
|
||||
std::cout << "5p "<< mag<<std::endl;
|
||||
|
||||
// 5m
|
||||
spProj5m(hsm,rv);
|
||||
spRecon5m(recon,hsm);
|
||||
full = rv - Gamma(Gamma::Gamma5) *rv;
|
||||
mag = TensorRemove(norm2(full-recon));
|
||||
std::cout << "5m "<< mag<<std::endl;
|
||||
|
||||
|
||||
Grid_finalize();
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
@ -37,11 +37,11 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
int main (int argc, char ** argv)
|
||||
|
@ -36,11 +36,11 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
int main (int argc, char ** argv)
|
||||
|
@ -37,11 +37,11 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
template<class What>
|
||||
|
@ -38,11 +38,11 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
int main (int argc, char ** argv)
|
||||
|
@ -36,11 +36,11 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
AM_LDFLAGS += -L../../extras/hadrons
|
||||
AM_LDFLAGS += -L../../extras/Hadrons
|
||||
|
||||
include Make.inc
|
||||
|
@ -30,6 +30,14 @@
|
||||
using namespace Grid;
|
||||
using namespace Hadrons;
|
||||
|
||||
static Gamma::Algebra gmu[4] =
|
||||
{
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
// initialization //////////////////////////////////////////////////////////
|
||||
@ -102,7 +110,7 @@ int main(int argc, char *argv[])
|
||||
seqName.push_back(std::vector<std::string>(Nd));
|
||||
for (unsigned int mu = 0; mu < Nd; ++mu)
|
||||
{
|
||||
seqPar.gamma = 0x1 << mu;
|
||||
seqPar.gamma = gmu[mu];
|
||||
seqName[i][mu] = "G" + std::to_string(seqPar.gamma)
|
||||
+ "_" + std::to_string(seqPar.tA) + "-"
|
||||
+ qName[i];
|
||||
@ -127,9 +135,11 @@ int main(int argc, char *argv[])
|
||||
for (unsigned int i = 0; i < flavour.size(); ++i)
|
||||
for (unsigned int j = i; j < flavour.size(); ++j)
|
||||
{
|
||||
mesPar.output = "mesons/Z2_" + flavour[i] + flavour[j];
|
||||
mesPar.q1 = qName[i];
|
||||
mesPar.q2 = qName[j];
|
||||
mesPar.output = "mesons/Z2_" + flavour[i] + flavour[j];
|
||||
mesPar.q1 = qName[i];
|
||||
mesPar.q2 = qName[j];
|
||||
mesPar.gammaSource = Gamma::Algebra::Gamma5;
|
||||
mesPar.gammaSink = Gamma::Algebra::Gamma5;
|
||||
application.createModule<MContraction::Meson>("meson_Z2_"
|
||||
+ std::to_string(t)
|
||||
+ "_"
|
||||
|
@ -25,7 +25,7 @@ Author: Azusa Yamaguchi <ayamaguc@staffmail.ed.ac.uk>
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid.h>
|
||||
#include <Grid/Grid.h>
|
||||
|
||||
double calc_grid_p (Grid::QCD::LatticeGaugeField & lat);
|
||||
double calc_chroma_p (Grid::QCD::LatticeGaugeField & lat);
|
||||
|
@ -26,7 +26,7 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
|
||||
See the full license in the file "LICENSE" in the top level distribution directory
|
||||
*************************************************************************************/
|
||||
/* END LEGAL */
|
||||
#include <Grid.h>
|
||||
#include <Grid/Grid.h>
|
||||
|
||||
int Ls=8;
|
||||
double M5=1.6;
|
||||
|
@ -36,11 +36,11 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
int main (int argc, char ** argv)
|
||||
|
@ -36,11 +36,11 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
|
||||
|
@ -37,8 +37,8 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu[] = {Gamma::GammaX, Gamma::GammaY, Gamma::GammaZ,
|
||||
Gamma::GammaT};
|
||||
Gamma::Algebra Gmu[] = {Gamma::Algebra::GammaX, Gamma::Algebra::GammaY, Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT};
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
Grid_init(&argc, &argv);
|
||||
|
@ -36,11 +36,11 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
int main (int argc, char ** argv)
|
||||
|
@ -36,11 +36,11 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
int main (int argc, char ** argv)
|
||||
|
@ -37,11 +37,11 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
int main (int argc, char ** argv)
|
||||
|
@ -38,11 +38,11 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
int main (int argc, char ** argv)
|
||||
|
@ -504,7 +504,7 @@ int main (int argc, char ** argv)
|
||||
GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds4);
|
||||
GridParallelRNG CRNG(Coarse5d);CRNG.SeedFixedIntegers(cseeds);
|
||||
|
||||
Gamma g5(Gamma::Gamma5);
|
||||
Gamma g5(Gamma::Algebra::Gamma5);
|
||||
|
||||
LatticeFermion src(FGrid); gaussian(RNG5,src);// src=src+g5*src;
|
||||
LatticeFermion result(FGrid); result=zero;
|
||||
|
@ -36,11 +36,11 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
int main (int argc, char ** argv)
|
||||
|
@ -36,11 +36,11 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
int main (int argc, char ** argv)
|
||||
|
@ -37,11 +37,11 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
int main (int argc, char ** argv)
|
||||
|
@ -36,11 +36,11 @@ struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::GammaMatrix Gmu [] = {
|
||||
Gamma::GammaX,
|
||||
Gamma::GammaY,
|
||||
Gamma::GammaZ,
|
||||
Gamma::GammaT
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
int main (int argc, char ** argv)
|
||||
|
Reference in New Issue
Block a user