20 const multi1d<LatticeColorMatrix>& u_,
24 init(fbc_, u_, approxMin_, approxMax_);
29 const multi1d<LatticeColorMatrix>& u_,
30 const multi1d<WordBase_t>& val_,
31 const multi1d<LatticeFermion>& vec_,
36 init(fbc_, u_, val_, vec_, val_max_, approxMin_, approxMax_);
42 const multi1d<LatticeColorMatrix>& u_,
46 std::ostringstream error_str;
48 if ( toBool(approxMin_ < 0 )) {
49 error_str <<
"OverlapConnectState::createState: approxMin_ has to be positive" << std::endl;
50 throw error_str.str();
53 if ( toBool(approxMax_ < approxMin_) ) {
54 error_str <<
"OverlapConnectState::createState: approxMax_ has to be larger than approxMin_" << std::endl;
55 throw error_str.str();
72 const multi1d<LatticeColorMatrix>& u_,
73 const multi1d<WordBase_t>& val_,
74 const multi1d<LatticeFermion>& vec_,
79 std::ostringstream error_str;
81 if ( val_.size() == 0 ) {
82 error_str <<
"Attempt to createState with 0 e-values and no approxMin" << std::endl;
83 throw error_str.str();
86 if ( val_.size() != vec_.size() ) {
87 error_str <<
"Attempt to createState with no of low eigenvalues != no of low eigenvectors" << std::endl;
88 throw error_str.str();
109 const multi1d<LatticeColorMatrix>& u_)
111 Real approxMin_ = 0.0;
112 Real approxMax_ = Real(2)*Real(
Nd);
113 init(fbc_, u_, approxMin_, approxMax_);
122 const multi1d<LatticeColorMatrix>& u_,
123 const Real& approxMin_)
126 Real approxMax_ = Real(2)*Real(
Nd);
127 init(fbc_, u_, approxMin_, approxMax_);
133 const multi1d<LatticeColorMatrix>& u_,
134 const multi1d<Real>& lambda_lo_,
135 const multi1d<LatticeFermion>& evecs_lo_,
136 const Real& lambda_hi_)
138 Real approxMax_ = lambda_hi_;
139 Real approxMin_ = fabs(lambda_lo_[ lambda_lo_.size() - 1 ]);
141 init(
fbc, u_, lambda_lo_, evecs_lo_, lambda_hi_, approxMin_, approxMax_);
153 const multi1d<LatticeColorMatrix> u_,
154 XMLReader& state_info_xml,
159 read(state_info_xml, state_info_path, tmp_info);
160 init(fbc_, u_, tmp_info, H);
171 const multi1d<LatticeColorMatrix>& u_,
175 init(fbc_, u_, state_info, H);
185 const multi1d<LatticeColorMatrix>& u_,
199 multi1d<Real> lambda_lo;
200 multi1d<LatticeFermion> eigv_lo;
205 readEigen(ritz_header, lambda_lo, eigv_lo, lambda_hi,
211 QDPIO::cerr <<
"Unsupported Eigenstd::vector format for reading " << std::endl;
215 QDPIO::cout <<
"createOverlapState: " << std::endl;
216 for(
int i=0;
i < lambda_lo.size();
i++) {
217 QDPIO::cout <<
"lambda_lo["<<
i<<
"]= " << lambda_lo[
i] << std::endl;
220 QDPIO::cout <<
"|lambda_high|= " << lambda_hi << std::endl;
237 multi1d<Double> check_norm(state_info.
getNWilsVec());
238 multi1d<Double> check_norm_rel(state_info.
getNWilsVec());
242 H(Me, eigv_lo[
i],
PLUS);
244 LatticeFermion lambda_e;
246 lambda_e = lambda_lo[
i]*eigv_lo[
i];
247 LatticeFermion
r_norm = Me - lambda_e;
248 check_norm[
i] = sqrt(norm2(
r_norm));
249 check_norm_rel[
i] = check_norm[
i]/fabs(
Double(lambda_lo[
i]));
251 QDPIO::cout <<
"Eigenpair " <<
i <<
" Resid Norm = "
252 << check_norm[
i] <<
" Resid Rel Norm = " << check_norm_rel[
i] << std::endl;
255 Real approxMax_ = lambda_hi;
256 Real approxMin_ = fabs(lambda_lo[ lambda_lo.size() - 1 ]);
258 init(fbc_, u_, lambda_lo, eigv_lo, lambda_hi, approxMin_, approxMax_);
262 QDPIO::cerr <<
"Recomputation of eigensystem not yet implemented" << std::endl;
267 QDPIO::cerr <<
"I have to create a state without min/max, loading/computing eigenvectors/values. How do I do that? "<< std::endl;
Primary include file for CHROMA library code.
Base class for all fermion action boundary conditions.
Class for counted reference semantics.
multi1d< WordBase_t > eigVal
multi1d< LatticeFermion > eigVec
Handle< FermBC< T, P, Q > > fbc
void init(Handle< FermBC< T, P, Q > > fbc_, const multi1d< LatticeColorMatrix > &u_, const WordBase_t &approxMin_, const WordBase_t &approxMax_)
for now inherit the deriv operation
multi1d< LatticeColorMatrix > u
const EigenIO_t & getEigenIO(void) const
int getNWilsVec(void) const
const Real & getApproxMax(void) const
bool computeEigVec(void) const
bool loadEigVec(void) const
const Real & getApproxMin(void) const
Simple version of FermState.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams ¶m)
Read parameters.
void readEigen(ChromaWilsonRitz_t &header, multi1d< Real > &lambda_lo, multi1d< LatticeFermion > &eigv_lo, Real &lambda_hi, const std::string &filename_stem, int Neig, QDP_serialparallel_t serpar)
Asqtad Staggered-Dirac operator.
FermBC< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > FBC
FloatingPoint< double > Double
Connection state holding eigenvectors.
Simple ferm state and a creator.
Struct for the overall application.
Struct for dumping the eigenvalues/vectors.
EigenVecType eigen_filefmt