15 #define MRES_CALCULATION
24 QDP_volfmt_t prop_volfmt;
38 multi1d<Component_t> components;
44 XMLReader top(xml,path);
50 QDPIO::cerr <<
"Caught Exception : " << e << std::endl;
54 QDPIO::cerr <<
"Component color >= Nc. color = " << comp.
color << std::endl;
58 if( comp.
spin < 0 || comp.
spin >= Ns ) {
59 QDPIO::cerr <<
"Component spin >= Ns. spin = " << comp.
spin << std::endl;
79 XMLReader inputtop(xml, path);
90 XMLReader inputtop(xml, path);
99 read(inputtop,
"Cfg", input.
cfg);
108 QDPIO::cerr <<
"Error reading data: " << e << std::endl;
116 XMLReader& source_record_xml,
118 XMLReader& gauge_xml,
120 const LatticeFermion&
psi,
131 int main(
int argc,
char **argv)
146 read(xml_in,
"/propagatorComp", input);
149 QDPIO::cerr <<
"Caught Exception : " << e << std::endl;
154 Layout::setLattSize(input.
param.nrow);
157 QDPIO::cout <<
"propagatorComp" << std::endl;
160 multi1d<LatticeColorMatrix>
u(
Nd);
161 XMLReader gauge_file_xml, gauge_xml;
166 LatticePropagator quark_prop_source;
167 XMLReader source_file_xml, source_record_xml;
171 source_record_xml, quark_prop_source,
178 multi1d<int> boundary;
179 bool make_sourceP =
false;;
180 bool seqsourceP =
false;
183 QDPIO::cout <<
"Attempt to read source" << std::endl;
185 source_record_xml, quark_prop_source,
187 QDPIO::cout <<
"Forward propagator successfully read" << std::endl;
193 if (source_record_xml.count(
"/MakeSource") != 0)
197 read(source_record_xml,
"/MakeSource/PropSource", source_header);
200 boundary = input.
param.boundary;
203 else if (source_record_xml.count(
"/SequentialSource") != 0)
209 read(source_record_xml,
"/SequentialSource/SeqSource", seqsource_header);
211 read(source_record_xml,
"/SequentialSource/ForwardProps/elem[1]/ForwardProp",
213 read(source_record_xml,
"/SequentialSource/ForwardProps/elem[1]/PropSource",
225 QDPIO::cerr <<
"Error extracting source_header: " << e << std::endl;
233 for(
int i=0;
i < boundary.size(); ++
i)
234 if (boundary[
i] != input.
param.boundary[
i])
236 QDPIO::cerr <<
"Incompatible boundary between input and seqsource" << std::endl;
244 push(xml_out,
"propagatorComp");
249 write(xml_out,
"Input", xml_in);
252 write(xml_out,
"Config_info", gauge_xml);
255 write(xml_out,
"Source_file_info", source_file_xml);
256 write(xml_out,
"Source_record_info", source_record_xml);
258 push(xml_out,
"Output_version");
259 write(xml_out,
"out_version", 1);
269 MesPlq(xml_out,
"Observables",
u);
278 multi1d<Double> source_corr = sumMulti(localNorm2(quark_prop_source),
281 push(xml_out,
"Source_correlator");
282 write(xml_out,
"source_corr", source_corr);
300 switch (input.
param.FermActHandle->getFermActType() ) {
301 case FERM_ACT_WILSON:
305 QDPIO::cout <<
"FERM_ACT_WILSON" << std::endl;
311 case FERM_ACT_UNPRECONDITIONED_WILSON:
315 QDPIO::cout <<
"FERM_ACT_UNPRECONDITIONED_WILSON" << std::endl;
320 case FERM_ACT_OVLAP_PARTFRAC_4D:
322 QDPIO::cout <<
"FERM_ACT_ZOLOTAREV_4D" << std::endl;
331 case FERM_ACT_ZOLOTAREV_5D:
333 QDPIO::cout <<
"FERM_ACT_ZOLOTAREV_5D" << std::endl;
334 const Zolotarev5DFermActParams& zolo5d =
dynamic_cast<const Zolotarev5DFermActParams&
> (*(input.
param.FermActHandle));
338 S_f_a_ptr =
new Zolotarev5DFermActArray(fbc_a, fbc, zolo5d, xml_out);
344 const DWFFermActParams& dwf =
dynamic_cast<const DWFFermActParams&
>(*(input.
param.FermActHandle));
346 QDPIO::cout <<
"FERM_ACT_DWF" << std::endl;
348 dwf.chiralParam.OverMass,
354 case FERM_ACT_UNPRECONDITIONED_DWF:
356 const DWFFermActParams& dwf =
dynamic_cast<const DWFFermActParams&
>(*(input.
param.FermActHandle));
358 QDPIO::cout <<
"FERM_ACT_UNPRECONDITONED_DWF" << std::endl;
360 dwf.chiralParam.OverMass,
366 QDPIO::cerr <<
"Unsupported fermion action" << std::endl;
379 switch(input.
param.FermActHandle->getFermActType()) {
380 case FERM_ACT_WILSON:
381 state_ptr =
S_f->createState(
u);
383 case FERM_ACT_UNPRECONDITIONED_WILSON:
384 state_ptr =
S_f->createState(
u);
387 state_ptr = S_f_a->createState(
u);
389 case FERM_ACT_UNPRECONDITIONED_DWF:
390 state_ptr = S_f_a->createState(
u);
393 case FERM_ACT_ZOLOTAREV_4D:
395 const Zolotarev4DFermActParams& zolo4d =
dynamic_cast<const Zolotarev4DFermActParams&
> (*(input.
param.FermActHandle));
396 const Zolotarev4DFermAct& S_zolo4 =
dynamic_cast<const Zolotarev4DFermAct&
>(*S_f);
398 state_ptr = S_zolo4.createState(
u, zolo4d.StateInfo, xml_out,zolo4d.AuxFermActHandle->getMass());
402 case FERM_ACT_ZOLOTAREV_5D:
404 const Zolotarev5DFermActParams& zolo5d =
dynamic_cast<const Zolotarev5DFermActParams&
> (*(input.
param.FermActHandle));
405 const Zolotarev5DFermActArray& S_zolo5 =
dynamic_cast<const Zolotarev5DFermActArray&
>(*S_f_a);
408 state_ptr = S_zolo5.createState(
u, zolo5d.StateInfo, xml_out, zolo5d.AuxFermActHandle->getMass());
413 QDPIO::cerr <<
"Unsupported fermion action (state creation)" << std::endl;
433 for(
int comp = 0; comp < input.
components.size(); comp++) {
445 Real fact = Real(1) / sqrt(norm2(
chi));
450 if( S_f_ptr != 0x0 ) {
452 if( input.
param.FermActHandle->getFermActType()==FERM_ACT_ZOLOTAREV_4D ) {
455 case REL_GMRESR_SUMR_INVERTER:
456 case REL_GMRESR_CG_INVERTER:
492 else if ( S_f_a_ptr != 0x0 ) {
503 QDPIO::cerr <<
"Both S_f_ptr and S_f_a_ptr == 0 " << std::endl;
509 fact = Real(1) / fact;
512 push(xml_out,
"Relaxation_Iterations");
544 XMLReader& source_record_xml,
546 XMLReader& gauge_xml,
548 const LatticeFermion&
psi,
555 multi1d<Double> prop_corr = sumMulti(localNorm2(
psi),
558 push(xml_out,
"PropComp_correlator");
559 write(xml_out,
"Mass", param.FermActHandle->getMass());
560 write(xml_out,
"prop_corr", prop_corr);
565 XMLBufferWriter file_xml;
567 push(file_xml,
"propagatorComponent");
569 write(file_xml,
"id",
id);
572 XMLBufferWriter record_xml;
577 XMLReader xml_tmp(source_record_xml,
"/MakeSource");
579 push(record_xml,
"Propagator");
580 write(record_xml,
"ForwardProp", param);
581 record_xml << xml_tmp;
582 write(record_xml,
"Component", component);
586 XMLReader xml_tmp(source_record_xml,
"/SequentialSource");
588 push(record_xml,
"SeqProp");
589 write(record_xml,
"ForwardProp", param);
590 record_xml << xml_tmp;
591 write(record_xml,
"Component", component);
594 std::ostringstream outfile;
597 outfile <<
prop.prop_file <<
"_component_s" << component.
spin
598 <<
"_c" << component.
color ;
601 QDPIO::cout <<
"Attempting to write " << outfile.str() << std::endl;
605 outfile.str(),
prop.prop_volfmt, QDPIO_SERIAL);
Primary include file for CHROMA in application codes.
Support class for fermion actions and linear operators.
4D style even-odd preconditioned domain-wall fermion action
Even-odd preconditioned Wilson fermion action.
Base class for quadratic matter actions (e.g., fermions)
Class for counted reference semantics.
Base class for unpreconditioned overlap-like fermion actions.
SystemSolver< T > * qprop(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Redefine quark propagator routine for 4D fermions.
4D Zolotarev variant of Overlap-Dirac operator
Fourier transform phase factor support.
const Set & getSet() const
The set to be used in sumMulti.
Concrete class for all gauge actions with simple boundary conditions.
Unpreconditioned domain-wall fermion action.
Unpreconditioned Wilson fermion action.
void PropToFerm(const LatticePropagatorF &b, LatticeFermionF &a, int color_index, int spin_index)
Extract a LatticeFermion from 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 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.
std::map< std::string, SinkPropContainer_t > prop
ForwardProp_t prop_header
Asqtad Staggered-Dirac operator.
static multi1d< LatticeColorMatrix > u
push(xml_out,"Condensates")
void initialize(int *argc, char ***argv)
Chroma initialisation routine.
void finalize(void)
Chroma finalization routine.
void readQprop(XMLReader &file_xml, XMLReader &record_xml, LatticePropagator &quark_prop, const std::string &file, QDP_serialparallel_t serpar)
Read a Chroma propagator.
multi1d< LatticeFermion > chi(Ncb)
std::string getXMLInputFileName()
Get input file name.
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
void writeFermion(XMLBufferWriter &file_xml, XMLBufferWriter &record_xml, const LatticeFermion &fermion, const std::string &file, QDP_volfmt_t volfmt, QDP_serialparallel_t serpar)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
XMLFileWriter & getXMLOutputInstance()
Get xml output instance.
const WilsonTypeFermAct< multi1d< LatticeFermion > > & S_f
int main(int argc, char **argv)
void saveComponent(const ChromaProp_t ¶m, const Prop_t &prop, XMLReader &source_record_xml, const Component_t &component, XMLReader &gauge_xml, XMLWriter &xml_out, const LatticeFermion &psi, bool make_sourceP, bool seqsourceP)
Gauge configuration structure.
Params for overlap ferm acts.
Propagator source construction parameters.
Sequential source parameters.
Params for wilson ferm acts.