28 int main(
int argc,
char **argv)
37 read(xml_in,
"/WilsonRitzEigen", input);
40 QDPIO::cerr <<
"Caught Exception: " << e << std::endl;
45 Layout::setLattSize(input.
nrow);
51 QDPIO::cout <<
"RitzEigen" << std::endl;
53 multi1d<LatticeColorMatrix>
u(
Nd);
54 XMLReader gauge_file_xml, gauge_xml;
58 push(xml_out,
"RitzEigen");
62 write(xml_out,
"Input", xml_in);
63 write(xml_out,
"Config_info", gauge_xml);
70 MesPlq(xml_out,
"Observables",
u);
74 std::istringstream xml_fermact_string(input.
fermact);
75 XMLReader fermacttop(xml_fermact_string);
80 read(fermacttop, fermact_path +
"/FermAct", fermact);
84 QDPIO::cerr <<
"Error reading fermact: " << e << std::endl;
88 QDPIO::cout <<
"FermAct = " << fermact << std::endl;
91 std::istringstream state_info_is(input.
state_info);
92 XMLReader state_info_xml(state_info_is);
98 typedef LatticeFermion
T;
99 typedef multi1d<LatticeColorMatrix>
P;
100 typedef multi1d<LatticeColorMatrix>
Q;
105 QDPIO::cout <<
"Trying 5D actions" << std::endl;
120 QDPIO::cout <<
"Call 5D ritz code" << std::endl;
122 QDPIO::cout <<
"Done with 5D ritz code" << std::endl;
127 QDPIO::cout <<
"5d: " << e << std::endl;
136 QDPIO::cout <<
"Trying 4D Wilson Like actions: " << std::endl;
138 if( fermact ==
"UNPRECONDITIONED_WILSON"
139 || fermact ==
"UNPRECONDITIONED_DWFTRANSF" ) {
141 QDPIO::cout <<
"Special case. Computing Hw e-values and evecs too" << std::endl;
179 QDPIO::cout <<
"4D: " << e << std::endl;
199 const Subset&
s = MM->subset();
215 Real delta_cycle = Real(1);
216 XMLBufferWriter eig_spec_xml;
218 int n_jacob_count = 0;
240 xml_out << eig_spec_xml;
241 write(xml_out,
"lambda_Msq", lambda);
246 LatticeFermion lambda_e;
248 lambda_e[
s] = lambda[
i]*
psi[
i];
255 check_norm[
i] = sqrt(check_norm[
i]);
257 write(xml_out,
"check_norm", check_norm);
260 check_norm[
i] /= fabs(lambda[
i]);
262 write(xml_out,
"check_norm_rel", check_norm);
267 Real hi_RsdR = 1.0e-4;
268 Real hi_RsdA = 1.0e-4;
272 multi1d<Real> lambda_high_aux(1);
273 multi1d<LatticeFermion> lambda_high_vec(1);
275 lambda_high_vec[0][
s] /= sqrt(norm2(lambda_high_vec[0],
s));
278 XMLBufferWriter high_xml;
281 lambda_high_aux[0] = Real(8);
284 push(high_xml,
"LambdaHighRitz");
303 lambda_high_aux[0] = fabs(lambda_high_aux[0]);
304 QDPIO::cout <<
"|| lambda_hi || = " << lambda_high_aux[0] <<
" hi_Rsd_r = " << hi_RsdR << std::endl;
309 push(xml_out,
"Highest");
310 write(xml_out,
"lambda_Msq_hi", lambda_high_aux[0]);
321 const Subset&
s = MM->subset();
337 Real delta_cycle = Real(1);
338 XMLBufferWriter eig_spec_xml;
340 int n_jacob_count = 0;
362 xml_out << eig_spec_xml;
363 write(xml_out,
"lambda_Msq", lambda);
368 LatticeFermion lambda_e;
370 lambda_e[
s] = lambda[
i]*
psi[
i];
377 check_norm[
i] = sqrt(check_norm[
i]);
379 write(xml_out,
"check_norm", check_norm);
382 check_norm[
i] /= fabs(lambda[
i]);
384 write(xml_out,
"check_norm_rel", check_norm);
403 push(xml_out,
"eigFix");
404 write(xml_out,
"lambda_Hw", lambda);
405 write(xml_out,
"n_valid", n_valid);
406 write(xml_out,
"valid_eig", valid_eig);
414 check_norm[
i] = norm2(Me,
s);
415 check_norm[
i] = sqrt(check_norm[
i]);
418 LatticeFermion lambda_e;
421 lambda_e[
s] = lambda[
i]*
psi[
i];
426 check_norm[
i] = sqrt(check_norm[
i]);
429 QDPIO::cout <<
"lambda_lo[" <<
i <<
"] = " << lambda[
i] <<
" ";
430 QDPIO::cout <<
"check_norm["<<
i<<
"] = " << check_norm[
i] << std::endl;
432 write(xml_out,
"check_norm", check_norm);
435 check_norm[
i] /= fabs(lambda[
i]);
436 QDPIO::cout <<
"check_norm_rel["<<
i <<
"] = " << check_norm[
i] << std::endl;
438 QDPIO::cout << std::flush ;
439 write(xml_out,
"check_norm_rel", check_norm);
445 Real hi_RsdR = 1.0e-4;
446 Real hi_RsdA = 1.0e-4;
448 multi1d<Real> lambda_high_aux(1);
449 multi1d<LatticeFermion> lambda_high_vec(1);
451 lambda_high_vec[0][
s] /= sqrt(norm2(lambda_high_vec[0],
s));
454 XMLBufferWriter high_xml;
458 lambda_high_aux[0] = Real(8);
461 push(high_xml,
"LambdaHighRitz");
480 lambda_high_aux[0] = sqrt(fabs(lambda_high_aux[0]));
481 QDPIO::cout <<
"|| lambda_hi || = " << lambda_high_aux[0] <<
" hi_Rsd_r = " << hi_RsdR << std::endl;
486 push(xml_out,
"Highest");
487 write(xml_out,
"lambda_hi", lambda_high_aux[0]);
490 QDPIO::cout <<
"Writing low eigenvalues/vectors" << std::endl;
491 writeEigen(input, lambda,
psi, lambda_high_aux[0], QDPIO_SERIAL);
501 const Subset&
s = MM->subset();
510 for(
int n=0;
n <
N5;
n++) {
519 Real delta_cycle = Real(1);
520 XMLBufferWriter eig_spec_xml;
522 int n_jacob_count = 0;
525 QDPIO::cout <<
"Call EigSpecRitzKS" << std::endl;
548 QDPIO::cout <<
"Call EigSpecRitzCG" << std::endl;
566 xml_out << eig_spec_xml;
567 write(xml_out,
"lambda_Msq", lambda);
571 multi1d<LatticeFermion> Me(
N5);
572 multi1d<LatticeFermion> lambda_e(
N5);
574 for(
int n =0;
n <
N5;
n++) {
575 lambda_e[
n][
s] = lambda[
i]*
psi[
i][
n];
579 for(
int n=0;
n <
N5;
n++) {
584 for(
int n=1;
n <
N5;
n++) {
588 check_norm[
i] = sqrt(check_norm[
i]);
590 write(xml_out,
"check_norm", check_norm);
593 check_norm[
i] /= fabs(lambda[
i]);
595 write(xml_out,
"check_norm_rel", check_norm);
601 Real hi_RsdR = 1.0e-4;
602 Real hi_RsdA = 1.0e-4;
605 multi1d<Real> lambda_high_aux(1);
606 multi2d<LatticeFermion> lambda_high_vec(1,
N5);
607 for(
int n=0;
n <
N5;
n++) {
609 lambda_high_vec[0][
n][
s] /= sqrt(norm2(lambda_high_vec[0],
s));
613 XMLBufferWriter high_xml;
616 lambda_high_aux[0] = Real(8);
619 push(high_xml,
"LambdaHighRitz");
638 lambda_high_aux[0] = fabs(lambda_high_aux[0]);
639 QDPIO::cout <<
"|| lambda_hi || = " << lambda_high_aux[0] <<
" hi_Rsd_r = " << hi_RsdR << std::endl;
644 push(xml_out,
"Highest");
645 write(xml_out,
"lambda_Msq_hi", lambda_high_aux[0]);
Primary include file for CHROMA in application codes.
Class for counted reference semantics.
Linear Operator to arrays.
Partial specialization of scaled M operator over arrays.
void EigSpecRitzCG(const LinearOperator< LatticeFermion > &M, multi1d< Real > &lambda_H, multi1d< LatticeFermion > &psi, int n_eig, int n_renorm, int n_min, int MaxCG, const Real &Rsd_r, const Real &Rsd_a, const Real &zero_cutoff, const bool ProjApsiP, int &n_cg_tot, XMLWriter &xml_out)
Compute low lying eigenvalues of the hermitian H.
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 proginfo(XMLWriter &xml)
Print out basic information about this program.
void writeEigen(const ChromaWilsonRitz_t &header, multi1d< Real > &lambda_lo, multi1d< LatticeFermion > &eigv_lo, Real &lambda_hi, QDP_serialparallel_t serpar)
multi1d< LatticeColorMatrix > P
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
void fixMMev2Mev(const LinearOperator< LatticeFermion > &M, multi1d< Real > &lambda, multi1d< LatticeFermion > &ev_psi, const int n_eig, const Real &Rsd_r, const Real &Rsd_a, const Real &zero_cutoff, multi1d< bool > &valid_eig, int &n_valid, int &n_jacob)
void EigSpecRitzKS(const LinearOperator< LatticeFermion > &M, multi1d< Real > &lambda_H, multi1d< LatticeFermion > &psi, int n_eig, int n_dummy, int n_renorm, int n_min, int n_max, int n_max_KS, const Real &gamma_factor, int MaxCG, const Real &Rsd_r, const Real &Rsd_a, const Real &zero_cutoff, const bool ProjApsiP, int &n_cg_tot, int &n_KS, int &n_jacob_tot, XMLWriter &xml_out)
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
void initialize(int *argc, char ***argv)
Chroma initialisation routine.
void finalize(void)
Chroma finalization routine.
std::string getXMLInputFileName()
Get input file name.
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
XMLFileWriter & getXMLOutputInstance()
Get xml output instance.
const WilsonTypeFermAct< multi1d< LatticeFermion > > & S_f
multi1d< LatticeFermion > s(Ncb)
Struct for the overall application.
void RitzCode4DHw(Handle< LinearOperator< LatticeFermion > > &MM, Handle< LinearOperator< LatticeFermion > > &H, const ChromaWilsonRitz_t &input, XMLWriter &xml_out)
int main(int argc, char **argv)
void RitzCode4D(Handle< LinearOperator< LatticeFermion > > &MM, const ChromaWilsonRitz_t &input, XMLWriter &xml_out)
void RitzCode5D(Handle< LinearOperatorArray< LatticeFermion > > &MM, const ChromaWilsonRitz_t &input, XMLWriter &xml_out)