12 using namespace GroupBaryonOperatorEnv;
18 write( xml,
"BaryonOpElement", input );
25 write( xml,
"BaryonOpIndex", input );
32 write( xml,
"BaryonOpIns", input );
46 if( path !=
"." )
push( xml, path );
48 write( xml,
"version", version );
55 if( path !=
"." )
pop( xml );
73 int main(
int argc,
char *argv[] )
80 QDPIO::cout <<
"GroupBaryonAll2All: Group Baryon Operators with All2All" << std::endl;
81 QDPIO::cout <<
"Linkage = " <<
linkageHack() << std::endl;
99 push( xml_out,
"GroupBaryonAll2AllRun" );
101 write( xml_out,
"InputCopy", xml_in );
106 XMLReader gauge_file_xml, gauge_xml;
111 QDPIO::cout<<
"Gauge field measurements " <<
w_plaq <<
" "<<
s_plaq <<
" "<<
t_plaq <<
" "<<
link <<
" "<<std::endl;
116 XMLReader linktop( xml_l );
126 QDPIO::cout <<
"Gauge links smeared : time = " << swatch.getTimeInSeconds() <<
" secs" << std::endl;
132 multi1d<GroupBaryonQQQ> AQQQ;
133 multi1d<GroupBaryonQQQ> CQQQ;
134 multi1d<GroupBaryonOp> AOp;
135 multi1d<GroupBaryonOp> COp;
145 multi1d<Params::QuarkSourceSolutions_t> quarks(
params.
qprop.
solns.size() );
149 for(
int n=0;
n < quarks.size(); ++
n)
151 QDPIO::cout <<
"Attempt to read solutions for source number=" <<
n << std::endl;
153 QDPIO::cout <<
"dilutions.size= " << quarks[
n].dilutions.size() << std::endl;
154 for(
int i=0;
i < quarks[
n].dilutions.size(); ++
i)
156 XMLReader file_xml, record_xml;
158 read(from, record_xml, quarks[
n].dilutions[
i].soln);
161 read(record_xml,
"/Propagator/PropSource/Source/ran_seed", quarks[
n].seed);
164 read(record_xml,
"/Propagator/PropSource", quarks[
n].dilutions[
i].source_header);
172 QDPIO::cerr <<
"Error extracting headers: " << e << std::endl;
175 QDPIO::cout <<
"Read SOLUTION vectors from files : time = " << swatch.getTimeInSeconds() <<
" secs" << std::endl;
185 multi1d<LatticeComplex> vresult(1);
186 LatticeComplex result;
187 #ifdef REDUCETOTIMEDILUTION
188 multi1d<Params::QuarkSourceSolutions_t> quarks2(
params.
qprop.
solns.size() );
194 #ifdef MAKE_SINK_OPERATORS
196 #ifdef REDUCETOTIMEDILUTION
206 for(
int n=0;
n < quarks.size(); ++
n)
208 QDPIO::cout <<
"Reducing spin-colour dilution levels for quark " <<
n << std::endl;
214 int NSpinDilution = 4;
215 int NColourDilution = 3;
216 int NSpaceDilution = 1;
218 quarks2[
n].seed = quarks[
n].seed;
219 for(
int i=0;
i < (NTimeDilution); ++
i)
222 quarks2[
n].dilutions[
i].source_header = quarks[
n].dilutions[
i*(
params.
NdilReduce)].source_header;
229 for(
int t=0;
t < NTimeDilution; ++
t)
231 for(
int x=0;
x < NSpaceDilution; ++
x)
233 indx2 =
x + NSpaceDilution * (
t );
234 LatticeFermion
Q=
zero;
235 for(
int c=0;
c < NColourDilution; ++
c)
237 for(
int s=0;
s < NSpinDilution; ++
s)
239 indx =
x + NSpaceDilution * (
s + NSpinDilution * (
c + NColourDilution * (
t ) ) );
241 Q += quarks[
n].dilutions[ indx ].soln;
244 quarks2[
n].dilutions[ indx2 ].soln =
Q;
251 QDPIO::cerr <<
": Caught Exception removing COLOUR and SPIN-dilution: " << e << std::endl;
255 QDPIO::cout <<
"COLOUR and SPIN dilution removed: time= " << swatch.getTimeInSeconds() <<
" secs" << std::endl;
261 QDPIO::cout <<
"Making the SINK operators" << std::endl;
265 #ifdef REDUCETOTIMEDILUTION
266 AOp[
n ].baryonoperator.seed_l = quarks2[0].seed;
267 AOp[
n ].baryonoperator.seed_m = quarks2[1].seed;
268 AOp[
n ].baryonoperator.seed_r = quarks2[2].seed;
270 AOp[
n ].baryonoperator.seed_l = quarks[0].seed;
271 AOp[
n ].baryonoperator.seed_m = quarks[1].seed;
272 AOp[
n ].baryonoperator.seed_r = quarks[2].seed;
278 XMLReader sinktop( xml_s );
284 #ifdef REDUCETOTIMEDILUTION
285 for(
int n=0;
n < quarks2.size(); ++
n)
289 ( *sinkSmearing ) ( quarks2[
n ].dilutions[
i ].soln );
293 for(
int n=0;
n < quarks.size(); ++
n)
297 ( *sinkSmearing ) ( quarks[
n ].dilutions[
i ].soln );
302 QDPIO::cout <<
"SINK smearings done: time= " << swatch.getTimeInSeconds() <<
" secs" << std::endl;
311 #ifdef REDUCETOTIMEDILUTION
312 vresult = AQQQ[ qqq ](
313 quarks2[ 0 ].dilutions[
i ].soln,
314 quarks2[ 1 ].dilutions[
j ].soln,
315 quarks2[ 2 ].dilutions[
k ].soln,
319 vresult = AQQQ[ qqq ](
320 quarks[ 0 ].dilutions[
i ].soln,
321 quarks[ 1 ].dilutions[
j ].soln,
322 quarks[ 2 ].dilutions[
k ].soln,
326 elem = phases.
sft( vresult[ 0 ] );
327 for(
int b=0;
b < AQQQ[ qqq ].NBaryonOps; ++
b)
333 AQQQ[ qqq ].baryon[
b ]->baryonoperator.orderings[ 0 ].op(
i,
j,
k ).ind[ 0 ].elem(
p,
t )
334 += ( AQQQ[ qqq ].coef[
b ] * elem(
p,
t ) );
344 QDPIO::cerr <<
": Caught Exception creating sink baryon operator: " << e << std::endl;
347 QDPIO::cout <<
"SINK operators done: time= " << swatch.getTimeInSeconds() <<
" secs" << std::endl;
353 XMLBufferWriter file_xml;
356 write( file_xml,
"Config_info", gauge_xml );
360 QDPFileWriter to( file_xml, output,
361 QDPIO_SINGLEFILE, QDPIO_SERIAL, QDPIO_OPEN );
372 XMLBufferWriter record_xml;
373 write( record_xml,
"SinkBaryonOperator", AOp[
b ].baryonoperator );
374 write( to, record_xml, AOp[
b ].baryonoperator.serialize() );
379 QDPIO::cout <<
"Operators written: time= " << swatch.getTimeInSeconds() <<
" secs" << std::endl;
382 #ifdef MAKE_SOURCE_OPERATORS
386 QDPIO::cout <<
"Re-generating the noise SOURCES" << std::endl;
391 for(
int n=0;
n < quarks.size(); ++
n)
394 LatticeFermion quark_noise;
395 for(
int i=0;
i < quarks[
n ].dilutions.size(); ++
i)
397 std::istringstream xml_s( quarks[
n ].dilutions[
i ].source_header.source.xml );
398 XMLReader sourcetop( xml_s );
407 quarks[
n ].dilutions[
i ].source_header.source.path );
412 quarks[ 0 ].j_decay = srcParams.
j_decay;
422 if ( toBool( srcParams.
ran_seed != quarks[
n ].seed ) )
424 QDPIO::cerr <<
"quark source=" <<
n <<
" dilution=" <<
i <<
" seed does not match" << std::endl;
428 if ( toBool( srcParams.
N != N ) )
430 QDPIO::cerr <<
"quark source=" <<
n <<
" dilution=" <<
i <<
" N does not match" << std::endl;
437 quark_noise -= quarks[
n ].dilutions[
i ].source;
439 Double dcnt = norm2( quark_noise );
440 if ( toDouble( dcnt ) != 0.0 )
442 QDPIO::cerr <<
"Noise not saturated by all potential solutions: dcnt=" << dcnt << std::endl;
450 QDPIO::cerr <<
": Caught Exception creating source: " << e << std::endl;
453 QDPIO::cout <<
"SOURCE vectors reconstructed from Seeds : time = " << swatch.getTimeInSeconds() <<
" secs" << std::endl;
455 #ifdef REDUCETOTIMEDILUTION
465 for(
int n=0;
n < quarks.size(); ++
n)
467 QDPIO::cout <<
"REDUCING spin-colour dilution levels for quark " <<
n << std::endl;
473 int NSpinDilution = 4;
474 int NColourDilution = 3;
475 int NSpaceDilution = 1;
477 quarks2[
n].seed = quarks[
n].seed;
478 for(
int i=0;
i < (NTimeDilution); ++
i)
481 quarks2[
n].dilutions[
i].source_header = quarks[
n].dilutions[
i*(
params.
NdilReduce)].source_header;
491 for(
int t=0;
t < NTimeDilution; ++
t)
494 for(
int x=0;
x < NSpaceDilution; ++
x)
496 indx2 =
x + NSpaceDilution * (
t );
497 LatticeFermion
Q=
zero;
498 for(
int c=0;
c < NColourDilution; ++
c)
500 for(
int s=0;
s < NSpinDilution; ++
s)
502 indx =
x + NSpaceDilution * (
s + NSpinDilution * (
c + NColourDilution * (
t ) ) );
504 Q += quarks[
n].dilutions[ indx ].source;
507 quarks2[
n].dilutions[ indx2 ].source =
Q;
514 QDPIO::cerr <<
": Caught Exception removing COLOUR and SPIN-dilution: " << e << std::endl;
518 QDPIO::cout <<
"COLOUR and SPIN DILUTION REMOVED: time= " << swatch.getTimeInSeconds() <<
" secs" << std::endl;
526 #ifdef REDUCETOTIMEDILUTION
527 COp[
n ].baryonoperator.seed_l = quarks2[0].seed;
528 COp[
n ].baryonoperator.seed_m = quarks2[1].seed;
529 COp[
n ].baryonoperator.seed_r = quarks2[2].seed;
531 COp[
n ].baryonoperator.seed_l = quarks[0].seed;
532 COp[
n ].baryonoperator.seed_m = quarks[1].seed;
533 COp[
n ].baryonoperator.seed_r = quarks[2].seed;
542 QDPIO::cout <<
"SOURCE Operator: ordering = " << ordering << std::endl;
546 const int L=0,M=1,R=2;
550 int qL =
DilSwap( ordering, 0,1,2, L );
551 int qM =
DilSwap( ordering, 0,1,2, M );
552 int qR =
DilSwap( ordering, 0,1,2, R );
587 #ifdef REDUCETOTIMEDILUTION
588 if( (quarks2[qL].dilutions[iL].source_header.t_source
589 == quarks2[qM].dilutions[iM].source_header.t_source)
590 &&(quarks2[qM].dilutions[iM].source_header.t_source
591 == quarks2[qR].dilutions[iR].source_header.t_source) )
593 if( (quarks[qL].dilutions[iL].source_header.t_source
594 == quarks[qM].dilutions[iM].source_header.t_source)
595 &&(quarks[qM].dilutions[iM].source_header.t_source
596 == quarks[qR].dilutions[iR].source_header.t_source) )
599 int i0 =
DilSwapInv( ordering, iL, iM, iR, 0 );
600 int i1 =
DilSwapInv( ordering, iL, iM, iR, 1 );
601 int i2 =
DilSwapInv( ordering, iL, iM, iR, 2 );
602 for(
int t=0;
t < phases.
getSet().numSubsets(); ++
t)
605 #ifdef REDUCETOTIMEDILUTION
607 quarks2[ qL ].dilutions[ iL ].source,
608 quarks2[ qM ].dilutions[ iM ].source,
609 quarks2[ qR ].dilutions[ iR ].source,
615 quarks[ qL ].dilutions[ iL ].source,
616 quarks[ qM ].dilutions[ iM ].source,
617 quarks[ qR ].dilutions[ iR ].source,
623 elem = phases.
sft( result );
624 for(
int b=0;
b < CQQQ[ qqq ].NBaryonOps; ++
b)
630 CQQQ[ qqq ].baryon[
b ]->baryonoperator.orderings[ 0 ].op( i0, i1, i2 ).ind[ 0 ].elem(
p,
t )
631 += ( CQQQ[ qqq ].coef[
b ] * signs * elem(
p,
t ) );
639 QDPIO::cout <<
"SOURCE operator " << ordering <<
" done: time= " << swatch.getTimeInSeconds() <<
" secs" << std::endl;
644 QDPIO::cerr <<
": Caught Exception creating source baryon operator: " << e << std::endl;
647 QDPIO::cout <<
"All SOURCE operators done" << std::endl;
654 XMLBufferWriter file_xml;
657 write( file_xml,
"Config_info", gauge_xml );
661 QDPFileWriter to( file_xml, output,
662 QDPIO_SINGLEFILE, QDPIO_SERIAL, QDPIO_OPEN );
665 XMLBufferWriter record_xml;
666 write( record_xml,
"SourceBaryonOperator", COp[
b ].baryonoperator );
667 write( to, record_xml, COp[
b ].baryonoperator.serialize() );
680 QDPIO::cout <<
"Operators written: time= " << swatch.getTimeInSeconds() <<
" secs" << std::endl;
683 QDPIO::cout<<
"end of group baryon operator calculation"<<std::endl;
692 XMLBufferWriter file_xml;
695 write( file_xml,
"Config_info", gauge_xml );
698 QDPIO_SINGLEFILE, QDPIO_SERIAL, QDPIO_OPEN );
701 XMLBufferWriter record_xml;
702 write( record_xml,
"SourceBaryonOperator", COp[
b ].baryonoperator );
703 write( to, record_xml, COp[
b ].baryonoperator.serialize() );
707 XMLBufferWriter record_xml;
708 write( record_xml,
"SinkBaryonOperator", AOp[
b ].baryonoperator );
709 write( to, record_xml, AOp[
b ].baryonoperator.serialize() );
714 QDPIO::cout <<
"Operators written: time= " << swatch.getTimeInSeconds() <<
" secs" << std::endl;
Primary include file for CHROMA in application codes.
Primary include file for CHROMA library code.
Random complex Z(N) sources using dilution.
Class for counted reference semantics.
Fourier transform phase factor support.
multi2d< DComplex > sft(const LatticeComplex &cf) const
Do a sumMulti(cf*phases,getSet())
const Set & getSet() const
The set to be used in sumMulti.
int main(int argc, char *argv[])
Construct group baryon operators.
void gaugeStartup(XMLReader &gauge_file_xml, XMLReader &gauge_xml, multi1d< LatticeColorMatrix > &u, Cfg_t &cfg)
Initialize the gauge fields.
void read(XMLReader &xml, const std::string &path, GroupBaryonOperatorEnv::Params::Qprop_t::Solutions_t &input)
Reader.
void proginfo(XMLWriter &xml)
Print out basic information about this program.
void zN_src(LatticeFermion &a, int N)
Volume source of Z(N) noise.
ForwardProp_t prop_header
const std::string name
Name to be used.
int DilSwapInv(int ord, int i, int j, int k, int which)
void ReadTextInput(Params ¶ms, multi1d< GroupBaryonOp > &AB, multi1d< GroupBaryonOp > &CB, multi1d< GroupBaryonQQQ > &AQQQ, multi1d< GroupBaryonQQQ > &CQQQ)
Reader.
void write(XMLWriter &xml, const std::string &path, const GroupBaryonOperatorEnv::Params ¶m)
int DilSwap(int ord, int i, int j, int k, int which)
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
LinOpSysSolverMGProtoClover::Q Q
push(xml_out,"Condensates")
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)
XMLFileWriter & getXMLOutputInstance()
Get xml output instance.
multi1d< LatticeFermion > s(Ncb)
FloatingPoint< double > Double
All make sink constructors.
Factory for producing quark prop sinks.
Factory for producing quark smearing objects.
Random complex Z(N) sources using dilution.
Group baryon operator parameters.
multi1d< multi1d< int > > quarkOrderings
multi1d< Solutions_t > solns
multi1d< LatticeColorMatrix > u
std::string baryon_operator
multi1d< dilution_t > dilution
multi1d< multi1d< int > > NH
PropSinkSmear_t sink_smearing
struct Chroma::GroupBaryonOperatorEnv::Params::Qprop_t qprop
struct Chroma::GroupBaryonOperatorEnv::Params::param_t param
struct Chroma::GroupBaryonOperatorEnv::Params::gaugestuff_t gaugestuff
multi1d< std::string > Names