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;
228 for(
int t=0;
t < NTimeDilution; ++
t)
230 for(
int x=0;
x < NSpaceDilution; ++
x)
232 indx2 =
x + NSpaceDilution * (
t );
233 LatticeFermion
Q=
zero;
234 for(
int c=0;
c < NColourDilution; ++
c)
236 for(
int s=0;
s < NSpinDilution; ++
s)
238 indx =
x + NSpaceDilution * (
s + NSpinDilution * (
c + NColourDilution * (
t ) ) );
240 Q += quarks[
n].dilutions[ indx ].soln;
243 quarks2[
n].dilutions[ indx2 ].soln =
Q;
250 QDPIO::cerr <<
": Caught Exception removing COLOUR and SPIN-dilution: " << e << std::endl;
254 QDPIO::cout <<
"COLOUR and SPIN dilution removed: time= " << swatch.getTimeInSeconds() <<
" secs" << std::endl;
260 QDPIO::cout <<
"Making the SINK operators" << std::endl;
264 #ifdef REDUCETOTIMEDILUTION
265 AOp[
n ].baryonoperator.seed_l = quarks2[0].seed;
266 AOp[
n ].baryonoperator.seed_m = quarks2[1].seed;
267 AOp[
n ].baryonoperator.seed_r = quarks2[2].seed;
269 AOp[
n ].baryonoperator.seed_l = quarks[0].seed;
270 AOp[
n ].baryonoperator.seed_m = quarks[1].seed;
271 AOp[
n ].baryonoperator.seed_r = quarks[2].seed;
277 XMLReader sinktop( xml_s );
283 #ifdef REDUCETOTIMEDILUTION
284 for(
int n=0;
n < quarks2.size(); ++
n)
288 ( *sinkSmearing ) ( quarks2[
n ].dilutions[
i ].soln );
292 for(
int n=0;
n < quarks.size(); ++
n)
296 ( *sinkSmearing ) ( quarks[
n ].dilutions[
i ].soln );
301 QDPIO::cout <<
"SINK smearings done: time= " << swatch.getTimeInSeconds() <<
" secs" << std::endl;
310 #ifdef REDUCETOTIMEDILUTION
311 vresult = AQQQ[ qqq ](
312 quarks2[ 0 ].dilutions[
i ].soln,
313 quarks2[ 1 ].dilutions[
j ].soln,
314 quarks2[ 2 ].dilutions[
k ].soln,
318 vresult = AQQQ[ qqq ](
319 quarks[ 0 ].dilutions[
i ].soln,
320 quarks[ 1 ].dilutions[
j ].soln,
321 quarks[ 2 ].dilutions[
k ].soln,
325 elem = phases.
sft( vresult[ 0 ] );
326 for(
int b=0;
b < AQQQ[ qqq ].NBaryonOps; ++
b)
332 AQQQ[ qqq ].baryon[
b ]->baryonoperator.orderings[ 0 ].op(
i,
j,
k ).ind[ 0 ].elem(
p,
t )
333 += ( AQQQ[ qqq ].coef[
b ] * elem(
p,
t ) );
343 QDPIO::cerr <<
": Caught Exception creating sink baryon operator: " << e << std::endl;
346 QDPIO::cout <<
"SINK operators done: time= " << swatch.getTimeInSeconds() <<
" secs" << std::endl;
352 XMLBufferWriter file_xml;
355 write( file_xml,
"Config_info", gauge_xml );
359 QDPFileWriter to( file_xml, output,
360 QDPIO_SINGLEFILE, QDPIO_SERIAL, QDPIO_OPEN );
371 XMLBufferWriter record_xml;
372 write( record_xml,
"SinkBaryonOperator", AOp[
b ].baryonoperator );
373 write( to, record_xml, AOp[
b ].baryonoperator.serialize() );
378 QDPIO::cout <<
"Operators written: time= " << swatch.getTimeInSeconds() <<
" secs" << std::endl;
381 #ifdef MAKE_SOURCE_OPERATORS
385 QDPIO::cout <<
"Re-generating the noise SOURCES" << std::endl;
390 for(
int n=0;
n < quarks.size(); ++
n)
393 LatticeFermion quark_noise;
394 for(
int i=0;
i < quarks[
n ].dilutions.size(); ++
i)
396 std::istringstream xml_s( quarks[
n ].dilutions[
i ].source_header.source.xml );
397 XMLReader sourcetop( xml_s );
406 quarks[
n ].dilutions[
i ].source_header.source.path );
411 quarks[ 0 ].j_decay = srcParams.
j_decay;
421 if ( toBool( srcParams.
ran_seed != quarks[
n ].seed ) )
423 QDPIO::cerr <<
"quark source=" <<
n <<
" dilution=" <<
i <<
" seed does not match" << std::endl;
427 if ( toBool( srcParams.
N != N ) )
429 QDPIO::cerr <<
"quark source=" <<
n <<
" dilution=" <<
i <<
" N does not match" << std::endl;
436 quark_noise -= quarks[
n ].dilutions[
i ].source;
438 Double dcnt = norm2( quark_noise );
439 if ( toDouble( dcnt ) != 0.0 )
441 QDPIO::cerr <<
"Noise not saturated by all potential solutions: dcnt=" << dcnt << std::endl;
449 QDPIO::cerr <<
": Caught Exception creating source: " << e << std::endl;
452 QDPIO::cout <<
"SOURCE vectors reconstructed from Seeds : time = " << swatch.getTimeInSeconds() <<
" secs" << std::endl;
454 #ifdef REDUCETOTIMEDILUTION
464 for(
int n=0;
n < quarks.size(); ++
n)
466 QDPIO::cout <<
"REDUCING spin-colour dilution levels for quark " <<
n << std::endl;
472 int NSpinDilution = 4;
473 int NColourDilution = 3;
474 int NSpaceDilution = 1;
476 quarks2[
n].seed = quarks[
n].seed;
477 for(
int i=0;
i < (NTimeDilution); ++
i)
480 quarks2[
n].dilutions[
i].source_header = quarks[
n].dilutions[
i*(
params.
NdilReduce)].source_header;
486 for(
int t=0;
t < NTimeDilution; ++
t)
488 for(
int x=0;
x < NSpaceDilution; ++
x)
490 indx2 =
x + NSpaceDilution * (
t );
491 LatticeFermion
Q=
zero;
492 for(
int c=0;
c < NColourDilution; ++
c)
494 for(
int s=0;
s < NSpinDilution; ++
s)
496 indx =
x + NSpaceDilution * (
s + NSpinDilution * (
c + NColourDilution * (
t ) ) );
497 Q += quarks[
n].dilutions[ indx ].source;
500 quarks2[
n].dilutions[ indx2 ].source =
Q;
507 QDPIO::cerr <<
": Caught Exception removing COLOUR and SPIN-dilution: " << e << std::endl;
511 QDPIO::cout <<
"COLOUR and SPIN DILUTION REMOVED: time= " << swatch.getTimeInSeconds() <<
" secs" << std::endl;
519 #ifdef REDUCETOTIMEDILUTION
520 COp[
n ].baryonoperator.seed_l = quarks2[0].seed;
521 COp[
n ].baryonoperator.seed_m = quarks2[1].seed;
522 COp[
n ].baryonoperator.seed_r = quarks2[2].seed;
524 COp[
n ].baryonoperator.seed_l = quarks[0].seed;
525 COp[
n ].baryonoperator.seed_m = quarks[1].seed;
526 COp[
n ].baryonoperator.seed_r = quarks[2].seed;
535 QDPIO::cout <<
"SOURCE Operator: ordering = " << ordering << std::endl;
539 const int L=0,M=1,R=2;
543 int qL =
DilSwap( ordering, 0,1,2, L );
544 int qM =
DilSwap( ordering, 0,1,2, M );
545 int qR =
DilSwap( ordering, 0,1,2, R );
580 #ifdef REDUCETOTIMEDILUTION
581 if( (quarks2[qL].dilutions[iL].source_header.t_source
582 == quarks2[qM].dilutions[iM].source_header.t_source)
583 &&(quarks2[qM].dilutions[iM].source_header.t_source
584 == quarks2[qR].dilutions[iR].source_header.t_source) )
586 if( (quarks[qL].dilutions[iL].source_header.t_source
587 == quarks[qM].dilutions[iM].source_header.t_source)
588 &&(quarks[qM].dilutions[iM].source_header.t_source
589 == quarks[qR].dilutions[iR].source_header.t_source) )
592 int i0 =
DilSwapInv( ordering, iL, iM, iR, 0 );
593 int i1 =
DilSwapInv( ordering, iL, iM, iR, 1 );
594 int i2 =
DilSwapInv( ordering, iL, iM, iR, 2 );
595 for(
int t=0;
t < phases.
getSet().numSubsets(); ++
t)
598 #ifdef REDUCETOTIMEDILUTION
600 quarks2[ qL ].dilutions[ iL ].source,
601 quarks2[ qM ].dilutions[ iM ].source,
602 quarks2[ qR ].dilutions[ iR ].source,
608 quarks[ qL ].dilutions[ iL ].source,
609 quarks[ qM ].dilutions[ iM ].source,
610 quarks[ qR ].dilutions[ iR ].source,
616 elem = phases.
sft( result );
617 for(
int b=0;
b < CQQQ[ qqq ].NBaryonOps; ++
b)
623 CQQQ[ qqq ].baryon[
b ]->baryonoperator.orderings[ 0 ].op( i0, i1, i2 ).ind[ 0 ].elem(
p,
t )
624 += ( CQQQ[ qqq ].coef[
b ] * signs * elem(
p,
t ) );
632 QDPIO::cout <<
"SOURCE operator " << ordering <<
" done: time= " << swatch.getTimeInSeconds() <<
" secs" << std::endl;
637 QDPIO::cerr <<
": Caught Exception creating source baryon operator: " << e << std::endl;
640 QDPIO::cout <<
"All SOURCE operators done" << std::endl;
647 XMLBufferWriter file_xml;
650 write( file_xml,
"Config_info", gauge_xml );
654 QDPFileWriter to( file_xml, output,
655 QDPIO_SINGLEFILE, QDPIO_SERIAL, QDPIO_OPEN );
658 XMLBufferWriter record_xml;
659 write( record_xml,
"SourceBaryonOperator", COp[
b ].baryonoperator );
660 write( to, record_xml, COp[
b ].baryonoperator.serialize() );
673 QDPIO::cout <<
"Operators written: time= " << swatch.getTimeInSeconds() <<
" secs" << std::endl;
676 QDPIO::cout<<
"end of group baryon operator calculation"<<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.
Construct group baryon operators.
int main(int argc, char *argv[])
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