00001
00002
00003
00004
00005
00006
00007 #include "chromabase.h"
00008
00009
00010
00011
00012 #include "actions/ferm/fermacts/fermact_factory_s.h"
00013 #include "actions/ferm/fermstates/ferm_createstate_reader_s.h"
00014
00015 #include "actions/ferm/linop/asqtad_mdagm_s.h"
00016 #include "actions/ferm/linop/asqtad_linop_s.h"
00017 #include "actions/ferm/fermacts/asqtad_fermact_s.h"
00018 #include "util/gauge/stag_phases_s.h"
00019
00020 namespace Chroma
00021 {
00022
00023
00024 namespace AsqtadFermActEnv
00025 {
00026
00027 StaggeredTypeFermAct<LatticeStaggeredFermion,
00028 multi1d<LatticeColorMatrix>,
00029 multi1d<LatticeColorMatrix> >* createFermAct4D(XMLReader& xml_in,
00030 const std::string& path)
00031 {
00032 return new AsqtadFermAct(StaggeredCreateFermStateEnv::reader(xml_in, path),
00033 AsqtadFermActParams(xml_in, path));
00034 }
00035
00036
00037
00038 FermionAction<LatticeStaggeredFermion,
00039 multi1d<LatticeColorMatrix>,
00040 multi1d<LatticeColorMatrix> >* createFermAct(XMLReader& xml_in,
00041 const std::string& path)
00042 {
00043 return createFermAct4D(xml_in, path);
00044 }
00045
00046
00047 const std::string name = "ASQTAD";
00048
00049
00050 static bool registered = false;
00051
00052
00053 bool registerAll()
00054 {
00055 bool success = true;
00056 if (! registered)
00057 {
00058 success &= Chroma::TheStagFermionActionFactory::Instance().registerObject(name, createFermAct);
00059 success &= Chroma::TheStagTypeFermActFactory::Instance().registerObject(name, createFermAct4D);
00060 registered = true;
00061 }
00062 return success;
00063 }
00064 }
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076 EvenOddLinearOperator<LatticeStaggeredFermion,
00077 multi1d<LatticeColorMatrix>,
00078 multi1d<LatticeColorMatrix> >*
00079 AsqtadFermAct::linOp(Handle< FermState<T,P,Q> > state) const
00080 {
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094 return new AsqtadLinOp(state.cast<AsqtadConnectStateBase>(), param.Mass);
00095 }
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105 DiffLinearOperator<LatticeStaggeredFermion,
00106 multi1d<LatticeColorMatrix>,
00107 multi1d<LatticeColorMatrix> >*
00108 AsqtadFermAct::lMdagM(Handle< FermState<T,P,Q> > state) const
00109 {
00110 return new AsqtadMdagM(state.cast<AsqtadConnectStateBase>(), param.Mass);
00111 }
00112
00113
00114
00115 AsqtadConnectStateBase*
00116 AsqtadFermAct::createState(const multi1d<LatticeColorMatrix>& u_) const
00117 {
00118 multi1d<LatticeColorMatrix> u_with_phases(Nd);
00119 multi1d<LatticeColorMatrix> u_fat(Nd);
00120 multi1d<LatticeColorMatrix> u_triple(Nd);
00121
00122
00123 u_with_phases = u_;
00124 getFermBC().modify(u_with_phases);
00125
00126
00127
00128
00129 for(int i = 0; i < Nd; i++) {
00130 u_with_phases[i] *= StagPhases::alpha(i);
00131 }
00132
00133
00134 Fat7_Links(u_with_phases, u_fat, param.u0);
00135 Triple_Links(u_with_phases, u_triple, param.u0);
00136
00137 return new AsqtadConnectState(cfs->getFermBC(), u_with_phases, u_fat, u_triple);
00138 }
00139
00140 }
00141