22 BinaryFileReader cfg_in(file);
27 multi1d<int> lattsize_cb = Layout::lattSize();
31 for(
int s=0;
s <
q.size(); ++
s)
33 for(
int cb=0;
cb < 2; ++
cb)
35 for(
int sitecb=0; sitecb < Layout::vol()/2; ++sitecb)
37 multi1d<int>
coord = crtesn(sitecb, lattsize_cb);
41 for(
int m=1;
m<
Nd;
m++)
57 int main(
int argc,
char **argv)
63 const int foo[] = {4,4,4,4};
64 multi1d<int> nrow(
Nd);
66 Layout::setLattSize(nrow);
69 XMLFileWriter xml(
"t_dwflinop.xml");
70 push(xml,
"t_dwflinop");
73 multi1d<LatticeColorMatrix>
u(
Nd);
75 for(
int m=0;
m <
u.size(); ++
m)
83 const int bnd[] = {1,1,1,1};
84 multi1d<int> boundary(
Nd);
88 typedef LatticeFermion
T;
89 typedef multi1d<LatticeColorMatrix>
P;
90 typedef multi1d<LatticeColorMatrix>
Q;
95 Real WilsonMass = 1.5;
111 for(
int m=0;
m <
N5; ++
m)
114 for(
int m=0;
m <
N5; ++
m)
121 multi1d<LatticeFermion> tmp1(
N5);
124 for(
int m=1;
m <
N5; ++
m)
127 multi1d<LatticeFermion>
tmp2(
N5);
130 for(
int m=1;
m <
N5; ++
m)
133 push(xml,
"innerprods");
134 write(xml,
"norm_psi", Real(norm2(
psi)));
135 write(xml,
"norm_chi", Real(norm2(
chi)));
136 write(xml,
"nn1", nn1);
137 write(xml,
"nn2", nn2);
146 UnprecDWFermAct S_f_dwf(cfs, WilsonMass, m_q);
147 LatticeDWFermion psi5, chi5, tmp1a;
149 for(
int m=0;
m <
N5; ++
m)
151 pokeDW(psi5,
psi[
m],
m);
152 pokeDW(chi5,
chi[
m],
m);
153 pokeDW(tmp1a, tmp1[
m],
m);
156 const LinearOperatorProxy<LatticeDWFermion> B(S_f_dwf.linOp(
u));
158 LatticeDWFermion tmp5a;
159 B(tmp5a, psi5,
PLUS);
162 LatticeDWFermion tmp5b;
163 B(tmp5b, chi5,
MINUS);
166 push(xml,
"innerprods_dwf");
167 write(xml,
"norm_psi5", Real(norm2(psi5)));
168 write(xml,
"norm_chi5", Real(norm2(chi5)));
169 write(xml,
"nd1", nd1);
170 write(xml,
"nd2", nd2);
171 write(xml,
"norm_tmp1_tmp1a", Real(norm2(tmp5a-tmp1a)));
179 QDPIO::cout <<
"|psi|^2 = " << norm2(
psi) << std::endl;
180 QDPIO::cout <<
"|chi|^2 = " << norm2(
chi) << std::endl;
184 QDPIO::cout <<
"|chi|^2 = " << norm2(
chi) << std::endl;
192 multi1d<LatticeFermion> psi2(
N5), chi2(
N5);
197 for(
int m=0;
m <
N5; ++
m)
199 tmp1[
m] = psi2[
m] -
psi[
m];
203 QDPIO::cout <<
"|psi2-psi|^2 = " << norm2(tmp1) << std::endl;
204 QDPIO::cout <<
"|chi2-chi|^2 = " << norm2(
tmp2) << std::endl;
207 LatticePropagator quark_propagator, quark_prop_source;
208 XMLBufferWriter xml_buf;
211 quark_prop_source = 1;
212 quark_propagator =
zero;
214 quarkProp4(quark_propagator, xml_buf, quark_prop_source,
217 LatticePropagator q2;
221 QDPIO::cout <<
"|quark_prop|^2 = " << norm2(quark_propagator) << std::endl;
222 QDPIO::cout <<
"|q2|^2 = " << norm2(q2) << std::endl;
223 QDPIO::cout <<
"|q2-quark_prop|^2 = " << norm2(q2-quark_propagator) << std::endl;
Primary include file for CHROMA in application codes.
Create a simple ferm connection state.
Class for counted reference semantics.
Unpreconditioned domain-wall fermion action.
Unpreconditioned Extended-Overlap (N&N) linear operator.
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.
SystemSolverResults_t InvCG2(const LinearOperator< LatticeFermionF > &M, const LatticeFermionF &chi, LatticeFermionF &psi, const Real &RsdCG, int MaxCG)
Conjugate-Gradient (CGNE) algorithm for a generic Linear Operator.
void readSzinFerm(LatticeFermion &q, const std::string &file)
Read a SZIN fermion. This is a simple memory dump reader.
void readSzinQprop(XMLReader &xml, LatticePropagator &q, const std::string &file)
Read a SZIN propagator file. This is a simple memory dump reader.
void readSzin(SzinGauge_t &header, multi1d< LatticeColorMatrix > &u, const std::string &cfg_file)
Read a SZIN configuration file.
void quarkProp4(LatticeStaggeredPropagator &q_sol, XMLWriter &xml_out, const LatticeStaggeredPropagator &q_src, const StaggeredTypeFermAct< LatticeStaggeredFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > &S_f, Handle< FermState< LatticeStaggeredFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > state, const GroupXML_t &invParam, QuarkSpinType quarkSpinType, int &ncg_had)
Given a complete propagator as a source, this does all the inversions needed.
multi1d< LatticeColorMatrix > P
BinaryReturn< C1, C2, FnInnerProduct >::Type_t innerProduct(const QDPSubType< T1, C1 > &s1, const QDPType< T2, C2 > &s2)
Asqtad Staggered-Dirac operator.
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > const multi1d< Real > enum InvType invType const multi1d< Real > & RsdCG
QDP_error_exit("too many BiCG iterations", n_count, rsd_sq, cp, c, re_rvr, im_rvr, re_a, im_a, re_b, im_b)
static multi1d< LatticeColorMatrix > u
LinOpSysSolverMGProtoClover::Q Q
push(xml_out,"Condensates")
LinOpSysSolverMGProtoClover::T T
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > const multi1d< Real > enum InvType invType const multi1d< Real > int MaxCG
void initialize(int *argc, char ***argv)
Chroma initialisation routine.
void finalize(void)
Chroma finalization routine.
multi1d< LatticeFermion > chi(Ncb)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
const WilsonTypeFermAct< multi1d< LatticeFermion > > & S_f
multi1d< LatticeFermion > s(Ncb)
int main(int argc, char **argv)