21 multi1d<LatticeColorMatrix>& ds_u,
22 multi1d<LatticeColorMatrix>& u_,
23 const LatticeFermion&
psi)
31 const multi1d<LatticeColorMatrix>&
u =
state->getLinks();
44 Real prefactor=Real(0.5);
48 LatticeColorMatrix u_tmp;
52 f_tmp = Gamma(1<<
mu)*Y;
57 LatticeFermion foo = shift(f_tmp,
FORWARD,
mu);
58 u_tmp = traceSpin(outerProduct(foo,
psi));
61 f_tmp = Gamma(1<<
mu)*
psi;
67 u_tmp -= traceSpin(outerProduct(foo,Y));
70 ds_u[
mu] = prefactor*(
u[
mu]*u_tmp );
76 int main(
int argc,
char *argv[])
82 const int nrow_arr[] = {2, 2, 2, 2};
83 multi1d<int> nrow(
Nd);
85 Layout::setLattSize(nrow);
89 multi1d<LatticeColorMatrix>
u(
Nd);
100 push(xml_out,
"t_monomial");
107 multi1d<LatticeColorMatrix> > > S_w;
111 XMLReader paramtop(param_in,
"/MonomialTest");
113 read(paramtop,
"Monomial", S_w);
116 QDPIO::cerr <<
"Error reading XML" << std::endl;
121 multi1d<LatticeColorMatrix>
p(
Nd);
130 S_w->refreshInternalFields(gauge_state);
133 multi1d<LatticeColorMatrix> dsdq(
Nd);
134 S_w->dsdq(dsdq, gauge_state);
137 Double monomial_S = S_w->S(gauge_state);
138 QDPIO::cout <<
"monomial_S = " << monomial_S << std::endl;
142 UnprecTwoFlavorWilsonFermMonomial& S_down =
dynamic_cast<UnprecTwoFlavorWilsonFermMonomial&
>(*S_w);
145 const LatticeFermion&
phi = S_down.debugGetPhi();
147 LatticeFermion X=
zero;
149 S_down.debugGetX(X, gauge_state);
153 QDPIO::cout <<
"My S = " << my_S << std::endl;
158 multi1d<LatticeColorMatrix> dsdq2(
Nd);
168 push(xml_out,
"dsdu");
169 write(xml_out,
"dsdu_1", dsdq[
mu]);
170 write(xml_out,
"dsdu_2", dsdq2[
mu]);
173 LatticeColorMatrix dsdu_diff=dsdq[
mu] - dsdq2[
mu];
175 Double sum_diff=norm2(dsdu_diff);
176 QDPIO::cout <<
"Mu = " <<
mu <<
" Sum Diff=" << sum_diff << std::endl;
178 push(xml_out,
"ForceDiff");
180 write(xml_out,
"dsdu_diff", dsdu_diff);
Primary include file for CHROMA in application codes.
virtual FermState< T, P, Q > * createState(const Q &q) const
Given links (coordinates Q) create the state needed for the linear operators.
const multi1d< LatticeColorMatrix > & getQ(void) const
Class for counted reference semantics.
Unpreconditioned Wilson fermion action.
UnprecLinearOperator< T, P, Q > * linOp(Handle< FermState< T, P, Q > > state) const
Produce a linear operator for this action.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams ¶m)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams ¶m)
Writer parameters.
void taproj(LatticeColorMatrix &a)
Take the traceless antihermitian projection of a color matrix.
void gaugeStartup(XMLReader &gauge_file_xml, XMLReader &gauge_xml, multi1d< LatticeColorMatrix > &u, Cfg_t &cfg)
Initialize the gauge fields.
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
static multi1d< LatticeColorMatrix > u
push(xml_out,"Condensates")
void initialize(int *argc, char ***argv)
Chroma initialisation routine.
void finalize(void)
Chroma finalization routine.
std::string getXMLInputFileName()
Get input file name.
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
XMLFileWriter & getXMLOutputInstance()
Get xml output instance.
const WilsonTypeFermAct< multi1d< LatticeFermion > > & S_f
FloatingPoint< double > Double
Gauge configuration structure.
bool linkage_hack()
To insure linking of code, place the registered code flags here.
int main(int argc, char *argv[])
void wilson_dsdu(const UnprecWilsonFermAct &S, multi1d< LatticeColorMatrix > &ds_u, multi1d< LatticeColorMatrix > &u_, const LatticeFermion &psi)
Old dsdu routine.