38 typedef LatticeFermion
T;
39 typedef multi1d<LatticeColorMatrix>
Q;
40 typedef multi1d<LatticeColorMatrix>
P;
42 typedef LatticeFermionF
TF;
43 typedef multi1d<LatticeColorMatrixF>
QF;
44 typedef multi1d<LatticeColorMatrixF>
PF;
46 std::istringstream is(
p.fermact.xml);
62 multi1d<Real> shifts(n_shifts);
63 shifts[0] = 1.51480322230288e-05 ;
64 shifts[1] = 0.000165259114300968 ;
65 shifts[2] = 0.000661184012887753 ;
66 shifts[3] = 0.00214955953261573 ;
67 shifts[4] = 0.00657190811374048 ;
68 shifts[5] = 0.0197043312297316 ;
69 shifts[6] = 0.0587640674448055 ;
70 shifts[7] = 0.175534749714768 ;
71 shifts[8] = 0.529999019144126 ;
72 shifts[9] = 1.6565878795396 ;
73 shifts[10] = 5.78532483906374 ;
74 shifts[11] = 30.6835527589452 ;
76 multi1d<Real>
RsdCG(shifts.size());
77 if (
p.invParam.RsdTarget.size() == 1) {
78 RsdCG =
p.invParam.RsdTarget[0];
80 else if (
p.invParam.RsdTarget.size() ==
RsdCG.size()) {
82 RsdCG =
p.invParam.RsdTarget;
86 QDPIO::cerr <<
"MdagMMultiSysSolverCGChronoClover: shifts incompatible" << std::endl;
96 multi1d<LatticeFermion>
psi(n_shifts);
97 for(
int i=0;
i < n_shifts;
i++){
109 for(
int i=0;
i < n_shifts;
i++) {
111 r[D_op->subset()]=
chi;
112 LatticeFermion tmp1,
tmp2;
115 tmp2[D_op->subset()] += shifts[
i]*
psi[
i];
116 r[D_op->subset()] -=
tmp2;
117 Double norm = norm2(
r, D_op->subset())/norm2(
chi, D_op->subset());
119 QDPIO::cout <<
"soln "<<
i <<
" : RsdCG=" <<
RsdCG[
i] <<
" r=" << sqrt(
norm) << std::endl;
121 QDPIO::cout <<
"MinvCG: n_count = " << res.
n_count <<
" Time=" << swatch.getTimeInSeconds() << std::endl;
129 for(
int i=0;
i < n_shifts;
i++) {
131 r[D_op->subset()]=
chi;
132 LatticeFermion tmp1,
tmp2;
135 tmp2[D_op->subset()] += shifts[
i]*
psi[
i];
136 r[D_op->subset()] -=
tmp2;
137 Double norm = norm2(
r, D_op->subset())/norm2(
chi, D_op->subset());
139 QDPIO::cout <<
"soln "<<
i <<
" : RsdCG=" <<
RsdCG[
i] <<
" r=" << sqrt(
norm) << std::endl;
141 QDPIO::cout <<
"Chrono: n_count = " << res2.
n_count <<
" Time=" << swatch.getTimeInSeconds() << std::endl;
149 read(
r,
"Cfg",
p.inputCfg);
151 read(
r,
"InvertParam",
p.invParam);
166 int main(
int argc,
char **argv)
170 QDPIO::cout <<
"Linkage = " <<
linkageHack() << std::endl;
183 QDPIO::cerr <<
"Caught Exception reading XML: " << e << std::endl;
186 Layout::setLattSize(
params.nrow);
189 multi1d<LatticeColorMatrix>
u(
Nd);
190 XMLReader gauge_file_xml, gauge_xml;
197 push(xml_out,
"t_invert");
198 push(xml_out,
"params");
203 MesPlq(xml_out,
"Observables",
u);
Primary include file for CHROMA in application codes.
Class for counted reference semantics.
Solve a CG2 system. Here, the operator is NOT assumed to be hermitian.
Parameters for Clover fermion action.
Even-odd preconditioned Clover fermion linear operator.
All ferm create-state method.
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 unitarityCheck(const multi1d< LatticeColorMatrixF3 > &u)
Check the unitarity of color matrix in SU(N)
void gaugeStartup(XMLReader &gauge_file_xml, XMLReader &gauge_xml, multi1d< LatticeColorMatrix > &u, Cfg_t &cfg)
Initialize the gauge fields.
void MInvCG2(const LinearOperator< LatticeFermionF > &M, const LatticeFermionF &chi, multi1d< LatticeFermionF > &psi, const multi1d< RealF > &shifts, const multi1d< RealF > &RsdCG, int MaxCG, int &n_count)
GroupXML_t readXMLGroup(XMLReader &xml_in, const std::string &path, const std::string &type_name)
Read group and return as a std::string.
Multishift Conjugate-Gradient algorithm for a Linear Operator.
Solve a MdagM*psi=chi linear system by CG2 using CG.
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
multi1d< LatticeColorMatrix > P
Asqtad Staggered-Dirac operator.
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > const multi1d< Real > enum InvType invType const multi1d< Real > & RsdCG
static multi1d< LatticeColorMatrix > u
LinOpSysSolverMGProtoClover::Q Q
push(xml_out,"Condensates")
LinOpSysSolverMGProtoClover::T T
void initialize(int *argc, char ***argv)
Chroma initialisation routine.
void finalize(void)
Chroma finalization routine.
multi1d< LatticeFermion > chi(Ncb)
std::string getXMLInputFileName()
Get input file name.
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
XMLFileWriter & getXMLOutputInstance()
Get xml output instance.
const WilsonTypeFermAct< multi1d< LatticeFermion > > & S_f
FloatingPoint< double > Double
MultiSysSolverCGChronoCloverParams invParam
Gauge configuration structure.
Hold group xml and type id.
Holds return info from SystemSolver call.
Factory for solving M*psi=chi where M is not hermitian or pos. def.
void checkInverter(const AppParams &p, multi1d< LatticeColorMatrix > &u)
int main(int argc, char **argv)
multi1d< LatticeColorMatrixF > QF
multi1d< LatticeColorMatrixF > PF
Read an XML group as a std::string.