CHROMA
background_fermbc_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! \file
3  * \brief quark bilinear background field fermionic BC
4  */
5 
6 #ifndef __background_fermbc_w_h__
7 #define __background_fermbc_w_h__
8 
9 #include "fermbc.h"
10 #include "handle.h"
12 
13 namespace Chroma
14 {
15  //! Params struct for twisted params
16  /*! \ingroup fermbcs */
19  BackgroundFermBCParams(XMLReader& in, const std::string& path);
20  multi1d<int> boundary;
21  int gamma ; //the gamma matrix in the quark bi-linear
22  Complex lambda; // the field
23  };
24 
25  // Readers writers
26  void read(XMLReader& xml, const std::string& path, BackgroundFermBCParams& param);
27  void write(XMLWriter& xml, const std::string& path, const BackgroundFermBCParams& param);
28 
29 
30  //! Name and registration
31  /*! \ingroup fermbcs */
32  namespace WilsonTypeBackgroundFermBCEnv
33  {
34  extern const std::string name;
35  bool registerAll();
36  }
37 
38 
39  //! Concrete class for all fermionic actions with twisted boundary conditions
40  /*!
41  * \ingroup fermbcs
42  *
43  * Background BC
44  */
45  template<class T>
46  class BackgroundFermBC : public FermBC<T,
47  multi1d<LatticeColorMatrix>,
48  multi1d<LatticeColorMatrix> >
49  {
50  public:
51 
52  //! Only full constructor
53  /*!
54  * \param boundary_phases multiply links on edge of lattice by boundary
55  *
56  * NOTE: there is no real reason this is of type int, could be more general
57  * like Complex
58  */
59 
60  BackgroundFermBC(int gamma_,
61  Complex lambda_,
62  const multi1d<int>& boundary_) :
63  gamma(gamma_),
64  lambda(lambda_),
66  multi1d<LatticeColorMatrix>,
67  multi1d<LatticeColorMatrix> >(boundary_))
68  { }
69 
70  //! Copy constructor
72  gamma(a.gamma),
73  lambda(a.lambda),
75  { }
76 
77  //! Destructor is automatic
79 
80  //! Assignment
82  {
83  lambda = a.lambda;
84  gamma = a.gamma ;
85  simple_bc_handle = a.simple_bc_handle;
86  return *this;
87  }
88 
89 
90  //! Modify U fields in place
91  void modify(multi1d<LatticeColorMatrix>& u) const
92  {
93  START_CODE();
94 
95  // Apply the simple BC's
96  (*simple_bc_handle).modify(u);
97 
98  //nothing else to do here
99 
100  END_CODE();
101  }
102 
103  //! Modify fermion fields in place
104  /*! add the quark bilinear */
105  void modifyF(T& psi) const {
106  psi += lambda*(Gamma(gamma)*psi) ;
107  }
108 
109  //! Modify fermion fields in place under a subset
110  /*! add the quark bilinear */
111  void modifyF(T& psi, const Subset& s) const {
112  psi[s] += lambda*(Gamma(gamma)*psi) ;
113  }
114 
115  //! Modify fermion fields in place
116  /*! add the quark bilinear */
117  void modifyF(multi1d<T>& psi) const {
118  QDPIO::cout<<"BACKGROUND BC NOT IMPLEMENTED"<<std::endl ;
119  QDP_abort(12003);
120  }
121 
122  //! Modify fermion fields in place under a subset
123  /*! add the quark bilinear */
124  void modifyF(multi1d<T>& psi, const Subset& s) const {
125  QDPIO::cout<<"BACKGROUND BC NOT IMPLEMENTED"<<std::endl ;
126  QDP_abort(12003);
127  }
128 
129  //! Zero some gauge-like field in place on the masked links
130  /*! NOP */
131  void zero(multi1d<LatticeColorMatrix>& ds_u) const {}
132 
133  //! Says if there are non-trivial BC links
134  bool nontrivialP() const {return true;}
135 
136 
137  private:
138  // No empty constructor
140 
141 
142  private:
143  int gamma;
144  Complex lambda ;
145 
147  multi1d<LatticeColorMatrix>,
148  multi1d<LatticeColorMatrix> > > simple_bc_handle;
149  };
150 
151 
152 } // Namespace Chroma
153 
154 
155 // End of include guard
156 #endif
Concrete class for all fermionic actions with twisted boundary conditions.
BackgroundFermBC(int gamma_, Complex lambda_, const multi1d< int > &boundary_)
Only full constructor.
BackgroundFermBC(const BackgroundFermBC &a)
Copy constructor.
bool nontrivialP() const
Says if there are non-trivial BC links.
void modifyF(multi1d< T > &psi, const Subset &s) const
Modify fermion fields in place under a subset.
BackgroundFermBC & operator=(const BackgroundFermBC &a)
Assignment.
void zero(multi1d< LatticeColorMatrix > &ds_u) const
Zero some gauge-like field in place on the masked links.
void modifyF(T &psi) const
Modify fermion fields in place.
void modify(multi1d< LatticeColorMatrix > &u) const
Modify U fields in place.
Handle< SimpleFermBC< T, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > simple_bc_handle
void modifyF(T &psi, const Subset &s) const
Modify fermion fields in place under a subset.
void modifyF(multi1d< T > &psi) const
Modify fermion fields in place.
~BackgroundFermBC()
Destructor is automatic.
Base class for all fermion action boundary conditions.
Definition: fermbc.h:20
Class for counted reference semantics.
Definition: handle.h:33
Concrete class for all gauge actions with simple boundary conditions.
Definition: simple_fermbc.h:42
Fermion action boundary conditions.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
Class for counted reference semantics.
const std::string name
Name to be used.
bool registerAll()
Register all the factories.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
static multi1d< LatticeColorMatrix > u
LinOpSysSolverMGProtoClover::T T
Complex a
Definition: invbicg.cc:95
LatticeFermion psi
Definition: mespbg5p_w.cc:35
START_CODE()
static QDP_ColorVector * in
multi1d< LatticeFermion > s(Ncb)
::std::string string
Definition: gtest.h:1979
Simple fermionic BC.
Params struct for twisted params.