38 namespace DilutionQuarkSourceConstEnv
43 XMLReader inputtop(xml, path);
51 XMLReader inputtop(xml, path);
84 XMLReader paramtop(xml, path);
87 read(paramtop,
"version", version);
98 QDPIO::cerr <<
"Input parameter version " << version <<
" unsupported." << std::endl;
104 if(paramtop.count(
"UseSourceHeaderSmearing")!=0)
116 write(xml,
"version", version);
162 XMLReader rdr_a(xml_a);
165 XMLReader rdr_b(xml_b);
168 read(rdr_a,
"/Source/ran_seed" , seedA);
169 read(rdr_b,
"/Source/ran_seed" , seedB);
171 val |= toBool(seedA != seedB);
174 QDPIO::cerr<<
"random seeds are not the same." <<std::endl;
179 multi1d<int> mask_sizeA, mask_sizeB, cmaskA, cmaskB, smaskA, smaskB;
180 multi1d< multi1d<int> > maskA, maskB;
182 read(rdr_a,
"/Source/spatial_mask_size" , mask_sizeA);
183 read(rdr_b,
"/Source/spatial_mask_size" , mask_sizeB);
184 val |= toBool(mask_sizeA != mask_sizeB);
187 QDPIO::cerr<<
"spatial mask sizes are not the same." <<std::endl;
190 read(rdr_a,
"/Source/spatial_mask" , maskA);
191 read(rdr_b,
"/Source/spatial_mask" , maskB);
192 val |= toBool(maskA != maskB);
195 QDPIO::cerr<<
"spatial masks are not the same." <<std::endl;
198 read(rdr_a,
"/Source/color_mask" , cmaskA);
199 read(rdr_b,
"/Source/color_mask" , cmaskB);
200 val |= toBool(maskA != maskB);
203 QDPIO::cerr<<
"color masks are not the same." <<std::endl;
206 read(rdr_a,
"/Source/spin_mask" , smaskA);
207 read(rdr_b,
"/Source/spin_mask" , smaskB);
208 val |= toBool(maskA != maskB);
211 QDPIO::cerr<<
"spin masks are not the same." <<std::endl;
243 QDPIO::cout <<
"Attempt to read solutions " << std::endl;
247 QDPIO::cout<<
"time_slices.size = " <<
quark.
time_slices.size() << std::endl;
254 QDPIO::cout <<
"dilutions.size = " <<
264 XMLReader file_xml, record_xml, record_xml_source;
266 QDPIO::cout <<
"reading file = " <<
269 QDPFileReader from(file_xml,
274 read(from, record_xml, junk);
277 read(record_xml,
"/Propagator/PropSource",
279 read(record_xml,
"/Propagator/ForwardProp",
284 read(record_xml,
"/Propagator/PropSource/Source/N", currN);
288 read(record_xml,
"/Propagator/PropSource/Source/ran_seed",
291 read(record_xml,
"/Propagator/PropSource/Source/N", N);
297 std::istringstream xml_k(
299 XMLReader proptop(xml_k);
301 if ( toBool(proptop.count(
"/FermionAction/Kappa") != 0) )
303 read(proptop,
"/FermionAction/Kappa",
kappa);
308 read(proptop,
"/FermionAction/Mass",
mass);
313 XMLReader xml_tmp(record_xml,
"/Propagator/Config_info");
314 std::ostringstream os;
323 std::istringstream xml_k2(
325 XMLReader proptop2(xml_k2);
328 if ( toBool(proptop2.count(
"/FermionAction/Kappa") != 0) )
330 read(proptop2,
"/FermionAction/Kappa", kappa2);
335 read(proptop2,
"/FermionAction/Mass",
mass);
339 if ( toBool(
kappa != kappa2) )
341 QDPIO::cerr <<
"Kappa is not the same for all dilutions: t0=" <<
342 t0 <<
" dil= "<< dil <<
" kappa2 = "<< kappa2 << std::endl;
349 QDPIO::cerr <<
"N is not the same for all dilutions: t0 = " <<
350 t0 <<
" dil = " << dil << std::endl;
363 QDPIO::cerr <<
"t0's DO NOT MATCH FOR ALL DILUTIONS ON TIME SLICE "
374 QDPIO::cerr <<
"Dilutions do not match on time slice " <<
375 t0 <<
" dil = "<< dil<< std::endl;
383 XMLReader xml_tmp(record_xml,
"/Propagator/Config_info");
384 std::ostringstream os;
387 currCfgInfo = os.str();
392 QDPIO::cerr <<
"Cfgs do not match on time slice " <<
393 t0 <<
" dil = "<< dil<< std::endl;
406 #warning "Turned off the sanity check that the dilutions summed to a unity operator on a time-slice"
411 LatticeFermion quark_noise;
419 quark_noise -= source;
422 SftMom phases_nomom(0,
true,
425 Double dcnt = norm2(quark_noise,
428 if (toDouble(dcnt) != 0.0)
430 QDPIO::cerr <<
"Not a complete dilution scheme per timeslice" <<
440 QDPIO::cerr <<
"Error extracting headers: " << e << std::endl;
445 QDPIO::cout <<
"Source and solution headers successfully read: time = "
446 << swatch.getTimeInSeconds()
447 <<
" secs" << std::endl;
484 multi1d<LatticeColorMatrix>
dummy;
492 XMLReader sourcetop(xml_s);
506 <<
": Will NOT use Smearing/displacement options specified in the header\n"<<std::endl ;
507 srcParams.
smear = false ;
510 QDPIO::cout<<
name<<
": Smearing/displacement not implemented\n"<<std::endl ;
512 <<
": Will NOT use Smearing/displacement options specified in the header\n"<<std::endl ;
513 srcParams.
smear = false ;
521 LatticeFermion sour = srcConst(
dummy);
549 XMLReader file_xml, record_xml;
551 QDPIO::cout <<
"reading file = " << filename << std::endl;
552 QDPFileReader from(file_xml, filename, QDPIO_SERIAL);
554 read(from, record_xml, soln);
Random complex Z(N) sources using dilution.
Dilution scheme constructed by propagator solutions over diluted MAKE_SOURCE calls.
QuarkSourceSolutions_t quark
void init()
Initialize the object.
LatticeFermion dilutedSolution(int t0, int dil) const
Return the solution std::vector corresponding to the diluted source.
LatticeFermion dilutedSource(int t0, int dil) const
Return the diluted source std::vector.
Fourier transform phase factor support.
const Set & getSet() const
The set to be used in sumMulti.
Random Z(N) source construction using dilution.
Dilution scheme inferred from pre-generated solutions.
Factory for dilution schemes.
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.
Real massToKappa(const Real &Mass)
Convert a Kappa to a mass.
void zN_src(LatticeFermion &a, int N)
Volume source of Z(N) noise.
Class for counted reference semantics.
Named object function std::map.
static bool registered
Local registration flag.
std::string getName()
Return the name.
void write(XMLWriter &xml, const std::string &path, const DilutionQuarkSourceConstEnv::Params::QuarkFiles_t::TimeSliceFiles_t &input)
bool operator!=(const QuarkSourceSolutions_t::TimeSlices_t::Dilutions_t &dilA, const QuarkSourceSolutions_t::TimeSlices_t::Dilutions_t &dilB)
void read(XMLReader &xml, const std::string &path, DilutionQuarkSourceConstEnv::Params::QuarkFiles_t::TimeSliceFiles_t &input)
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
push(xml_out,"Condensates")
FloatingPoint< double > Double
Fourier transform phase factor support.
Random complex Z(N) sources using dilution.
multi1d< std::string > dilution_files
multi1d< TimeSliceFiles_t > timeslice_files
void writeXML(XMLWriter &xml_out, const std::string &path) const
bool UseSourceHeaderSmearing
PropSourceConst_t source_header
multi1d< TimeSlices_t > time_slices
Volume source of Z(N) noise.