29#ifndef QCD_UTILS_COVARIANT_CSHIFT_H
30#define QCD_UTILS_COVARIANT_CSHIFT_H
45 return Link*
Cshift(field,mu,1);
53 tmp =
adj(Link)*field;
72 return Cshift(Link, mu, 1);
75 template<class gauge,class Expr,typename std::enable_if<is_lattice_expr<Expr>::value,
void>
::type * =
nullptr>
78 const Expr &expr) ->
decltype(
closure(expr))
83 template<class gauge,class Expr,typename std::enable_if<is_lattice_expr<Expr>::value,
void>
::type * =
nullptr>
86 const Expr &expr) ->
decltype(
closure(expr))
96 return Cshift(Link, mu, shift);
144 field_bc = where(coor==Lmu,
conjugate(field_bc),field_bc);
146 return Link*field_bc;
163 tmp =
adj(Link)*field;
164 tmp = where(coor==Lmu,
conjugate(tmp),tmp);
181 tmp = where(coor == Lmu,
conjugate(tmp), tmp);
182 return Cshift(tmp, mu, -1);
202 tmp =
Cshift(Link, mu, 1);
203 tmp = where(coor == Lmu,
conjugate(tmp), tmp);
207 template<class gauge,class Expr,typename std::enable_if<is_lattice_expr<Expr>::value,
void>
::type * =
nullptr>
210 const Expr &expr) ->
decltype(
closure(expr))
215 template<class gauge,class Expr,typename std::enable_if<is_lattice_expr<Expr>::value,
void>
::type * =
nullptr>
218 const Expr &expr) ->
decltype(
closure(expr))
245 assert(
abs(shift) < Lmu &&
"Invalid shift value");
252 tmp =
Cshift(Link, mu, shift);
253 tmp = where(coor >= Lmu-shift,
conjugate(tmp), tmp);
257 tmp = where(coor >= Lmu+shift,
conjugate(tmp), tmp);
258 return Cshift(tmp, mu, shift);
auto Cshift(const Expression &expr, int dim, int shift) -> decltype(closure(expr))
accelerator_inline Grid_simd< S, V > abs(const Grid_simd< S, V > &r)
auto closure(const LatticeUnaryExpression< Op, T1 > &expr) -> Lattice< typename std::remove_const< decltype(expr.op.func(vecEval(0, expr.arg1)))>::type >
void LatticeCoordinate(Lattice< iobj > &l, int mu)
Lattice< vobj > conjugate(const Lattice< vobj > &lhs)
Lattice< vobj > adj(const Lattice< vobj > &lhs)
#define NAMESPACE_BEGIN(A)
const Coordinate & GlobalDimensions(void)
GridBase * Grid(void) const
Lattice< gauge > CovShiftIdentityBackward(const Lattice< gauge > &Link, int mu)
Lattice< gauge > CshiftLink(const Lattice< gauge > &Link, int mu, int shift)
Lattice< covariant > CovShiftForward(const Lattice< gauge > &Link, int mu, const Lattice< covariant > &field)
Lattice< gauge > ShiftStaple(const Lattice< gauge > &Link, int mu)
Lattice< covariant > CovShiftBackward(const Lattice< gauge > &Link, int mu, const Lattice< covariant > &field)
Lattice< gauge > CovShiftIdentityForward(const Lattice< gauge > &Link, int mu)
Lattice< gauge > CovShiftIdentityForward(const Lattice< gauge > &Link, int mu)
Lattice< covariant > CovShiftForward(const Lattice< gauge > &Link, int mu, const Lattice< covariant > &field)
Lattice< gauge > ShiftStaple(const Lattice< gauge > &Link, int mu)
Lattice< gauge > CovShiftIdentityBackward(const Lattice< gauge > &Link, int mu)
Lattice< covariant > CovShiftBackward(const Lattice< gauge > &Link, int mu, const Lattice< covariant > &field)
Lattice< gauge > CshiftLink(const Lattice< gauge > &Link, int mu, int shift)