39 typedef LatticeFermion
T;
40 typedef multi1d<LatticeColorMatrix>
Q;
41 typedef multi1d<LatticeColorMatrix>
P;
43 typedef LatticeFermionF
TF;
44 typedef multi1d<LatticeColorMatrixF>
QF;
45 typedef multi1d<LatticeColorMatrixF>
PF;
47 std::istringstream is(
p.fermact.xml);
62 multi1d<Real> shifts(n_shifts);
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(n_shifts);
77 for(
int i=0;
i < n_shifts;
i++) {
83 MdagMMultiSysSolverCGQudaClover mprec(D_op, connect_state,
p.invParam);
90 multi1d<LatticeFermion>
psi(n_shifts);
91 for(
int i=0;
i < n_shifts;
i++){
104 for(
int i=0;
i < n_shifts;
i++) {
106 r[D_op->subset()]=
chi;
107 LatticeFermion tmp1,
tmp2;
110 tmp2[D_op->subset()] += shifts[
i]*
psi[
i];
111 r[D_op->subset()] -=
tmp2;
112 Double norm = norm2(
r, D_op->subset())/norm2(
chi, D_op->subset());
114 QDPIO::cout <<
"soln "<<
i <<
" : RsdCG=" <<
RsdCG[
i] <<
" r=" << sqrt(
norm) << std::endl;
116 QDPIO::cout <<
"MinvCG: n_count = " << res.
n_count <<
" Time=" << swatch.getTimeInSeconds() << std::endl;
124 for(
int i=0;
i < n_shifts;
i++) {
126 r[D_op->subset()]=
chi;
127 LatticeFermion tmp1,
tmp2;
130 tmp2[D_op->subset()] += shifts[
i]*
psi[
i];
131 r[D_op->subset()] -=
tmp2;
132 Double norm = norm2(
r, D_op->subset())/norm2(
chi, D_op->subset());
134 QDPIO::cout <<
"soln "<<
i <<
" : RsdCG=" <<
RsdCG[
i] <<
" r=" << sqrt(
norm) << std::endl;
136 QDPIO::cout <<
"Chrono: n_count = " << res2.
n_count <<
" Time=" << swatch.getTimeInSeconds() << std::endl;
144 read(
r,
"Cfg",
p.inputCfg);
146 read(
r,
"InvertParam",
p.invParam);
161 int main(
int argc,
char **argv)
165 QDPIO::cout <<
"Linkage = " <<
linkageHack() << std::endl;
178 QDPIO::cerr <<
"Caught Exception reading XML: " << e << std::endl;
181 Layout::setLattSize(
params.nrow);
184 multi1d<LatticeColorMatrix>
u(
Nd);
185 XMLReader gauge_file_xml, gauge_xml;
192 push(xml_out,
"t_invert");
193 push(xml_out,
"params");
198 MesPlq(xml_out,
"Observables",
u);
Primary include file for CHROMA in application codes.
Class for counted reference semantics.
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
MultiSysSolverQUDACloverParams 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.