Closed kostrzewa closed 3 years ago
The reason for this modification can be derived from the functions called in the operator:
257 void DiracTwistedCloverPC::M(ColorSpinorField &out, const ColorSpinorField &in) const
258 {
259 double kappa2 = -kappa*kappa;
260 bool reset = newTmp(&tmp1, in);
261
262 bool symmetric =(matpcType == QUDA_MATPC_EVEN_EVEN || matpcType == QUDA_MATPC_ODD_ODD) ? true : false;
263 int odd_bit = (matpcType == QUDA_MATPC_ODD_ODD || matpcType == QUDA_MATPC_ODD_ODD_ASYMMETRIC) ? 1 : 0;
264 QudaParity parity[2] = {static_cast<QudaParity>((1 + odd_bit) % 2), static_cast<QudaParity>((0 + odd_bit) % 2)};
265
266 if (!symmetric) { // asymmetric preconditioning
// works already, both dagger an non-dagger, but only even-even
267 Dslash(*tmp1, in, parity[0]);
268 DiracTwistedClover::DslashXpay(out, *tmp1, parity[1], in, kappa2);
269 } else if (!dagger) { // symmetric preconditioning
// fails for both even-even and odd-odd
270 Dslash(*tmp1, in, parity[0]);
271 DslashXpay(out, *tmp1, parity[1], in, kappa2);
272 } else { // symmetric preconditioning, dagger
// works for both even-even and odd-odd
273 TwistCloverInv(out, in, parity[1]);
274 reverse = true;
275 Dslash(*tmp1, out, parity[0]);
276 reverse = false;
277 DiracWilson::DslashXpay(out, *tmp1, parity[1], in, kappa2);
278 }
279
280 deleteTmp(&tmp1, reset);
281 }
75% of the tests for PC::M
and PC::MdagM
pass now, only "odd-odd-asym" missing.
100% of tests for PC::M
and PC::MdagM
now pass after I've fixed a bug the odd-odd-asym
tmc_ndeg_matpc
test.
What remains are PC::prepare
and PC::reconstruct
for the non-degenerate operator.
… the complexities related to the triviality of the inverse of the diagonal term of the twisted mass operator, which is not relevant for the twisted-clover operator
This gets us closer to the operator working as intended. I don't think that the type traits that prevented instantiation for particular combinations of the non-deg twisted mass operator are necessary here as the inverse of the diagonal is not trivial and cannot simply be applied via the the "TM" version of the Wilson operator.