35 int main(
int argc,
char **argv)
40 QDPIO::cout <<
"linkage=" <<
linkage_hack() << std::endl;
43 multi1d<int> nrow(
Nd);
44 for(
int i=0;
i <
Nd-1;
i++) {
50 Layout::setLattSize(nrow);
53 QDPIO::cout <<
"t_temp_prec" << std::endl;
57 multi1d<LatticeColorMatrix>
u(
Nd);
58 XMLReader gauge_file_xml, gauge_xml;
65 push(xml_out,
"t_temp_prec");
70 MesPlq(xml_out,
"Observables",
u);
74 XMLReader xml_in(
"./t_solver_accum.ini.xml");
80 XMLReader paramtop(xml_in,
"/Params");
89 QDPIO::cout <<
"fermact group read" << std::endl;
94 QDPIO::cout <<
"inv_param_group read" << std::endl;
97 read(paramtop,
"./Approximation", rat_approx_param);
98 QDPIO::cout <<
"Approx Read" << std::endl;
101 QDPIO::cerr <<
"XML Error returned : " << e << std::endl;
106 typedef LatticeFermion
T;
107 typedef multi1d<LatticeColorMatrix>
P;
108 typedef multi1d<LatticeColorMatrix>
Q;
111 std::istringstream fermact_xml_is( fermact_group.
xml);
112 XMLReader fermact_reader(fermact_xml_is);
117 fermact_group.
path) );
128 const Subset& subset = M->subset();
134 LatticeFermion psi1, psi2;
138 approx_reader(pfe, ipfe);
141 QDPIO::cout <<
"Working With PFE: A = " << pfe.
norm << std::endl;
142 for(
int i=0;
i < pfe.
pole.size();
i++) {
143 QDPIO::cout <<
" res["<<
i<<
"]=" << pfe.
res[
i] <<
" pole[" <<
i
144 <<
"]=" << pfe.
pole[
i] << std::endl;
150 multi1d<LatticeFermion> temp_ferms(pfe.
pole.size());
151 for(
int i=0;
i < temp_ferms.size();
i++) {
152 temp_ferms[
i][subset] =
zero;
154 (*multi_solver)(temp_ferms, pfe.
pole,rhs);
157 psi1[subset] = pfe.
norm*rhs;
159 for(
int i=0;
i < temp_ferms.size();
i++) {
160 psi1[subset] += pfe.
res[
i] * temp_ferms[
i];
165 (*multi_solver_acc)(psi2,
174 diff[subset] = psi1-psi2;
175 Double n1 = sqrt(norm2(diff, subset));
176 Double n2 = sqrt(norm2(psi1, subset));
178 QDPIO::cout <<
"|| psi1 - psi2 ||=" << n1 << std::endl;
179 QDPIO::cout <<
"|| psi1 - psi2 ||/||psi1||= " << n1/n2 << std::endl;
186 std::istringstream fermact_5d_xml_is( fermact_5d_group.
xml);
187 XMLReader fermact_5d_reader(fermact_5d_xml_is);
192 fermact_5d_group.
path) );
203 const Subset& sub5 = M5->subset();
204 const int N5 = M5->size();
206 multi1d<LatticeFermion> psi5(
N5);
207 multi1d<LatticeFermion> psi5_2(
N5);
208 multi1d<LatticeFermion> rhs5(
N5);
209 for(
int n=0;
n <
N5;
n++) {
210 psi5[
n][sub5] =
zero;
211 psi5_2[
n][sub5] =
zero;
216 multi1d<multi1d<LatticeFermion> > tmp5(pfe.
pole.size());
217 for(
int i=0;
i< pfe.
pole.size();
i++) {
219 for(
int n=0;
n <
N5;
n++) {
224 (*multi_solver_5d)(tmp5, pfe.
pole, rhs5);
226 for(
int n=0;
n <
N5;
n++) {
227 psi5[
n][sub5] = pfe.
norm*rhs5[
n];
229 for(
int i=0;
i < pfe.
pole.size();
i++) {
230 for(
int n=0;
n <
N5;
n++) {
231 psi5[
n][sub5] += pfe.
res[
i] * tmp5[
i][
n];
236 (*multi_solver_acc_5d)(psi5_2, pfe.
norm, pfe.
res, pfe.
pole, rhs5);
238 multi1d<LatticeFermion> diff5(
N5);
239 for(
int n=0;
n <
N5;
n++) {
240 diff5[
n][sub5] = psi5_2[
n] - psi5[
n];
242 Double norm5_diff = norm2(diff5, sub5);
243 Double norm5_psi = norm2(psi5, sub5);
244 QDPIO::cout <<
"|| psi5_1 - psi5_2 ||=" << norm5_diff << std::endl;
245 QDPIO::cout <<
"|| psi5_1 - psi5_2 ||/||psi5_1||= " << norm5_diff/norm5_psi << std::endl;
249 QDPIO::cerr <<
"Caught exception: " << e << std::endl;
Primary include file for CHROMA in application codes.
Class for counted reference semantics.
Remez type of rational approximations.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams ¶m)
Read 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 proginfo(XMLWriter &xml)
Print out basic information about this program.
GroupXML_t readXMLGroup(XMLReader &xml_in, const std::string &path, const std::string &type_name)
Read group and return as a std::string.
Register MdagM system solvers.
Register MdagM system solvers.
multi1d< LatticeColorMatrix > P
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
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.
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
XMLFileWriter & getXMLOutputInstance()
Get xml output instance.
FloatingPoint< double > Double
Remez-type rational approximation.
Gauge configuration structure.
Hold group xml and type id.
Params for Remez type rational approximation.
Convenient structure to package Remez coeffs.
bool linkage_hack()
To insure linking of code, place the registered code flags here.
int main(int argc, char **argv)