CHROMA
overlap_state.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! @file
3  * @brief Connection state holding eigenvectors
4  *
5  * Holds gauge fields and eigenvectors for overlap-ish thingies
6  */
7 
8 #ifndef __overlap_state_h__
9 #define __overlap_state_h__
10 
11 #include "state.h"
12 #include "chromabase.h"
13 #include "io/overlap_state_info.h"
14 #include "fermact.h"
15 
16 
17 
18 namespace Chroma
19 {
20 
21  //! Overlap connection state
22  /*! \ingroup fermstates */
23  class OverlapConnectState : public FermState<LatticeFermion,
24  multi1d<LatticeColorMatrix>,
25  multi1d<LatticeColorMatrix> >
26  {
27  public:
28  // Typedefs to save typing
29  typedef LatticeFermion T;
30  typedef multi1d<LatticeColorMatrix> P;
31  typedef multi1d<LatticeColorMatrix> Q;
32 
33  typedef Real WordBase_t;
34 
35  //! Constructor with no eigenvalues
37  const multi1d<LatticeColorMatrix>& u_, // gauge field
38  const WordBase_t& approxMin_, // epsilon
39  const WordBase_t& approxMax_); // approx max
40 
41  //! Constructor with e-values and e-vectors
43  const multi1d<LatticeColorMatrix>& u_,
44  const multi1d<WordBase_t>& val_,
45  const multi1d<LatticeFermion>& vec_,
46  const WordBase_t& val_max_,
47  const WordBase_t& approxMin_,
48  const WordBase_t& approxMax_);
49 
50  //---------------------------------------------
51  // These versions of constructors deal with funky input. RGE would like
52  // to get rid of them.
53 
54  //! Create a ConnectState with just the gauge fields
56  const multi1d<LatticeColorMatrix>& u_);
57 
58  //! Create a ConnectState with just the gauge fields, and a lower
59  //! approximation bound
61  const multi1d<LatticeColorMatrix>& u_,
62  const Real& approxMin_);
63 
64  //! Create OverlapConnectState with eigenvalues/vectors
66  const multi1d<LatticeColorMatrix>& u_,
67  const multi1d<Real>& lambda_lo_,
68  const multi1d<LatticeFermion>& evecs_lo_,
69  const Real& lambda_hi_);
70 
71  //! Create a ConnectState out of XML
73  const multi1d<LatticeColorMatrix> u_,
74  XMLReader& state_info_xml,
75  const std::string& state_info_path,
77 
78  //! Create from OverlapStateInfo Structure
80  const multi1d<LatticeColorMatrix>& u_,
81  const OverlapStateInfo& state_info,
83  //---------------------------------------------
84 
85  //! Copy constructor
91 
93 
94  //! Return the ferm BC object for this state
95  const FermBC<T,P,Q>& getBC() const {return *fbc;}
96 
97  //! Return the ferm BC object for this state
98  Handle< FermBC<T,P,Q> > getFermBC() const {return fbc;}
99 
100  //! Return the link fields needed in constructing linear operators
101  const multi1d<LatticeColorMatrix>& getLinks() const {return u;}
102 
103  //! Return the eigenvalues
104  const multi1d<WordBase_t>& getEigVal() const {return eigVal;}
105 
106  //! Return the eigenvectors
107  const multi1d<LatticeFermion>& getEigVec() const {return eigVec;}
108 
109  //! Return the max eigenvalues
110  const WordBase_t& getEigValMax() const {return eigValMax;}
111 
112  const WordBase_t& getApproxMin() const { return approxMin; }
113  const WordBase_t& getApproxMax() const { return approxMax; }
114 
115  //! for now inherit the deriv operation
116 
117  protected:
118  //! Constructor with no eigenvalues
119  void init(Handle< FermBC<T,P,Q> > fbc_,
120  const multi1d<LatticeColorMatrix>& u_, // gauge field
121  const WordBase_t& approxMin_, // epsilon
122  const WordBase_t& approxMax_); // approx max
123 
124  //! Constructor with e-values and e-vectors
125  void init(Handle< FermBC<T,P,Q> > fbc_,
126  const multi1d<LatticeColorMatrix>& u_,
127  const multi1d<WordBase_t>& val_,
128  const multi1d<LatticeFermion>& vec_,
129  const WordBase_t& val_max_,
130  const WordBase_t& approxMin_,
131  const WordBase_t& approxMax_);
132 
133  //! Create from OverlapStateInfo Structure
134  void init(Handle< FermBC<T,P,Q> > fbc_,
135  const multi1d<LatticeColorMatrix>& u_,
136  const OverlapStateInfo& state_info,
138 
139  private:
140  OverlapConnectState() {} // hide default constructur
141  void operator=(const OverlapConnectState&) {} // hide =
142 
143  private:
145  multi1d<LatticeColorMatrix> u;
146  multi1d<WordBase_t> eigVal;
147  multi1d<LatticeFermion> eigVec;
151  };
152 
153 
154 
155 #if 0
156  // NOTE: there should be a a creator here with some of the functionality
157  // of the overlapstate moved inside. This might simply a tad bit the
158  // creation. E.g., all the funky ways to create a state would be moved
159  // here and the state itself only hold the basic stuff.
160  class CreateOverlapConnectState : public CreateFermState<LatticeFermion,
161  multi1d<LatticeColorMatrix>,
162  multi1d<LatticeColorMatrix> >
163  {
164  public:
165  //! Constructor with no eigenvalues
166  CreateOverlapConnectState();
167  };
168 #endif
169 
170 
171 } // namespace Chroma
172 
173 #endif
Primary include file for CHROMA library code.
Create a fermion connection state.
Definition: create_state.h:69
Base class for all fermion action boundary conditions.
Definition: fermbc.h:20
Support class for fermion actions and linear operators.
Definition: state.h:94
Class for counted reference semantics.
Definition: handle.h:33
Overlap connection state.
Definition: overlap_state.h:26
multi1d< LatticeColorMatrix > Q
Definition: overlap_state.h:31
const WordBase_t & getApproxMax() const
const multi1d< WordBase_t > & getEigVal() const
Return the eigenvalues.
multi1d< WordBase_t > eigVal
multi1d< LatticeColorMatrix > P
Definition: overlap_state.h:30
multi1d< LatticeFermion > eigVec
void operator=(const OverlapConnectState &)
const multi1d< LatticeColorMatrix > & getLinks() const
Return the link fields needed in constructing linear operators.
const WordBase_t & getEigValMax() const
Return the max eigenvalues.
const multi1d< LatticeFermion > & getEigVec() const
Return the eigenvectors.
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
Handle< FermBC< T, P, Q > > getFermBC() const
Return the ferm BC object for this state.
Definition: overlap_state.h:98
const WordBase_t & getApproxMin() const
const FermBC< T, P, Q > & getBC() const
Return the ferm BC object for this state.
Definition: overlap_state.h:95
OverlapConnectState(const OverlapConnectState &a)
Copy constructor.
Definition: overlap_state.h:86
multi1d< LatticeColorMatrix > u
Class structure for fermion actions.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
Complex a
Definition: invbicg.cc:95
::std::string string
Definition: gtest.h:1979
Support class for fermion actions and linear operators.