1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

ComplexField defined

This commit is contained in:
paboyle 2017-06-18 00:12:48 +01:00
parent b96daf53a0
commit ae39ec85a3

View File

@ -73,7 +73,7 @@ public:
////////////////////////////////////////////////// //////////////////////////////////////////////////
// trace of directed plaquette oriented in mu,nu plane // trace of directed plaquette oriented in mu,nu plane
////////////////////////////////////////////////// //////////////////////////////////////////////////
static void traceDirPlaquette(LatticeComplex &plaq, static void traceDirPlaquette(ComplexField &plaq,
const std::vector<GaugeMat> &U, const int mu, const std::vector<GaugeMat> &U, const int mu,
const int nu) { const int nu) {
GaugeMat sp(U[0]._grid); GaugeMat sp(U[0]._grid);
@ -83,9 +83,9 @@ public:
////////////////////////////////////////////////// //////////////////////////////////////////////////
// sum over all planes of plaquette // sum over all planes of plaquette
////////////////////////////////////////////////// //////////////////////////////////////////////////
static void sitePlaquette(LatticeComplex &Plaq, static void sitePlaquette(ComplexField &Plaq,
const std::vector<GaugeMat> &U) { const std::vector<GaugeMat> &U) {
LatticeComplex sitePlaq(U[0]._grid); ComplexField sitePlaq(U[0]._grid);
Plaq = zero; Plaq = zero;
for (int mu = 1; mu < Nd; mu++) { for (int mu = 1; mu < Nd; mu++) {
for (int nu = 0; nu < mu; nu++) { for (int nu = 0; nu < mu; nu++) {
@ -104,11 +104,11 @@ public:
U[mu] = PeekIndex<LorentzIndex>(Umu, mu); U[mu] = PeekIndex<LorentzIndex>(Umu, mu);
} }
LatticeComplex Plaq(Umu._grid); ComplexField Plaq(Umu._grid);
sitePlaquette(Plaq, U); sitePlaquette(Plaq, U);
TComplex Tp = sum(Plaq); auto Tp = sum(Plaq);
Complex p = TensorRemove(Tp); auto p = TensorRemove(Tp);
return p.real(); return p.real();
} }
@ -129,15 +129,15 @@ public:
static RealD linkTrace(const GaugeLorentz &Umu) { static RealD linkTrace(const GaugeLorentz &Umu) {
std::vector<GaugeMat> U(Nd, Umu._grid); std::vector<GaugeMat> U(Nd, Umu._grid);
LatticeComplex Tr(Umu._grid); ComplexField Tr(Umu._grid);
Tr = zero; Tr = zero;
for (int mu = 0; mu < Nd; mu++) { for (int mu = 0; mu < Nd; mu++) {
U[mu] = PeekIndex<LorentzIndex>(Umu, mu); U[mu] = PeekIndex<LorentzIndex>(Umu, mu);
Tr = Tr + trace(U[mu]); Tr = Tr + trace(U[mu]);
} }
TComplex Tp = sum(Tr); auto Tp = sum(Tr);
Complex p = TensorRemove(Tp); auto p = TensorRemove(Tp);
double vol = Umu._grid->gSites(); double vol = Umu._grid->gSites();
@ -330,8 +330,8 @@ public:
double coeff = 8.0/(32.0*M_PI*M_PI); double coeff = 8.0/(32.0*M_PI*M_PI);
LatticeComplex qfield = coeff*trace(Bx*Ex + By*Ey + Bz*Ez); ComplexField qfield = coeff*trace(Bx*Ex + By*Ey + Bz*Ez);
TComplex Tq = sum(qfield); auto Tq = sum(qfield);
return TensorRemove(Tq).real(); return TensorRemove(Tq).real();
} }
@ -350,16 +350,16 @@ public:
adj(Gimpl::CovShiftForward( adj(Gimpl::CovShiftForward(
U[nu], nu, Gimpl::CovShiftForward(U[nu], nu, U[mu]))); U[nu], nu, Gimpl::CovShiftForward(U[nu], nu, U[mu])));
} }
static void traceDirRectangle(LatticeComplex &rect, static void traceDirRectangle(ComplexField &rect,
const std::vector<GaugeMat> &U, const int mu, const std::vector<GaugeMat> &U, const int mu,
const int nu) { const int nu) {
GaugeMat sp(U[0]._grid); GaugeMat sp(U[0]._grid);
dirRectangle(sp, U, mu, nu); dirRectangle(sp, U, mu, nu);
rect = trace(sp); rect = trace(sp);
} }
static void siteRectangle(LatticeComplex &Rect, static void siteRectangle(ComplexField &Rect,
const std::vector<GaugeMat> &U) { const std::vector<GaugeMat> &U) {
LatticeComplex siteRect(U[0]._grid); ComplexField siteRect(U[0]._grid);
Rect = zero; Rect = zero;
for (int mu = 1; mu < Nd; mu++) { for (int mu = 1; mu < Nd; mu++) {
for (int nu = 0; nu < mu; nu++) { for (int nu = 0; nu < mu; nu++) {
@ -379,12 +379,12 @@ public:
U[mu] = PeekIndex<LorentzIndex>(Umu, mu); U[mu] = PeekIndex<LorentzIndex>(Umu, mu);
} }
LatticeComplex Rect(Umu._grid); ComplexField Rect(Umu._grid);
siteRectangle(Rect, U); siteRectangle(Rect, U);
TComplex Tp = sum(Rect); auto Tp = sum(Rect);
Complex p = TensorRemove(Tp); auto p = TensorRemove(Tp);
return p.real(); return p.real();
} }
////////////////////////////////////////////////// //////////////////////////////////////////////////