12 multi1d<int> boundary;
20 XMLReader inputtop(xml, path);
26 read(inputtop,
"Cfg", input.
cfg);
33 QDPIO::cerr <<
"Error reading data: " << e << std::endl;
39 int main(
int argc,
char **argv)
48 read(xml_in,
"/ContFracTest", input);
51 QDPIO::cerr <<
"Caught Exception : " << e << std::endl;
57 Layout::setLattSize(input.
nrow);
60 multi1d<LatticeColorMatrix>
u(
Nd);
61 XMLReader gauge_file_xml, gauge_xml;
65 push(xml_out,
"ContFracTest");
69 MesPlq(xml_out,
"Observables",
u);
78 std::istringstream state_info_is(input.
stateInfo);
79 XMLReader state_info_xml(state_info_is);
90 QDPIO::cout <<
"Unprec LinOp size = " << M_u->size() << std::endl;
91 QDPIO::cout <<
"Prec LinOp size = " << M_e->size() << std::endl;
94 multi1d<LatticeFermion>
s(
N5);
95 multi1d<LatticeFermion> Mu_s(
N5);
96 multi1d<LatticeFermion> Me_s(
N5);
97 multi1d<LatticeFermion>
r(
N5);
99 for(
int i=0;
i<
N5;
i++) {
108 for(
int i=1;
i <
s.size();
i++) {
109 s_norm10 += norm2(
s[
i]);
112 for(
int i=0;
i <
s.size();
i++) {
113 s[
i] /= sqrt(s_norm10);
117 (*M_u)(Mu_s,
s,
PLUS);
118 (*M_e).unprecLinOp(Me_s,
s,
PLUS);
120 for(
int i=0;
i <
N5;
i++) {
121 r[
i] = Mu_s[
i] - Me_s[
i];
122 QDPIO::cout <<
"i[0]= " <<
i <<
" || r [" <<
i <<
"] || = "
123 << sqrt(norm2(
r[
i], rb[0])) << std::endl;
124 QDPIO::cout <<
"i[1]= " <<
i <<
" || r [" <<
i <<
"] || = "
125 << sqrt(norm2(
r[
i], rb[1])) << std::endl;
131 (*M_e).unprecLinOp(Me_s,
s,
MINUS);
133 for(
int i=0;
i <
N5;
i++) {
134 r[
i] = Mu_s[
i] - Me_s[
i];
135 QDPIO::cout <<
"i = " <<
i <<
" || r [" <<
i <<
"] || = "
136 << sqrt(norm2(
r[
i])) << std::endl;
140 multi1d<LatticeFermion> source(
N5);
141 for(
int i=0;
i <
N5;
i++) {
144 Double source_norm = sqrt(norm2(source));
145 for(
int i=0;
i <
N5;
i++) {
146 source[
i] /= source_norm;
149 multi1d<LatticeFermion> unprec_source(
N5);
150 multi1d<LatticeFermion> prec_source(
N5);
151 for(
int i=0;
i <
N5;
i++) {
152 unprec_source[
i] = source[
i];
153 prec_source[
i] = source[
i];
156 multi1d<LatticeFermion> unprec_soln(
N5);
157 multi1d<LatticeFermion> prec_soln(
N5);
161 Real
RsdCG = Real(1.0e-6);
164 int n_count_unprec=0;
168 multi1d<LatticeFermion>
tmp(
N5);
179 multi1d<LatticeFermion>
tmp(
N5);
180 multi1d<LatticeFermion>
tmp2(
N5);
183 M_e->evenEvenInvLinOp(
tmp, prec_source,
PLUS);
186 multi1d<LatticeFermion> tmp_source(
N5);
187 for(
int i=0;
i <
N5;
i++) {
189 tmp_source[
i][rb[0]] = prec_source[
i];
192 tmp_source[
i][rb[1]] = prec_source[
i] -
tmp2[
i];
196 multi1d<LatticeFermion> cgne_source(
N5);
197 multi1d<LatticeFermion> tmp_soln(
N5);
201 (*M_e)(cgne_source, tmp_source,
MINUS);
208 M_e->evenOddLinOp(
tmp, tmp_soln,
PLUS);
211 for(
int i=0;
i <
N5;
i++) {
214 M_e->evenEvenInvLinOp(prec_soln,
tmp2,
PLUS);
217 for(
int i=0;
i <
N5;
i++) {
218 prec_soln[
i][rb[1]] = tmp_soln[
i];
223 (*M_u)(
r, unprec_soln,
PLUS);
225 for(
int i=0;
i <
N5;
i++) {
229 QDPIO::cout <<
"|| source - M_u unprec_soln || = " << sqrt(
r_norm) << std::endl;
231 (*M_u)(
r, prec_soln,
PLUS);
233 for(
int i=0;
i <
N5;
i++) {
237 QDPIO::cout <<
"|| source - M_u prec_soln || = " << sqrt(
r_norm) << std::endl;
239 (*M_e).unprecLinOp(
r, unprec_soln,
PLUS);
241 for(
int i=0;
i <
N5;
i++) {
245 QDPIO::cout <<
"|| source - M_e unprec_soln || = " << sqrt(
r_norm) << std::endl;
247 (*M_e).unprecLinOp(
r, prec_soln,
PLUS);
249 for(
int i=0;
i <
N5;
i++) {
253 QDPIO::cout <<
"|| source - M_e prec_soln || = " << sqrt(
r_norm) << std::endl;
257 multi1d<LatticeFermion> f_even(
N5);
258 multi1d<LatticeFermion> t1(
N5);
259 multi1d<LatticeFermion> t2(
N5);
264 for(
int i=0;
i <
N5;
i++) {
265 f_even[
i][rb[1]] =
zero ;
266 f_even[
i][rb[0]] = source[
i];
269 M_e->evenEvenLinOp(t1, f_even,
PLUS);
270 M_e->evenEvenInvLinOp(t2, t1,
PLUS);
273 for(
int i=0;
i <
N5;
i++) {
275 r[
i][rb[0]] -= f_even[
i];
279 QDPIO::cout <<
"|| source_even - Qee^{-1}Qee sorce_even || = "
280 << sqrt(
r_norm) << std::endl;
Primary include file for CHROMA in application codes.
5D continued fraction overlap action (Borici,Wenger, Edwards)
EvenOddPrecConstDetLinearOperatorArray< T, P, Q > * linOp(Handle< FermState< T, P, Q > > state) const
Produce a linear operator for this action.
virtual FermState< T, P, Q > * createState(const Q &q) const
Given links (coordinates Q) create the state needed for the linear operators.
Class for counted reference semantics.
5D continued fraction overlap action (Borici,Wenger, Edwards)
UnprecLinearOperatorArray< T, P, Q > * linOp(Handle< FermState< T, P, Q > > state) const
Produce a linear operator for this action.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams ¶m)
Read parameters.
void gaugeStartup(XMLReader &gauge_file_xml, XMLReader &gauge_xml, multi1d< LatticeColorMatrix > &u, Cfg_t &cfg)
Initialize the gauge fields.
SystemSolverResults_t InvCG2(const LinearOperator< LatticeFermionF > &M, const LatticeFermionF &chi, LatticeFermionF &psi, const Real &RsdCG, int MaxCG)
Conjugate-Gradient (CGNE) algorithm for a generic Linear Operator.
Asqtad Staggered-Dirac operator.
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > const multi1d< Real > enum InvType invType const multi1d< Real > & RsdCG
static multi1d< LatticeColorMatrix > u
push(xml_out,"Condensates")
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > const multi1d< Real > enum InvType invType const multi1d< Real > int MaxCG
void initialize(int *argc, char ***argv)
Chroma initialisation routine.
void finalize(void)
Chroma finalization routine.
std::string getXMLInputFileName()
Get input file name.
void MesPlq(const multi1d< LatticeColorMatrixF3 > &u, multi2d< Double > &plane_plaq, Double &link)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
XMLFileWriter & getXMLOutputInstance()
Get xml output instance.
multi1d< LatticeFermion > s(Ncb)
FloatingPoint< double > Double
Gauge configuration structure.
Params for 5D overlap ferm acts.
Params for 5D overlap ferm acts.
int main(int argc, char **argv)