CHROMA
fixed_random_ferm_monomial.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*! @file
4  * @brief Fixed random monomial
5  */
6 
7 #include "chromabase.h"
12 
13 namespace Chroma {
14 
15  namespace FixedRandomFermMonomial4DEnv
16  {
17  //! Callback function for the factory
19  multi1d<LatticeColorMatrix> >* createMonomial(XMLReader& xml, const std::string& path)
20  {
22 
23  }
24 
25  const std::string name("FIXED_RANDOM_X_FERM_MONOMIAL");
26 
27  //! Local registration flag
28  static bool registered = false;
29 
30  //! Register all the factories
31  bool registerAll()
32  {
33  bool success = true;
34  if (! registered)
35  {
36  success &= TheMonomialFactory::Instance().registerObject(name, createMonomial);
37  registered = true;
38  }
39  return success;
40  }
41  }
42 
43 
45  {
46  START_CODE();
47 
48  X.resize(Nd);
49  for(int mu=0; mu < Nd; mu++) {
50  gaussian(X[mu]);
51  reunit(X[mu]);
52  }
53 
54  std::istringstream is( p.fermstate.xml );
55  QDPIO::cout << "FermStateXML is: " << p.fermstate.xml << std::endl;
56 
57  XMLReader xml_in(is);
58 
59  cfs = new CreateStoutFermState<LatticeFermion,
60  multi1d<LatticeColorMatrix>,
61  multi1d<LatticeColorMatrix> >(WilsonTypeFermBCEnv::reader(xml_in, "/FermState"),
62  StoutFermStateParams(xml_in, "/FermState"));
63 
64  END_CODE();
65  }
66 
68  {
69  START_CODE();
70 
71  Handle< StoutFermState<LatticeFermion,
72  multi1d<LatticeColorMatrix>,
73  multi1d<LatticeColorMatrix> >
74  > state = (*cfs)(s.getQ()); // Create a
75 
76  F.resize(Nd);
77  F = X;
78 
79  state->deriv(F);
80 
81  XMLWriter& xml_out = TheXMLLogWriter::Instance();
82 
83  push(xml_out, "FixedRandomFermMonomial4D");
84  Double F_sq = norm2(F);
85  write(xml_out, "F_sq", F_sq);
86  pop(xml_out);
87 
88  END_CODE();
89  }
90 
92  {
93  START_CODE();
94 
95  XMLWriter& xml_out = TheXMLLogWriter::Instance();
96  push(xml_out, "FixedRandomFermMonomial4D");
97 
98  Handle< StoutFermState<LatticeFermion,
99  multi1d<LatticeColorMatrix>,
100  multi1d<LatticeColorMatrix> >
101  > state = (*cfs)(s.getQ()); // Create a
102  const Q& u = state->getLinks();
103 
104  Double ret_val = sum(real(trace(u[0]*X[0])));
105  for(int mu=1; mu < Nd; mu++) {
106  ret_val += sum(real(trace(u[mu]*X[mu])));
107  }
108  ret_val *= Double(2);
109  write(xml_out, "S", ret_val);
110  pop(xml_out);
111 
112  return ret_val;
113 
114  END_CODE();
115  }
116 
117 }
118 
Primary include file for CHROMA library code.
Abstract field state.
Definition: field_state.h:27
Create a stout ferm connection state.
Double S(const AbsFieldState< P, Q > &s)
Compute the total action.
void dsdq(P &F, const AbsFieldState< P, Q > &s)
Compute dsdq for the system... Not specified how to actually do this.
Handle< CreateStoutFermState< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > cfs
FixedRandomFermMonomial4D(const FixedRandomFermMonomialParams &p_)
Class for counted reference semantics.
Definition: handle.h:33
An abstract monomial class, for inexact algorithms.
Definition: abs_monomial.h:43
static T & Instance()
Definition: singleton.h:432
Stout field state.
int mu
Definition: cool.cc:24
Fermion boundary conditions.
Fixed random monomial.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
Handle< FermBC< LatticeFermion, multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > reader(XMLReader &xml_in, const std::string &path)
Helper function for the FermionAction readers.
Nd
Definition: meslate.cc:74
Monomial factories.
const std::string name("FIXED_RANDOM_X_FERM_MONOMIAL")
bool registerAll()
Register all the factories.
static bool registered
Local registration flag.
Monomial< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createMonomial(XMLReader &xml, const std::string &path)
Callback function for the factory.
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
gaussian(aux)
static multi1d< LatticeColorMatrix > u
push(xml_out,"Condensates")
void reunit(LatticeColorMatrixF3 &xa)
Definition: reunit.cc:467
pop(xml_out)
START_CODE()
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Definition: pbg5p_w.cc:28
multi1d< LatticeFermion > s(Ncb)
FloatingPoint< double > Double
Definition: gtest.h:7351
::std::string string
Definition: gtest.h:1979
Double sum
Definition: qtopcor.cc:37
Stout field state for stout links and a creator.
static INTERNAL_PRECISION F