58 multi1d<int> boundary;
76 XMLReader inputtop(xml, path);
87 read(inputtop,
"IO_version/version", version);
91 QDPIO::cerr <<
"Error reading data: " << e << std::endl;
102 XMLReader paramtop(inputtop,
"param");
114 QDPIO::cerr <<
"Input parameter version " << version <<
" unsupported." << std::endl;
120 QDPIO::cerr <<
"Error reading data: " << e << std::endl;
124 QDPIO::cout <<
"Propagator for Staggered fermions" << std::endl;
128 XMLReader paramtop(inputtop,
"param");
161 QDPIO::cerr <<
"Input src = " << input.
param.
src_type_str <<
" unknown." << std::endl;
172 QDPIO::cerr <<
"Error reading data: " << e << std::endl;
180 read(inputtop,
"Cfg", input.
cfg);
184 QDPIO::cerr <<
"Error reading data: " << e << std::endl;
204 #include "qdp_util.h"
209 QDPIO::cout <<
"Dump of source " << std::endl;
210 StaggeredFermion psi_local ;
211 ColorVector psi_color ;
215 for(
int site=0; site < Layout::vol(); ++site)
217 multi1d<int>
coord = crtesn(site, Layout::lattSize());
218 printf(
"[%d,%d,%d,%d] \n",
221 psi_color = peekSpin(psi_local,0) ;
222 for(
int i=0 ;
i < Nc ; ++
i)
224 z = peekColor(psi_color,
i) ;
225 QDPIO::cout <<
i <<
" " <<
z << std::endl;
241 void walfil_q(LatticeStaggeredFermion&
a,
int slice,
int mu,
int color_index)
245 if (color_index >= Nc || color_index < 0)
252 Complex sitecomp = cmplx(nnn,0);
253 ColorVector sitecolor =
zero;
254 StaggeredFermion sitefield =
zero;
257 pokeColor(sitecolor,sitecomp,color_index),
261 LatticeStaggeredFermion
tmp;
265 multi1d<LatticeInteger>
x(
Nd);
267 for(
int sigma = 0; sigma <
Nd; sigma++) {
268 x[ sigma ] = Layout::latticeCoordinate(sigma);
271 a = where(Layout::latticeCoordinate(
mu) == slice &&
272 (
x[0]+
x[1]+
x[2] ) % 2 == 0,
273 tmp, LatticeStaggeredFermion(
zero));
285 void walfil_o(LatticeStaggeredFermion&
a,
int slice,
int mu,
int color_index)
289 if (color_index >= Nc || color_index < 0)
296 Complex sitecomp = cmplx(nnn,0);
297 ColorVector sitecolor =
zero;
298 StaggeredFermion sitefield =
zero;
301 pokeColor(sitecolor,sitecomp,color_index),
305 LatticeStaggeredFermion
tmp;
309 multi1d<LatticeInteger>
x(
Nd);
311 for(
int sigma = 0; sigma <
Nd; sigma++) {
312 x[ sigma ] = Layout::latticeCoordinate(sigma);
315 a = where(Layout::latticeCoordinate(
mu) == slice &&
316 (
x[0]+
x[1]+
x[2] ) % 2 == 1 ,
317 tmp, LatticeStaggeredFermion(
zero));
331 Complex sitecomp = cmplx(
one,0);
332 ColorVector sitecolor =
zero;
333 StaggeredFermion sitefield =
zero;
337 const int spin_index = 0 ;
338 multi1d<int>
coord(4) ;
345 pokeSite(
a, pokeSpin(sitefield,
346 pokeColor(sitecolor,sitecomp,color_index),
351 pokeSite(
a, pokeSpin(sitefield,
352 pokeColor(sitecolor,sitecomp,color_index),
357 pokeSite(
a, pokeSpin(sitefield,
358 pokeColor(sitecolor,sitecomp,color_index),
363 pokeSite(
a, pokeSpin(sitefield,
364 pokeColor(sitecolor,sitecomp,color_index),
381 Complex sitecomp = cmplx(
one,0);
385 ColorVector sitecolor =
zero;
386 StaggeredFermion sitefield =
zero;
388 const int spin_index = 0 ;
389 multi1d<int>
coord(4) ;
395 pokeSite(
a, pokeSpin(sitefield,
396 pokeColor(sitecolor,sitecomp,color_index),
402 pokeSite(
a, pokeSpin(sitefield,
403 pokeColor(sitecolor,sitecomp,color_index),
409 pokeSite(
a, pokeSpin(sitefield,
410 pokeColor(sitecolor,sitecomp,color_index),
415 pokeSite(
a, pokeSpin(sitefield,
416 pokeColor(sitecolor,sitecomp,color_index),
427 multi1d<int>
coord(4) ;
439 else if( src_type ==
wall_s )
444 else if( src_type ==
wall_q )
446 LatticeStaggeredFermion q_source_a , q_source_b ;
449 q_source = q_source_a + q_source_b ;
453 LatticeStaggeredFermion q_source_a , q_source_b ;
456 q_source = q_source_a + q_source_b ;
460 QDPIO::cerr <<
"Error, src_type " << src_type <<
" out of range" << std::endl;
476 int main(
int argc,
char **argv)
490 xml_in.open(in_name);
494 QDPIO::cerr <<
"Error reading input file " << in_name << std::endl;
495 QDPIO::cerr <<
"The input file name can be passed via the -i flag " << std::endl;
496 QDPIO::cerr <<
"The default name is ./DATA" << std::endl;
504 read(xml_in,
"/propagator", input);
508 QDPIO::cerr <<
"Error parsing the input file " << in_name << std::endl;
516 multi1d<LatticeColorMatrix>
u(
Nd);
518 XMLReader gauge_file_xml, gauge_xml;
523 QDPIO::cout <<
"DOING GAUGE TRANSFORM " << std::endl;
525 QDPIO::cout <<
"Random gauge transform on gauge fields done." << std::endl;
533 push(xml_out,
"hadron_corr");
536 write(xml_out,
"Input", xml_in);
539 write(xml_out,
"Config_info", gauge_xml);
545 MesPlq(xml_out,
"Gauge_Observables",
u);
553 typedef LatticeStaggeredFermion
T;
554 typedef multi1d<LatticeColorMatrix>
P;
555 typedef multi1d<LatticeColorMatrix>
Q;
561 XMLReader fermact_reader ;
569 fermact_reader.open(is);
573 QDPIO::cerr <<
"Error reading first action name " << std::endl;
578 XMLReader fermact_reader_A ;
586 fermact_reader_A.open(is);
590 QDPIO::cerr <<
"Error reading first action name " << std::endl;
603 Real
Mass =
S_f.getQuarkMass() ;
606 LatticeStaggeredPropagator quark_propagator;
607 LatticeStaggeredPropagator quark_propagator_A;
609 XMLBufferWriter xml_buf;
614 LatticeStaggeredFermion q_source,
psi;
619 XMLBufferWriter xml_buf;
621 XMLReader xml_in(xml_buf);
622 inv_param =
readXMLGroup(xml_in,
"/InvertParam",
"invType");
633 multi1d<int>
coord(4) ;
639 QDPIO::cout <<
"Source time slice = " << input.
param.
t_srce << std::endl;
648 push(xml_out,
"first_inversion");
650 push(xml_out,
"Inverter_properties");
657 for(
int color_source = 0; color_source < Nc; ++color_source) {
658 QDPIO::cout <<
"Inversion[A] for Color = " << color_source << std::endl;
669 push(xml_out,
"Inverter_performance");
670 write(xml_out,
"color", color_source);
684 push(xml_out,
"second_inversion");
686 push(xml_out,
"Inverter_properties");
693 for(
int color_source = 0; color_source < Nc; ++color_source) {
694 QDPIO::cout <<
"Inversion[B] for Color = " << color_source << std::endl;
708 push(xml_out,
"Inverter_performance");
709 write(xml_out,
"color", color_source);
729 push(xml_out,
"Hadron_A") ;
731 write(xml_out,
"Mass_A" , Mass_A);
737 multi1d<Complex> barprop(t_length);
740 baryon_s(quark_propagator_A,quark_propagator_A,
743 write(xml_out,
"baryon_corr", barprop) ;
750 push(xml_out,
"Hadron_B") ;
758 multi1d<Complex> barprop(t_length);
761 baryon_s(quark_propagator,quark_propagator,quark_propagator,
763 write(xml_out,
"baryon_corr", barprop) ;
770 push(xml_out,
"Hadron_ABB") ;
772 write(xml_out,
"Mass_A" , Mass_A);
775 multi1d<Complex> barprop(t_length);
778 baryon_s(quark_propagator_A,quark_propagator,quark_propagator,
780 write(xml_out,
"baryon_corr", barprop) ;
787 push(xml_out,
"Hadron_AAB") ;
789 write(xml_out,
"Mass_A" , Mass_A);
792 multi1d<Complex> barprop(t_length);
795 baryon_s(quark_propagator_A,quark_propagator_A,
797 write(xml_out,
"baryon_corr", barprop) ;
806 bool do_spin3by_2 = false ;
809 { do_spin3by_2 = true ; }
820 push(xml_out,
"Hadron_class4_AAB") ;
822 write(xml_out,
"Mass_A" , Mass_A);
825 multi1d<Complex> barprop(t_length);
832 write(xml_out,
"baryon_corr", barprop) ;
841 push(xml_out,
"Hadron_class4_ABB") ;
843 write(xml_out,
"Mass_A" , Mass_A);
846 multi1d<Complex> barprop(t_length);
853 write(xml_out,
"baryon_corr", barprop) ;
862 push(xml_out,
"Hadron_class4_BBB") ;
866 multi1d<Complex> barprop(t_length);
873 write(xml_out,
"baryon_corr", barprop) ;
884 push(xml_out,
"Hadron_class4_AAA") ;
886 write(xml_out,
"Mass_A" , Mass_A);
888 multi1d<Complex> barprop(t_length);
893 write(xml_out,
"baryon_corr", barprop) ;
907 push(xml_out,
"Hadron_class7_AAB") ;
909 write(xml_out,
"Mass_A" , Mass_A);
912 multi1d<Complex> barprop(t_length);
917 write(xml_out,
"baryon_corr", barprop) ;
925 push(xml_out,
"Hadron_class7_ABB") ;
927 write(xml_out,
"Mass_A" , Mass_A);
930 multi1d<Complex> barprop(t_length);
935 write(xml_out,
"baryon_corr", barprop) ;
945 push(xml_out,
"Hadron_class7_AAA") ;
947 write(xml_out,
"Mass_A" , Mass_A);
949 multi1d<Complex> barprop(t_length);
956 write(xml_out,
"baryon_corr", barprop) ;
966 push(xml_out,
"Hadron_class7_BBB") ;
970 multi1d<Complex> barprop(t_length);
977 write(xml_out,
"baryon_corr", barprop) ;
993 push(xml_out,
"Hadron_class7_NLT_AAB") ;
995 write(xml_out,
"Mass_A" , Mass_A);
998 multi1d<Complex> barprop(t_length);
1003 write(xml_out,
"baryon_corr", barprop) ;
1011 push(xml_out,
"Hadron_class7_NLT_ABB") ;
1013 write(xml_out,
"Mass_A" , Mass_A);
1016 multi1d<Complex> barprop(t_length);
1021 write(xml_out,
"baryon_corr", barprop) ;
1031 push(xml_out,
"Hadron_class7_NLT_AAA") ;
1033 write(xml_out,
"Mass_A" , Mass_A);
1035 multi1d<Complex> barprop(t_length);
1040 quark_propagator_A,
u,
1042 write(xml_out,
"baryon_corr", barprop) ;
1052 push(xml_out,
"Hadron_class7_NLT_BBB") ;
1056 multi1d<Complex> barprop(t_length);
1063 write(xml_out,
"baryon_corr", barprop) ;
Primary include file for CHROMA in application codes.
virtual SystemSolver< T > * qprop(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Return quark prop solver, solution of unpreconditioned system.
virtual FermState< T, P, Q > * createState(const Q &q) const
Given links (coordinates Q) create the state needed for the linear operators.
Class for counted reference semantics.
Staggered-like fermion actions.
virtual const Real getQuarkMass() const =0
Return the quark mass.
void dump(int t_source, XMLWriter &xml_out)
void compute(LatticeStaggeredPropagator &quark_prop_A, LatticeStaggeredPropagator &quark_prop_B, int j_decay)
void FermToProp(const LatticeFermionF &a, LatticePropagatorF &b, int color_index, int spin_index)
Insert a LatticeFermion into a LatticePropagator.
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 rgauge(multi1d< LatticeColorMatrix > &u, LatticeColorMatrix &g)
Do a random gauge transformation on the u fields.
void gaugeStartup(XMLReader &gauge_file_xml, XMLReader &gauge_xml, multi1d< LatticeColorMatrix > &u, Cfg_t &cfg)
Initialize the gauge fields.
CfgType
Configuration type.
GroupXML_t readXMLGroup(XMLReader &xml_in, const std::string &path, const std::string &type_name)
Read group and return as a std::string.
void walfil(LatticeStaggeredFermion &a, int slice, int mu, int color_index, int src_index)
Fill a specific color and spin index with 1.0 on a wall.
void srcfil(LatticeFermion &a, const multi1d< int > &coord, int color_index, int spin_index)
Fill a specific color and spin index with 1.0.
bool registerAll()
Register all the factories.
bool registerAll()
Register all the factories.
multi1d< LatticeColorMatrix > P
multi1d< int > coords(const int x, const int y, const int z, const int t)
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
void baryon_class7_s(LatticeStaggeredPropagator &quark_propagator_in_a, LatticeStaggeredPropagator &quark_propagator_in_b, LatticeStaggeredPropagator &quark_propagator_in_c, multi1d< Complex > &barprop, multi1d< int > &t_source, int j_decay, int bc_spec)
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
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > const multi1d< Real > & Mass
push(xml_out,"Condensates")
void baryon_s(LatticeStaggeredPropagator &quark_propagator_in, multi1d< Complex > &barprop, multi1d< int > &t_source, int j_decay, int bc_spec)
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)
void baryon_class4_s(LatticeStaggeredPropagator &quark_propagator_in_a, LatticeStaggeredPropagator &quark_propagator_in_b, LatticeStaggeredPropagator &quark_propagator_in_c, multi1d< Complex > &barprop, multi1d< int > &t_source, int j_decay, int bc_spec)
void baryon_class7_NLT_s(LatticeStaggeredPropagator &quark_propagator_in_a, LatticeStaggeredPropagator &quark_propagator_in_b, LatticeStaggeredPropagator &quark_propagator_in_c, multi1d< LatticeColorMatrix > &u, multi1d< Complex > &barprop, multi1d< int > &t_source, int j_decay, int bc_spec)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
XMLFileWriter & getXMLOutputInstance()
Get xml output instance.
const WilsonTypeFermAct< multi1d< LatticeFermion > > & S_f
Gauge configuration structure.
Hold group xml and type id.
Holds return info from SystemSolver call.
Parameters for running program.
staggered_src_type src_type
SysSolverCGParams invParam
int main(int argc, char **argv)
void create_stagg_source(LatticeStaggeredFermion &q_source, staggered_src_type src_type, int color_source, int j_decay, int t_source)
void walfil_q(LatticeStaggeredFermion &a, int slice, int mu, int color_index)
void dump_text_src(LatticeStaggeredFermion psi, multi1d< int > nrow)
void srcfil_local_q(LatticeStaggeredFermion &a, int slice, int mu, int color_index)
void walfil_o(LatticeStaggeredFermion &a, int slice, int mu, int color_index)
void srcfil_local_o(LatticeStaggeredFermion &a, int slice, int mu, int color_index)
Read an XML group as a std::string.