Grid 0.7.0
JacobianAction.h
Go to the documentation of this file.
1/*************************************************************************************
2
3Grid physics library, www.github.com/paboyle/Grid
4
5Source file: ./lib/qcd/action/gauge/JacobianAction.h
6
7Copyright (C) 2015
8
9Author: Peter Boyle <paboyle@ph.ed.ac.uk>
10
11This program is free software; you can redistribute it and/or modify
12it under the terms of the GNU General Public License as published by
13the Free Software Foundation; either version 2 of the License, or
14(at your option) any later version.
15
16This program is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19GNU General Public License for more details.
20
21You should have received a copy of the GNU General Public License along
22with this program; if not, write to the Free Software Foundation, Inc.,
2351 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24
25See the full license in the file "LICENSE" in the top level distribution
26directory
27*************************************************************************************/
28 /* END LEGAL */
29#pragma once
30
32
34// Jacobian Action ..
36template <class Gimpl>
37class JacobianAction : public Action<typename Gimpl::GaugeField> {
38public:
40
43 explicit JacobianAction(SmearedConfigurationMasked<Gimpl> * _smearer ) { smearer=_smearer;};
44
45 virtual std::string action_name() {return "JacobianAction";}
46
47 virtual std::string LogParameters(){
48 std::stringstream sstream;
49 sstream << GridLogMessage << "[JacobianAction] " << std::endl;
50 return sstream.str();
51 }
52
54 // Usual cases are not used
56 virtual void refresh(const GaugeField &U, GridSerialRNG &sRNG, GridParallelRNG &pRNG){ assert(0);};
57 virtual RealD S(const GaugeField &U) { assert(0); }
58 virtual void deriv(const GaugeField &U, GaugeField &dSdU) { assert(0); }
59
61 // Functions of smart configs only
64 {
65 return;
66 }
68 {
69 // det M = e^{ - ( - logDetM) }
70 assert( &U == smearer );
71 return -smearer->logDetJacobian();
72 }
74 {
75 return S(U);
76 }
77 virtual void deriv(ConfigurationBase<GaugeField>& U, GaugeField& dSdU)
78 {
79 assert( &U == smearer );
80 smearer->logDetJacobianForce(dSdU);
81 }
82
83private:
84 };
85
87
GridLogger GridLogMessage(1, "Message", GridLogColours, "NORMAL")
#define NAMESPACE_BEGIN(A)
Definition Namespace.h:35
#define NAMESPACE_END(A)
Definition Namespace.h:36
double RealD
Definition Simd.h:61
static INTERNAL_PRECISION U
Definition Zolotarev.cc:230
Base class for all actions.
Definition ActionBase.h:64
Base class for "smart configuration", a container for a gauge configuration holding unsmeared and sme...
Definition ActionBase.h:51
virtual void deriv(const GaugeField &U, GaugeField &dSdU)
virtual std::string action_name()
Report the name of the action.
virtual RealD S(const GaugeField &U)
Evaluate this action with the given gauge field.
SmearedConfigurationMasked< Gimpl > * smearer
virtual std::string LogParameters()
Print the parameters of the action.
virtual void refresh(ConfigurationBase< GaugeField > &U, GridSerialRNG &sRNG, GridParallelRNG &pRNG)
INHERIT_GIMPL_TYPES(Gimpl)
virtual void deriv(ConfigurationBase< GaugeField > &U, GaugeField &dSdU)
virtual RealD Sinitial(ConfigurationBase< GaugeField > &U)
JacobianAction(SmearedConfigurationMasked< Gimpl > *_smearer)
virtual RealD S(ConfigurationBase< GaugeField > &U)
virtual void refresh(const GaugeField &U, GridSerialRNG &sRNG, GridParallelRNG &pRNG)
Refresh pseudofermion fields.
Smeared configuration masked container Modified for a multi-subset smearing (aka Luscher Flowed HMC).