JeffersonLab / qphix

QCD for Intel Xeon Phi and Xeon processors
http://jeffersonlab.github.io/qphix/
Other
13 stars 11 forks source link

Checkerboarding of Wilson and Clover operators looks different #32

Closed martin-ueding closed 7 years ago

martin-ueding commented 7 years ago

While browsing the code, I noticed some strangeness around the checkerboarding.

In wilson.h, there is the following operator:

void operator()(FourSpinorBlock *res, const FourSpinorBlock *in, int isign) {
    D->dslash(tmp, in, u[1], isign, 1);
    D->dslashAChiMinusBDPsi(res, tmp, in, u[0], mass_factor_alpha,
                            mass_factor_beta, isign, 0);
}

Depending on the mapping {0, 1} → {even, odd} (Peter says 0 = odd), this would then be an odd-odd operator.

However, in clover.h, it is the other way around:

void operator()(FourSpinorBlock *res, const FourSpinorBlock *in, int isign) {
    double beta = (double)0.25;

    D->dslash(tmp, in, u[0], invclov, isign, 0);
    D->dslashAChiMinusBDPsi(res, tmp, in, u[1], clov, beta, isign, 1);
}

From my understanding, this makes it an even-even operator. The solver does not care which operator was passed in. So one of the versions uses the gauge field on the wrong checkerboard‽

bjoo commented 7 years ago

Hi Martin, This is a good catch: I note that in the testDslashFull.cc I also test for this: dslash(chi2,u_test,psi, isign, 1); dslash(ltmp,u_test,chi2, isign, 0); chi2[rb[0]] = massFactorpsi - betaFactorltmp;

However, the chroma convention is for this to be on cb[1] which is why I guess I test it that way in the clover tests in testClovDslashFull.cc

  M( chi_s[1],
     psi_s[1],
     isign);

  qdp_unpack_spinor<> (chi_s[0], chi_s[1], chi, geom);

  // Apply QDP Dslash
  chi2 = zero;

  dslash(chi2,u_test,psi, isign, 0);
  invclov_qdp_ap.apply(clov_chi2, chi2, isign, 0);
  dslash(ltmp,u_test,clov_chi2, isign, 1);

  clov_qdp_ap.apply(chi2, psi, isign, 1);

  chi2[rb[1]] -= betaFactor*ltmp;

In Chroma I use Clover exclusively, and so probably the Dslash wrapper won’t work (If I even have one, I may have just integrated the Clover) — the chroma convention is that the Schur preconditioned operator lives on rb[1] (odd).

I should add to the to-do to make the Wilson the same as the Clover.

Best, B

On Apr 21, 2017, at 10:51 AM, Martin Ueding notifications@github.com wrote:

While browsing the code, I noticed some strangeness around the checkerboarding.

In wilson.h, there is the following operator:

void operator()(FourSpinorBlock res, const FourSpinorBlock in, int isign) { D-> dslash(tmp, in, u[1], isign, 1 ); D-> dslashAChiMinusBDPsi(res, tmp, in, u[0 ], mass_factor_alpha, mass_factor_beta, isign, 0 ); }

Depending on the mapping {0, 1} → {even, odd} (Peter says 0 = odd), this would then be an odd-odd operator.

However, in clover.h, it is the other way around:

void operator()(FourSpinorBlock res, const FourSpinorBlock in, int isign) {

double beta = (double)0.25 ;

D->

dslash(tmp, in, u[0], invclov, isign, 0 ); D-> dslashAChiMinusBDPsi(res, tmp, in, u[1], clov, beta, isign, 1 ); }

From my understanding, this makes it an even-even operator. The solver does not care which operator was passed in. So one of the versions uses the gauge field on the wrong checkerboard‽

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.


Dr Balint Joo High Performance Computational Scientist Jefferson Lab 12000 Jefferson Ave, Suite 3, MS 12B2, Room F217, Newport News, VA 23606, USA Tel: +1-757-269-5339, Fax: +1-757-269-5427 email: bjoo@jlab.org

bjoo commented 7 years ago

fixed in 9031fbe by adding cb-index to the EvenOdd Operators and solvers