QUDA  v1.1.0
A library for QCD on GPUs
dirac_quda.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <quda_internal.h>
4 #include <color_spinor_field.h>
5 #include <gauge_field.h>
6 #include <clover_field.h>
7 #include <dslash_quda.h>
8 #include <blas_quda.h>
9 
10 #include <typeinfo>
11 
12 namespace quda {
13 
14  // Forward declare: MG Transfer Class
15  class Transfer;
16 
17  // Forward declare: Dirac Op Base Class
18  class Dirac;
19 
20  // Params for Dirac operator
21  class DiracParam {
22 
23  public:
25  double kappa;
26  double mass;
27  double m5; // used by domain wall only
28  int Ls; // used by domain wall and twisted mass
29  Complex b_5[QUDA_MAX_DWF_LS]; // used by mobius domain wall only
30  Complex c_5[QUDA_MAX_DWF_LS]; // used by mobius domain wall only
31 
32  // The EOFA parameters. See the description in InvertParam
33  double eofa_shift;
34  int eofa_pm;
35  double mq1;
36  double mq2;
37  double mq3;
38 
42  cudaGaugeField *fatGauge; // used by staggered only
43  cudaGaugeField *longGauge; // used by staggered only
44  int laplace3D;
46  cudaGaugeField *xInvKD; // used for the Kahler-Dirac operator only
47 
48  double mu; // used by twisted mass only
49  double mu_factor; // used by multigrid only
50  double epsilon; //2nd tm parameter (used by twisted mass only)
51 
53  ColorSpinorField *tmp2; // used by Wilson-like kernels only
54 
55  int commDim[QUDA_MAX_DIM]; // whether to do comms or not
56 
57  QudaPrecision halo_precision; // only does something for DiracCoarse at present
58 
59  // for multigrid only
62  bool need_bidirectional; // whether or not we need to force a bi-directional build
63  bool use_mma; // whether to use tensor cores where applicable
64 
65  // Default constructor
68  kappa(0.0),
69  m5(0.0),
72  gauge(0),
73  clover(0),
74  mu(0.0),
75  mu_factor(0.0),
76  epsilon(0.0),
77  tmp1(0),
78  tmp2(0),
80  need_bidirectional(false),
81 #if (CUDA_VERSION >= 10010 && __COMPUTE_CAPABILITY__ >= 700)
82  use_mma(true)
83 #else
84  use_mma(false)
85 #endif
86  {
87  for (int i=0; i<QUDA_MAX_DIM; i++) commDim[i] = 1;
88  }
89 
90  // Pretty print the args struct
91  void print() {
92  printfQuda("Printing DslashParam\n");
93  printfQuda("type = %d\n", type);
94  printfQuda("kappa = %g\n", kappa);
95  printfQuda("mass = %g\n", mass);
96  printfQuda("laplace3D = %d\n", laplace3D);
97  printfQuda("m5 = %g\n", m5);
98  printfQuda("Ls = %d\n", Ls);
99  printfQuda("matpcType = %d\n", matpcType);
100  printfQuda("dagger = %d\n", dagger);
101  printfQuda("mu = %g\n", mu);
102  printfQuda("epsilon = %g\n", epsilon);
103  printfQuda("halo_precision = %d\n", halo_precision);
104  for (int i=0; i<QUDA_MAX_DIM; i++) printfQuda("commDim[%d] = %d\n", i, commDim[i]);
105  for (int i = 0; i < Ls; i++)
106  printfQuda(
107  "b_5[%d] = %e %e \t c_5[%d] = %e %e\n", i, b_5[i].real(), b_5[i].imag(), i, c_5[i].real(), c_5[i].imag());
108  printfQuda("use_mma = %d\n", use_mma);
109  }
110  };
111 
112  // This is a free function:
113  // Dirac params structure
114  // inv_param structure
115  // pc -> preconditioned.
116  void setDiracParam(DiracParam &diracParam, QudaInvertParam *inv_param, bool pc);
117 
118  // This is a free function.
119  void setDiracSloppyParam(DiracParam &diracParam, QudaInvertParam *inv_param, bool pc);
120 
121  // forward declarations
122  class DiracMatrix; // What are the differences in these classes?
123  class DiracM;
124  class DiracMdagM;
125  class DiracMdagMLocal;
126  class DiracMMdag;
127  class DiracMdag;
128  class DiracG5M;
129  //Forward declaration of multigrid Transfer class
130  class Transfer;
131 
132  // Abstract base class
133  class Dirac : public Object {
134 
135  friend class DiracMatrix;
136  friend class DiracM;
137  friend class DiracMdagM;
138  friend class DiracMdagMLocal;
139  friend class DiracMMdag;
140  friend class DiracMdag;
141  friend class DiracG5M;
142 
143  protected:
145  double kappa;
146  double mass;
149  mutable QudaDagType dagger; // mutable to simplify implementation of Mdag
150  mutable unsigned long long flops;
151  mutable ColorSpinorField *tmp1; // temporary hack
152  mutable ColorSpinorField *tmp2; // temporary hack
154  mutable QudaPrecision halo_precision; // only does something for DiracCoarse at present
155 
156  bool newTmp(ColorSpinorField **, const ColorSpinorField &) const;
157  void deleteTmp(ColorSpinorField **, const bool &reset) const;
158 
159  mutable int commDim[QUDA_MAX_DIM]; // whether do comms or not
160 
162 
163  public:
164  Dirac(const DiracParam &param); // construct from params
165  Dirac(const Dirac &dirac); // Copy construct
166  virtual ~Dirac(); // virtual destructor as this is a base classe
167  Dirac &operator=(const Dirac &dirac); // assignment
168 
174  void setCommDim(const int commDim_[QUDA_MAX_DIM]) const {
175  for (int i=0; i<QUDA_MAX_DIM; i++) { commDim[i] = commDim_[i]; }
176  }
177 
181  virtual bool isCoarse() const { return false; }
182 
186  virtual void checkParitySpinor(const ColorSpinorField &, const ColorSpinorField &) const;
187 
191  virtual void checkFullSpinor(const ColorSpinorField &, const ColorSpinorField &) const;
192 
196  void checkSpinorAlias(const ColorSpinorField &, const ColorSpinorField &) const;
197 
201  virtual bool hasDslash() const { return true; }
202 
206  virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in,
207  const QudaParity parity) const = 0;
208 
212  virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in,
213  const QudaParity parity, const ColorSpinorField &x,
214  const double &k) const = 0;
215 
219  virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const = 0;
220 
224  virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const = 0;
225 
232  virtual void MdagMLocal(ColorSpinorField &out, const ColorSpinorField &in) const
233  {
234  errorQuda("Not implemented!\n");
235  }
236 
243  virtual void Dslash4(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
244  {
245  errorQuda("Not implemented!\n");
246  }
247 
251  void Mdag(ColorSpinorField &out, const ColorSpinorField &in) const;
252 
256  void MMdag(ColorSpinorField &out, const ColorSpinorField &in) const;
257 
258  // required methods to use e-o preconditioning for solving full system
260  const QudaSolutionType solType) const = 0;
261  virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType solType) const = 0;
262 
263  // special prepare/recon methods that go into PreconditionedSolve in MG
265  ColorSpinorField &b, const QudaSolutionType solType) const
266  {
267  prepare(src, sol, x, b, solType);
268  }
269  virtual void reconstructSpecialMG(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType solType) const
270  {
271  reconstruct(x, b, solType);
272  }
273 
280  virtual bool hasSpecialMG() const { return false; }
281 
282  void setMass(double mass){ this->mass = mass;}
283 
284  // Dirac operator factory
288  static Dirac* create(const DiracParam &param);
289 
293  double Kappa() const { return kappa; }
294 
298  virtual double Mass() const { return mass; } // in case of factor of 2 convention for staggered
299 
303  virtual double Mu() const { return 0.; }
304 
308  virtual double MuFactor() const { return 0.; }
309 
313  unsigned long long Flops() const
314  {
315  unsigned long long rtn = flops;
316  flops = 0;
317  return rtn;
318  }
319 
324 
328  int getStencilSteps() const;
329 
333  void Dagger(QudaDagType dag) const { dagger = dag; }
334 
339 
343  virtual bool hermitian() const { return false; }
344 
349  virtual QudaDiracType getDiracType() const = 0;
350 
360  virtual void updateFields(cudaGaugeField *gauge_in, cudaGaugeField *fat_gauge_in, cudaGaugeField *long_gauge_in,
361  cudaCloverField *clover_in)
362  {
363  gauge = gauge_in;
364  }
365 
377  virtual void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T,
378  double kappa, double mass=0., double mu=0., double mu_factor=0.) const
379  {errorQuda("Not implemented");}
380 
382  void setHaloPrecision(QudaPrecision halo_precision_) const { halo_precision = halo_precision_; }
383 
391  virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream = 0) const;
392  };
393 
394  // Full Wilson
395  class DiracWilson : public Dirac {
396 
397  protected:
399 
400  public:
401  DiracWilson(const DiracParam &param);
402  DiracWilson(const DiracWilson &dirac);
403  DiracWilson(const DiracParam &param, const int nDims);//to correctly adjust face for DW and non-deg twisted mass
404 
405  virtual ~DiracWilson();
407 
408  virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in,
409  const QudaParity parity) const;
410  virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in,
411  const QudaParity parity, const ColorSpinorField &x, const double &k) const;
412  virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const;
413  virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
414 
415  virtual void prepare(ColorSpinorField* &src, ColorSpinorField* &sol,
417  const QudaSolutionType) const;
418  virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b,
419  const QudaSolutionType) const;
420 
421  virtual QudaDiracType getDiracType() const { return QUDA_WILSON_DIRAC; }
422 
439  virtual void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T,
440  double kappa, double mass=0.,double mu=0., double mu_factor=0.) const;
441  };
442 
443  // Even-odd preconditioned Wilson
444  class DiracWilsonPC : public DiracWilson {
445 
446  private:
447 
448  public:
451  virtual ~DiracWilsonPC();
453 
454  void M(ColorSpinorField &out, const ColorSpinorField &in) const;
455  void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
456 
457  void prepare(ColorSpinorField* &src, ColorSpinorField* &sol,
459  const QudaSolutionType) const;
461  const QudaSolutionType) const;
462 
463  virtual QudaDiracType getDiracType() const { return QUDA_WILSONPC_DIRAC; }
464  };
465 
466  // Full clover
467  class DiracClover : public DiracWilson {
468 
469  protected:
471  void checkParitySpinor(const ColorSpinorField &, const ColorSpinorField &) const;
473 
474  public:
475  DiracClover(const DiracParam &param);
476  DiracClover(const DiracClover &dirac);
477  virtual ~DiracClover();
479 
480  // APply clover
481  void Clover(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const;
482 
483  virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity,
484  const ColorSpinorField &x, const double &k) const;
485 
486  virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const;
487  virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
488 
489  virtual void prepare(ColorSpinorField* &src, ColorSpinorField* &sol,
491  const QudaSolutionType) const;
492  virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b,
493  const QudaSolutionType) const;
494 
495  virtual QudaDiracType getDiracType() const { return QUDA_CLOVER_DIRAC; }
496 
506  virtual void updateFields(cudaGaugeField *gauge_in, cudaGaugeField *fat_gauge_in, cudaGaugeField *long_gauge_in,
507  cudaCloverField *clover_in)
508  {
509  DiracWilson::updateFields(gauge_in, nullptr, nullptr, nullptr);
510  clover = clover_in;
511  }
512 
529  void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T,
530  double kappa, double mass=0., double mu=0., double mu_factor=0.) const;
531 
539  virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream = 0) const;
540  };
541 
542  // Even-odd preconditioned clover
543  class DiracCloverPC : public DiracClover {
544 
545  public:
548  virtual ~DiracCloverPC();
550 
551  // Clover is inherited from parent
552 
553  // Clover Inv is new
554  void CloverInv(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const;
555 
556  // Dslash is redefined as A_pp^{-1} D_p\bar{p}
557  void Dslash(ColorSpinorField &out, const ColorSpinorField &in,
558  const QudaParity parity) const;
559 
560  // out = x + k A_pp^{-1} D_p\bar{p}
561  void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in,
562  const QudaParity parity, const ColorSpinorField &x, const double &k) const;
563 
564  // Can implement: M as e.g. : i) tmp_e = A^{-1}_ee D_eo in_o (Dslash)
565  // ii) out_o = in_o + A_oo^{-1} D_oe tmp_e (AXPY)
566  void M(ColorSpinorField &out, const ColorSpinorField &in) const;
567 
568  // squared op
569  void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
570 
571  void prepare(ColorSpinorField* &src, ColorSpinorField* &sol,
573  const QudaSolutionType) const;
575  const QudaSolutionType) const;
576 
577  virtual QudaDiracType getDiracType() const { return QUDA_CLOVERPC_DIRAC; }
578 
591  void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T,
592  double kappa, double mass=0., double mu=0., double mu_factor=0.) const;
593 
603  virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream = 0) const;
604  };
605 
606  // Full clover with Hasenbusch Twist
607  //
608  // [ A_ee -k D_eo ]
609  // [ -k D_oe A_oo + i mu g_5 A_oo^2 ]
610  //
611  // A_oo + i mu g_5 A_oo^2 = A_oo( 1 + i mu g_5 A_oo)
612 
614  {
615 
616  // Inherit these so I will comment them out
617  /*
618  protected:
619  cudaCloverField *clover;
620  void checkParitySpinor(const ColorSpinorField &, const ColorSpinorField &) const;
621  void initConstants();
622  */
623  protected:
624  double mu;
625 
626  public:
629  virtual ~DiracCloverHasenbuschTwist();
631 
632  virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const;
633  virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
634 
636 
646  void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass = 0., double mu = 0.,
647  double mu_factor = 0.) const;
648  };
649 
650  // Even-odd preconditioned clover
652  {
653  protected:
654  double mu;
655 
656  public:
661 
662  // Clover is inherited from parent
663 
664  // Clover Inv is inherited from parent
665 
666  // Dslash is defined as A_pp^{-1} D_p\bar{p} and is inherited
667 
668  // DslashXPay is inherited (for reconstructs and such)
669 
670  // out = (1 +/- ig5 mu A)x + k A^{-1} D in
672  const ColorSpinorField &x, const double &k, const double &b) const;
673 
674  // out = ( 1+/- i g5 mu A) x - D in
676  const ColorSpinorField &x, const double &k, const double &b) const;
677 
678  // Can implement: M as e.g. : i) tmp_e = A^{-1}_ee D_eo in_o (Dslash)
679  // ii) out_o = in_o + A_oo^{-1} D_oe tmp_e (AXPY)
680  void M(ColorSpinorField &out, const ColorSpinorField &in) const;
681 
682  // squared op
683  void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
684 
686 
699  void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass = 0., double mu = 0.,
700  double mu_factor = 0.) const;
701  };
702 
703  // Full domain wall
704  class DiracDomainWall : public DiracWilson {
705 
706  protected:
707  double m5;
708  double kappa5;
709  int Ls; // length of the fifth dimension
710  void checkDWF(const ColorSpinorField &out, const ColorSpinorField &in) const;
711 
712 public:
715  virtual ~DiracDomainWall();
717 
718  void Dslash(ColorSpinorField &out, const ColorSpinorField &in,
719  const QudaParity parity) const;
720  void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in,
721  const QudaParity parity, const ColorSpinorField &x, const double &k) const;
722 
723  virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const;
724  virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
725 
726  virtual void prepare(ColorSpinorField* &src, ColorSpinorField* &sol,
728  const QudaSolutionType) const;
729  virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b,
730  const QudaSolutionType) const;
731 
733  };
734 
735  // 5d Even-odd preconditioned domain wall
737 
738  private:
739 
740  public:
743  virtual ~DiracDomainWallPC();
745 
746  void M(ColorSpinorField &out, const ColorSpinorField &in) const;
747  void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
748 
749  void prepare(ColorSpinorField* &src, ColorSpinorField* &sol,
751  const QudaSolutionType) const;
753  const QudaSolutionType) const;
754 
756  };
757 
758  // Full domain wall, but with 4-d parity ordered fields
760  {
761 
762 private:
763 public:
766  virtual ~DiracDomainWall4D();
768 
769  void Dslash4(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const;
770  void Dslash5(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const;
771  void Dslash4Xpay(ColorSpinorField &out, const ColorSpinorField &in,
772  const QudaParity parity, const ColorSpinorField &x, const double &k) const;
773  void Dslash5Xpay(ColorSpinorField &out, const ColorSpinorField &in,
774  const QudaParity parity, const ColorSpinorField &x, const double &k) const;
775 
776  void M(ColorSpinorField &out, const ColorSpinorField &in) const;
777  void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
778 
780  const QudaSolutionType) const;
781  void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const;
782 
784  };
785 
786  // 4d Even-odd preconditioned domain wall
788  {
789 
790 private:
791 public:
794  virtual ~DiracDomainWall4DPC();
796 
797  void Dslash5inv(
798  ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const double &kappa5) const;
799  void Dslash5invXpay(ColorSpinorField &out, const ColorSpinorField &in,
800  const QudaParity parity, const double &kappa5, const ColorSpinorField &x, const double &k) const;
801 
802  void M(ColorSpinorField &out, const ColorSpinorField &in) const;
803  void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
804 
805  void prepare(ColorSpinorField* &src, ColorSpinorField* &sol,
807  const QudaSolutionType) const;
809  const QudaSolutionType) const;
810 
812  };
813 
814  // Full Mobius
815  class DiracMobius : public DiracDomainWall {
816 
817  protected:
818  //Mobius coefficients
821 
827  bool zMobius;
828 
831  double mobius_kappa;
832 
833  public:
834  DiracMobius(const DiracParam &param);
835  // DiracMobius(const DiracMobius &dirac);
836  // virtual ~DiracMobius();
837  // DiracMobius& operator=(const DiracMobius &dirac);
838 
839  void Dslash4(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const;
840  void Dslash4pre(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const;
841  void Dslash5(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const;
842 
843  void Dslash4Xpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity,
844  const ColorSpinorField &x, const double &k) const;
846  const ColorSpinorField &x, const double &k) const;
847  void Dslash5Xpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity,
848  const ColorSpinorField &x, const double &k) const;
849 
850  virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const;
851  virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
852 
854  const QudaSolutionType) const;
855  virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const;
856 
858  };
859 
860  // 4d even-odd preconditioned Mobius domain wall
861  class DiracMobiusPC : public DiracMobius {
862 
863  protected:
865 
866  private:
867  public:
870  virtual ~DiracMobiusPC();
872 
873  void Dslash5inv(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const;
874  void Dslash5invXpay(ColorSpinorField &out, const ColorSpinorField &in,
875  const QudaParity parity, const ColorSpinorField &x, const double &k) const;
876 
877  void MdagMLocal(ColorSpinorField &out, const ColorSpinorField &in) const;
878 
879  void M(ColorSpinorField &out, const ColorSpinorField &in) const;
880  void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
882  ColorSpinorField &b, const QudaSolutionType) const;
883  void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const;
884 
886  };
887 
888  // Full Mobius EOFA
890  {
891 
892  protected:
893  // The EOFA parameters
894  double m5inv_fac = 0.;
895  double sherman_morrison_fac = 0.;
896  double eofa_shift;
897  int eofa_pm;
898  double mq1;
899  double mq2;
900  double mq3;
904 
905  public:
907 
908  void m5_eofa(ColorSpinorField &out, const ColorSpinorField &in) const;
909  void m5_eofa_xpay(ColorSpinorField &out, const ColorSpinorField &in, const ColorSpinorField &x, double a = -1.) const;
910 
911  virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const;
912  virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
913 
915  const QudaSolutionType) const;
916  virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const;
917 
919  };
920 
921  // 4d Even-odd preconditioned Mobius domain wall with EOFA
923  {
924 
925  public:
927 
928  void m5inv_eofa(ColorSpinorField &out, const ColorSpinorField &in) const;
929  void m5inv_eofa_xpay(ColorSpinorField &out, const ColorSpinorField &in, const ColorSpinorField &x,
930  double a = -1.) const;
931 
932  void M(ColorSpinorField &out, const ColorSpinorField &in) const;
933  void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
934 
935  void full_dslash(ColorSpinorField &out,
936  const ColorSpinorField &in) const; // ye = Mee * xe + Meo * xo, yo = Moo * xo + Moe * xe
937 
939  const QudaSolutionType) const;
940  void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const;
941 
943  };
944 
945  // Full twisted mass
946  class DiracTwistedMass : public DiracWilson {
947 
948  protected:
949  mutable double mu;
950  mutable double epsilon;
951  void twistedApply(ColorSpinorField &out, const ColorSpinorField &in, const QudaTwistGamma5Type twistType) const;
952  virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, QudaParity parity) const;
953  virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, QudaParity parity,
954  const ColorSpinorField &x, const double &k) const;
955 
956  public:
958  DiracTwistedMass(const DiracParam &param, const int nDim);
959  virtual ~DiracTwistedMass();
961 
962  void Twist(ColorSpinorField &out, const ColorSpinorField &in) const;
963 
964  virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const;
965  virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
966 
967  virtual void prepare(ColorSpinorField* &src, ColorSpinorField* &sol,
969  const QudaSolutionType) const;
970  virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b,
971  const QudaSolutionType) const;
972 
974 
975  double Mu() const { return mu; }
976 
996  void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T,
997  double kappa, double mass, double mu, double mu_factor=0.) const;
998  };
999 
1000  // Even-odd preconditioned twisted mass
1002 
1003  public:
1005  DiracTwistedMassPC(const DiracParam &param, const int nDim);
1006 
1007  virtual ~DiracTwistedMassPC();
1009 
1010  void TwistInv(ColorSpinorField &out, const ColorSpinorField &in) const;
1011 
1012  virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in,
1013  const QudaParity parity) const;
1014  virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in,
1015  const QudaParity parity, const ColorSpinorField &x, const double &k) const;
1016  void M(ColorSpinorField &out, const ColorSpinorField &in) const;
1017  void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
1018 
1019  void prepare(ColorSpinorField* &src, ColorSpinorField* &sol,
1021  const QudaSolutionType) const;
1022  void reconstruct(ColorSpinorField &x, const ColorSpinorField &b,
1023  const QudaSolutionType) const;
1024 
1026 
1039  void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T,
1040  double kappa, double mass, double mu, double mu_factor=0.) const;
1041  };
1042 
1043  // Full twisted mass with a clover term
1045 
1046  protected:
1047  double mu;
1048  double epsilon;
1050  void checkParitySpinor(const ColorSpinorField &, const ColorSpinorField &) const;
1052  const QudaTwistGamma5Type twistType, const int parity) const;
1053 
1054  public:
1056  DiracTwistedClover(const DiracParam &param, const int nDim);
1057  virtual ~DiracTwistedClover();
1059 
1060  void TwistClover(ColorSpinorField &out, const ColorSpinorField &in, const int parity) const;
1061 
1062  virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const;
1063  virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity,
1064  const ColorSpinorField &x, const double &k) const;
1065 
1066  virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const;
1067  virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
1068 
1069  virtual void prepare(ColorSpinorField* &src, ColorSpinorField* &sol,
1071  const QudaSolutionType) const;
1072  virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b,
1073  const QudaSolutionType) const;
1074 
1076 
1077  double Mu() const { return mu; }
1078 
1088  virtual void updateFields(cudaGaugeField *gauge_in, cudaGaugeField *fat_gauge_in, cudaGaugeField *long_gauge_in,
1089  cudaCloverField *clover_in)
1090  {
1091  DiracWilson::updateFields(gauge_in, nullptr, nullptr, nullptr);
1092  clover = clover_in;
1093  }
1094 
1114  void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T,
1115  double kappa, double mass, double mu, double mu_factor=0.) const;
1116 
1124  virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream = 0) const;
1125  };
1126 
1127  // Even-odd preconditioned twisted mass with a clover term
1129 
1130  mutable bool reverse;
1132 public:
1134  DiracTwistedCloverPC(const DiracParam &param, const int nDim);
1135 
1136  virtual ~DiracTwistedCloverPC();
1138 
1139  void TwistCloverInv(ColorSpinorField &out, const ColorSpinorField &in, const int parity) const;
1140 
1141  virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const;
1142  virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity,
1143  const ColorSpinorField &x, const double &k) const;
1144  void M(ColorSpinorField &out, const ColorSpinorField &in) const;
1145  void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
1146 
1147  void prepare(ColorSpinorField* &src, ColorSpinorField* &sol,
1149  const QudaSolutionType) const;
1150  void reconstruct(ColorSpinorField &x, const ColorSpinorField &b,
1151  const QudaSolutionType) const;
1152 
1154 
1169  void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T,
1170  double kappa, double mass, double mu, double mu_factor=0.) const;
1171 
1181  virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream = 0) const;
1182  };
1183 
1184  // Full staggered
1185  class DiracStaggered : public Dirac {
1186 
1187  protected:
1188 
1189  public:
1192  virtual ~DiracStaggered();
1194 
1195  virtual void checkParitySpinor(const ColorSpinorField &, const ColorSpinorField &) const;
1196 
1197  virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in,
1198  const QudaParity parity) const;
1199  virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in,
1200  const QudaParity parity, const ColorSpinorField &x, const double &k) const;
1201  virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const;
1202  virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
1203 
1204  virtual void prepare(ColorSpinorField* &src, ColorSpinorField* &sol,
1206  const QudaSolutionType) const;
1207  virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b,
1208  const QudaSolutionType) const;
1209 
1211 
1217  virtual const cudaGaugeField *getGaugeField() const { return gauge; }
1218 
1239  void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T,
1240  double kappa, double mass, double mu=0., double mu_factor=0.) const;
1241  };
1242 
1243  // Even-odd preconditioned staggered
1245 
1246  protected:
1247 
1248  public:
1251  virtual ~DiracStaggeredPC();
1253 
1254  virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const;
1255  virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
1256 
1257  virtual void prepare(ColorSpinorField* &src, ColorSpinorField* &sol,
1259  const QudaSolutionType) const;
1260  virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b,
1261  const QudaSolutionType) const;
1262 
1264 
1265  virtual bool hermitian() const { return true; }
1266  };
1267 
1268  // Kahler-Dirac preconditioned staggered
1270  {
1271 
1272  protected:
1275  public:
1278 
1279  virtual ~DiracStaggeredKD();
1281 
1282  virtual void checkParitySpinor(const ColorSpinorField &, const ColorSpinorField &) const;
1283 
1284  virtual bool hasDslash() const { return false; }
1285 
1286  virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const;
1287  virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity,
1288  const ColorSpinorField &x, const double &k) const;
1289  virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const;
1290  virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
1291 
1292  void KahlerDiracInv(ColorSpinorField &out, const ColorSpinorField &in) const;
1293 
1295  const QudaSolutionType) const;
1296  virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const;
1297 
1299  ColorSpinorField &b, const QudaSolutionType solType) const;
1300  virtual void reconstructSpecialMG(ColorSpinorField &x, const ColorSpinorField &b,
1301  const QudaSolutionType solType) const;
1302 
1303  virtual bool hasSpecialMG() const { return true; }
1304 
1306 
1316  virtual void updateFields(cudaGaugeField *gauge_in, cudaGaugeField *fat_gauge_in, cudaGaugeField *long_gauge_in,
1317  cudaCloverField *clover_in);
1318 
1337  void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass, double mu = 0.,
1338  double mu_factor = 0.) const;
1339 
1349  virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream = 0) const;
1350  };
1351 
1352  // Full staggered
1354 
1355  protected:
1358 
1359  public:
1362  virtual ~DiracImprovedStaggered();
1364 
1365  virtual void checkParitySpinor(const ColorSpinorField &, const ColorSpinorField &) const;
1366 
1367  virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in,
1368  const QudaParity parity) const;
1369  virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in,
1370  const QudaParity parity, const ColorSpinorField &x, const double &k) const;
1371  virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const;
1372  virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
1373 
1374  virtual void prepare(ColorSpinorField* &src, ColorSpinorField* &sol,
1376  const QudaSolutionType) const;
1377  virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b,
1378  const QudaSolutionType) const;
1379 
1380  virtual QudaDiracType getDiracType() const { return QUDA_ASQTAD_DIRAC; }
1381 
1387  virtual const cudaGaugeField *getFatLinkField() const { return fatGauge; }
1388 
1394  virtual const cudaGaugeField *getLongLinkField() const { return longGauge; }
1395 
1405  virtual void updateFields(cudaGaugeField *gauge_in, cudaGaugeField *fat_gauge_in, cudaGaugeField *long_gauge_in,
1406  cudaCloverField *clover_in)
1407  {
1408  Dirac::updateFields(fat_gauge_in, nullptr, nullptr, nullptr);
1409  fatGauge = fat_gauge_in;
1410  longGauge = long_gauge_in;
1411  }
1412 
1434  void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass, double mu = 0.,
1435  double mu_factor = 0.) const;
1436 
1444  virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream = 0) const;
1445  };
1446 
1447  // Even-odd preconditioned staggered
1449 
1450  protected:
1451 
1452  public:
1455  virtual ~DiracImprovedStaggeredPC();
1457 
1458  virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const;
1459  virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
1460 
1461  virtual void prepare(ColorSpinorField* &src, ColorSpinorField* &sol,
1463  const QudaSolutionType) const;
1464  virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b,
1465  const QudaSolutionType) const;
1466 
1467  virtual QudaDiracType getDiracType() const { return QUDA_ASQTADPC_DIRAC; }
1468 
1469  virtual bool hermitian() const { return true; }
1470  };
1471 
1472  // Kahler-Dirac preconditioned staggered
1474  {
1475 
1476  protected:
1479  public:
1482  virtual ~DiracImprovedStaggeredKD();
1484 
1485  virtual void checkParitySpinor(const ColorSpinorField &, const ColorSpinorField &) const;
1486 
1487  virtual bool hasDslash() const { return false; }
1488 
1489  virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const;
1490  virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity,
1491  const ColorSpinorField &x, const double &k) const;
1492  virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const;
1493  virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
1494 
1495  void KahlerDiracInv(ColorSpinorField &out, const ColorSpinorField &in) const;
1496 
1498  const QudaSolutionType) const;
1499  virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const;
1500 
1502  ColorSpinorField &b, const QudaSolutionType solType) const;
1503  virtual void reconstructSpecialMG(ColorSpinorField &x, const ColorSpinorField &b,
1504  const QudaSolutionType solType) const;
1505 
1506  virtual bool hasSpecialMG() const { return true; }
1507 
1508  virtual QudaDiracType getDiracType() const { return QUDA_ASQTADKD_DIRAC; }
1509 
1519  virtual void updateFields(cudaGaugeField *gauge_in, cudaGaugeField *fat_gauge_in, cudaGaugeField *long_gauge_in,
1520  cudaCloverField *clover_in);
1521 
1540  void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass, double mu = 0.,
1541  double mu_factor = 0.) const;
1542 
1552  virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream = 0) const;
1553  };
1554 
1559  class DiracCoarse : public Dirac {
1560 
1561  protected:
1562  double mass;
1563  double mu;
1564  double mu_factor;
1566  const Dirac *dirac;
1567  const bool need_bidirectional;
1568  const bool use_mma;
1570  mutable cpuGaugeField *Y_h;
1571  mutable cpuGaugeField *X_h;
1575  mutable cudaGaugeField *Y_d;
1576  mutable cudaGaugeField *X_d;
1584  void initializeCoarse();
1585 
1591  void initializeLazy(QudaFieldLocation location) const;
1592 
1593  mutable bool enable_gpu;
1594  mutable bool enable_cpu;
1595  const bool gpu_setup;
1596  mutable bool init_gpu;
1597  mutable bool init_cpu;
1598  const bool mapped;
1605  void createY(bool gpu = true, bool mapped = false) const;
1606 
1611  void createYhat(bool gpu = true) const;
1612 
1613  public:
1614  double Mass() const { return mass; }
1615  double Mu() const { return mu; }
1616  double MuFactor() const { return mu_factor; }
1617 
1623  DiracCoarse(const DiracParam &param, bool gpu_setup=true, bool mapped=false);
1624 
1636  DiracCoarse(const DiracParam &param,
1639 
1644  DiracCoarse(const DiracCoarse &dirac, const DiracParam &param);
1645  virtual ~DiracCoarse();
1646 
1647  virtual bool isCoarse() const { return true; }
1648 
1655  void Clover(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const;
1656 
1663  void CloverInv(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const;
1664 
1671  virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in,
1672  const QudaParity parity) const;
1673 
1680  virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity,
1681  const ColorSpinorField &x, const double &k) const;
1682 
1688  virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const;
1689 
1690  virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
1691 
1693  const QudaSolutionType) const;
1694 
1695  virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const;
1696 
1697  virtual QudaDiracType getDiracType() const { return QUDA_COARSE_DIRAC; }
1698 
1699  virtual void updateFields(cudaGaugeField *gauge_in, cudaGaugeField *fat_gauge_in, cudaGaugeField *long_gauge_in,
1700  cudaCloverField *clover_in)
1701  {
1702  Dirac::updateFields(gauge_in, nullptr, nullptr, nullptr);
1703  warningQuda("Coarse gauge links cannot be trivially updated for DiracCoarse(PC). Perform an MG update instead.");
1704  }
1705 
1717  void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T,
1718  double kappa, double mass, double mu, double mu_factor=0.) const;
1719 
1720 
1729  void createPreconditionedCoarseOp(GaugeField &Yhat, GaugeField &Xinv, const GaugeField &Y, const GaugeField &X);
1730 
1738  virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream = 0) const;
1739  };
1740 
1744  class DiracCoarsePC : public DiracCoarse {
1745 
1746  public:
1751  DiracCoarsePC(const DiracParam &param, bool gpu_setup=true);
1752 
1758 
1759  virtual ~DiracCoarsePC();
1760 
1761  void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const;
1762  void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity,
1763  const ColorSpinorField &x, const double &k) const;
1764  void M(ColorSpinorField &out, const ColorSpinorField &in) const;
1765  void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
1767  const QudaSolutionType) const;
1768  void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const;
1769 
1770  virtual QudaDiracType getDiracType() const { return QUDA_COARSEPC_DIRAC; }
1771 
1786  void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T,
1787  double kappa, double mass, double mu, double mu_factor=0.) const;
1788 
1796  virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream = 0) const;
1797  };
1798 
1799 
1805  class GaugeLaplace : public Dirac {
1806 
1807  public:
1808  GaugeLaplace(const DiracParam &param);
1809  GaugeLaplace(const GaugeLaplace &laplace);
1810 
1811  virtual ~GaugeLaplace();
1812  GaugeLaplace& operator=(const GaugeLaplace &laplace);
1813 
1814  virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const;
1815  virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in,
1816  const QudaParity parity, const ColorSpinorField &x, const double &k) const;
1817  virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const;
1818  virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
1819 
1820  virtual void prepare(ColorSpinorField* &src, ColorSpinorField* &sol,
1822  const QudaSolutionType) const;
1823  virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b,
1824  const QudaSolutionType) const;
1825  virtual bool hermitian() const { return true; }
1826 
1828  };
1829 
1833  class GaugeLaplacePC : public GaugeLaplace {
1834 
1835  public:
1837  GaugeLaplacePC(const GaugeLaplacePC &laplace);
1838  virtual ~GaugeLaplacePC();
1839  GaugeLaplacePC& operator=(const GaugeLaplacePC &laplace);
1840 
1841  void M(ColorSpinorField &out, const ColorSpinorField &in) const;
1842  void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
1843 
1844  void prepare(ColorSpinorField* &src, ColorSpinorField* &sol,
1846  const QudaSolutionType) const;
1847  void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const;
1848  virtual bool hermitian() const { return true; }
1849 
1851  };
1852 
1858  class GaugeCovDev : public Dirac {
1859 
1860  public:
1861  GaugeCovDev(const DiracParam &param);
1862  GaugeCovDev(const GaugeCovDev &covDev);
1863 
1864  virtual ~GaugeCovDev();
1865  GaugeCovDev& operator=(const GaugeCovDev &covDev);
1866 
1867  virtual void DslashCD(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const int mu) const;
1868  virtual void MCD(ColorSpinorField &out, const ColorSpinorField &in, const int mu) const;
1869  virtual void MdagMCD(ColorSpinorField &out, const ColorSpinorField &in, const int mu) const;
1870 
1871 
1872  virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const;
1873  virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in,
1874  const QudaParity parity, const ColorSpinorField &x, const double &k) const;
1875  virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const;
1876  virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const;
1877 
1878  virtual void prepare(ColorSpinorField* &src, ColorSpinorField* &sol,
1880  const QudaSolutionType) const;
1881  virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b,
1882  const QudaSolutionType) const;
1883 
1885  };
1886 
1887  // Functor base class for applying a given Dirac matrix (M, MdagM, etc.)
1888  // This basically wraps around a Dirac op
1889  // and provides for several operator() operations to apply it, perhaps to apply
1890  // AXPYs etc. Once we have this, further classes diracM diracMdag etc
1891  // can implement the operator()-s as needed to apply the operator, MdagM etc etc.
1892  class DiracMatrix {
1893 
1894  protected:
1895  const Dirac *dirac;
1896 
1897  public:
1898  DiracMatrix(const Dirac &d) : dirac(&d), shift(0.0) { }
1899  DiracMatrix(const Dirac *d) : dirac(d), shift(0.0) { }
1902  virtual ~DiracMatrix() { }
1903 
1904  virtual void operator()(ColorSpinorField &out, const ColorSpinorField &in) const = 0;
1905  virtual void operator()(ColorSpinorField &out, const ColorSpinorField &in, ColorSpinorField &tmp) const = 0;
1906  virtual void operator()(ColorSpinorField &out, const ColorSpinorField &in, ColorSpinorField &Tmp1,
1907  ColorSpinorField &Tmp2) const = 0;
1908 
1909  unsigned long long flops() const { return dirac->Flops(); }
1910 
1912 
1913  virtual int getStencilSteps() const = 0;
1914 
1915  std::string Type() const { return typeid(*dirac).name(); }
1916 
1920  bool isWilsonType() const
1921  {
1922  return (Type() == typeid(DiracWilson).name() || Type() == typeid(DiracWilsonPC).name()
1923  || Type() == typeid(DiracClover).name() || Type() == typeid(DiracCloverPC).name()
1924  || Type() == typeid(DiracCloverHasenbuschTwist).name()
1925  || Type() == typeid(DiracCloverHasenbuschTwistPC).name() || Type() == typeid(DiracTwistedMass).name()
1926  || Type() == typeid(DiracTwistedMassPC).name() || Type() == typeid(DiracTwistedClover).name()
1927  || Type() == typeid(DiracTwistedCloverPC).name()) ?
1928  true :
1929  false;
1930  }
1931 
1935  bool isStaggered() const
1936  {
1937  return (Type() == typeid(DiracStaggeredPC).name() || Type() == typeid(DiracStaggered).name()
1938  || Type() == typeid(DiracImprovedStaggeredPC).name() || Type() == typeid(DiracImprovedStaggered).name()
1939  || Type() == typeid(DiracStaggeredKD).name() || Type() == typeid(DiracImprovedStaggeredKD).name()) ?
1940  true :
1941  false;
1942  }
1943 
1947  bool isDwf() const
1948  {
1949  return (Type() == typeid(DiracDomainWall).name() || Type() == typeid(DiracDomainWallPC).name()
1950  || Type() == typeid(DiracDomainWall4D).name() || Type() == typeid(DiracDomainWall4DPC).name()
1951  || Type() == typeid(DiracMobius).name() || Type() == typeid(DiracMobiusPC).name()
1952  || Type() == typeid(DiracMobiusEofa).name() || Type() == typeid(DiracMobiusEofaPC).name()) ?
1953  true :
1954  false;
1955  }
1956 
1960  bool isCoarse() const { return dirac->isCoarse(); }
1961 
1962  virtual bool hermitian() const { return dirac->hermitian(); }
1963 
1964  const Dirac *Expose() const { return dirac; }
1965 
1967  double shift;
1968  };
1969 
1970  class DiracM : public DiracMatrix
1971  {
1972 
1973  public:
1974  DiracM(const Dirac &d) : DiracMatrix(d) {}
1975  DiracM(const Dirac *d) : DiracMatrix(d) {}
1976 
1980  void operator()(ColorSpinorField &out, const ColorSpinorField &in) const
1981  {
1982  dirac->M(out, in);
1983  if (shift != 0.0) blas::axpy(shift, const_cast<ColorSpinorField &>(in), out);
1984  }
1985 
1996  {
1997  bool reset1 = false;
1998  if (!dirac->tmp1) { dirac->tmp1 = &tmp; reset1 = true; }
1999  dirac->M(out, in);
2000  if (shift != 0.0) blas::axpy(shift, const_cast<ColorSpinorField&>(in), out);
2001  if (reset1) { dirac->tmp1 = NULL; reset1 = false; }
2002  }
2003 
2004  /* Provides two tmps, in case the dirac op doesn't have them */
2006  ColorSpinorField &Tmp1, ColorSpinorField &Tmp2) const
2007  {
2008  bool reset1 = false;
2009  bool reset2 = false;
2010  if (!dirac->tmp1) { dirac->tmp1 = &Tmp1; reset1 = true; }
2011  if (!dirac->tmp2) { dirac->tmp2 = &Tmp2; reset2 = true; }
2012  dirac->M(out, in);
2013  if (shift != 0.0) blas::axpy(shift, const_cast<ColorSpinorField&>(in), out);
2014  if (reset2) { dirac->tmp2 = NULL; reset2 = false; }
2015  if (reset1) { dirac->tmp1 = NULL; reset1 = false; }
2016  }
2017 
2018  int getStencilSteps() const
2019  {
2020  return dirac->getStencilSteps();
2021  }
2022  };
2023 
2024  /* Gloms onto a DiracOp and provides an operator() which applies its MdagM */
2025  class DiracMdagM : public DiracMatrix {
2026 
2027  public:
2028  DiracMdagM(const Dirac &d) : DiracMatrix(d) { }
2029  DiracMdagM(const Dirac *d) : DiracMatrix(d) { }
2030 
2031  void operator()(ColorSpinorField &out, const ColorSpinorField &in) const
2032  {
2033  dirac->MdagM(out, in);
2034  if (shift != 0.0) blas::axpy(shift, const_cast<ColorSpinorField&>(in), out);
2035  }
2036 
2038  {
2039  bool reset1 = false;
2040  if (!dirac->tmp1) {
2041  dirac->tmp1 = &tmp;
2042  reset1 = true;
2043  }
2044  dirac->MdagM(out, in);
2045  if (shift != 0.0) blas::axpy(shift, const_cast<ColorSpinorField&>(in), out);
2046  if (reset1) {
2047  dirac->tmp1 = NULL;
2048  reset1 = false;
2049  }
2050  }
2051 
2053  ColorSpinorField &Tmp1, ColorSpinorField &Tmp2) const
2054  {
2055  bool reset1 = false;
2056  bool reset2 = false;
2057  if (!dirac->tmp1) {
2058  dirac->tmp1 = &Tmp1;
2059  reset1 = true;
2060  }
2061  if (!dirac->tmp2) {
2062  dirac->tmp2 = &Tmp2;
2063  reset2 = true;
2064  }
2065  dirac->MdagM(out, in);
2066  if (shift != 0.0) blas::axpy(shift, const_cast<ColorSpinorField&>(in), out);
2067  if (reset2) {
2068  dirac->tmp2 = NULL;
2069  reset2 = false;
2070  }
2071  if (reset1) {
2072  dirac->tmp1 = NULL;
2073  reset1 = false;
2074  }
2075  }
2076 
2077  int getStencilSteps() const
2078  {
2079  return 2*dirac->getStencilSteps(); // 2 for M and M dagger
2080  }
2081 
2082  virtual bool hermitian() const { return true; } // normal op is always Hermitian
2083  };
2084 
2085  /* Gloms onto a DiracOp and provides an operator() which applies its MdagMLocal */
2087  {
2088 
2089  public:
2092 
2093  void operator()(ColorSpinorField &out, const ColorSpinorField &in) const { dirac->MdagMLocal(out, in); }
2094 
2096  {
2097  bool reset1 = false;
2098  if (!dirac->tmp1) {
2099  dirac->tmp1 = &tmp;
2100  reset1 = true;
2101  }
2102  dirac->MdagMLocal(out, in);
2103  if (shift != 0.0) blas::axpy(shift, const_cast<ColorSpinorField &>(in), out);
2104  if (reset1) {
2105  dirac->tmp1 = NULL;
2106  reset1 = false;
2107  }
2108  }
2109 
2111  {
2112  bool reset1 = false;
2113  bool reset2 = false;
2114  if (!dirac->tmp1) {
2115  dirac->tmp1 = &Tmp1;
2116  reset1 = true;
2117  }
2118  if (!dirac->tmp2) {
2119  dirac->tmp2 = &Tmp2;
2120  reset2 = true;
2121  }
2122  dirac->MdagMLocal(out, in);
2123  if (shift != 0.0) blas::axpy(shift, const_cast<ColorSpinorField &>(in), out);
2124  if (reset2) {
2125  dirac->tmp2 = NULL;
2126  reset2 = false;
2127  }
2128  if (reset1) {
2129  dirac->tmp1 = NULL;
2130  reset1 = false;
2131  }
2132  }
2133 
2134  int getStencilSteps() const
2135  {
2136  return 2 * dirac->getStencilSteps(); // 2 for M and M dagger
2137  }
2138  };
2139 
2140  /* Gloms onto a DiracMatrix and provides an operator() forward to its MMdag method */
2141  class DiracMMdag : public DiracMatrix
2142  {
2143 
2144  public:
2145  DiracMMdag(const Dirac &d) : DiracMatrix(d) { }
2146  DiracMMdag(const Dirac *d) : DiracMatrix(d) { }
2147 
2148  void operator()(ColorSpinorField &out, const ColorSpinorField &in) const
2149  {
2150  dirac->MMdag(out, in);
2151  if (shift != 0.0) blas::axpy(shift, const_cast<ColorSpinorField&>(in), out);
2152  }
2153 
2155  {
2156  bool reset1 = false;
2157  if (!dirac->tmp1) {
2158  dirac->tmp1 = &tmp;
2159  reset1 = true;
2160  }
2161  dirac->MMdag(out, in);
2162  if (shift != 0.0) blas::axpy(shift, const_cast<ColorSpinorField&>(in), out);
2163  if (reset1) {
2164  dirac->tmp1 = NULL;
2165  reset1 = false;
2166  }
2167  }
2168 
2170  ColorSpinorField &Tmp1, ColorSpinorField &Tmp2) const
2171  {
2172  bool reset1 = false;
2173  bool reset2 = false;
2174  if (!dirac->tmp1) {
2175  dirac->tmp1 = &Tmp1;
2176  reset1 = true;
2177  }
2178  if (!dirac->tmp2) {
2179  dirac->tmp2 = &Tmp2;
2180  reset2 = true;
2181  }
2182  dirac->MMdag(out, in);
2183  if (shift != 0.0) blas::axpy(shift, const_cast<ColorSpinorField&>(in), out);
2184  if (reset2) {
2185  dirac->tmp2 = NULL;
2186  reset2 = false;
2187  }
2188  if (reset1) {
2189  dirac->tmp1 = NULL;
2190  reset1 = false;
2191  }
2192  }
2193 
2194  int getStencilSteps() const
2195  {
2196  return 2*dirac->getStencilSteps(); // 2 for M and M dagger
2197  }
2198 
2199  virtual bool hermitian() const { return true; } // normal op is always Hermitian
2200  };
2201 
2202  /* Gloms onto a DiracMatrix and provides an operator() for its Mdag method */
2203  class DiracMdag : public DiracMatrix {
2204 
2205  public:
2206  DiracMdag(const Dirac &d) : DiracMatrix(d) { }
2207  DiracMdag(const Dirac *d) : DiracMatrix(d) { }
2208 
2209  void operator()(ColorSpinorField &out, const ColorSpinorField &in) const
2210  {
2211  dirac->Mdag(out, in);
2212  if (shift != 0.0) blas::axpy(shift, const_cast<ColorSpinorField&>(in), out);
2213  }
2214 
2216  {
2217  bool reset1 = false;
2218  if (!dirac->tmp1) {
2219  dirac->tmp1 = &tmp;
2220  reset1 = true;
2221  }
2222  dirac->Mdag(out, in);
2223  if (shift != 0.0) blas::axpy(shift, const_cast<ColorSpinorField&>(in), out);
2224  if (reset1) {
2225  dirac->tmp1 = NULL;
2226  reset1 = false;
2227  }
2228  }
2229 
2231  ColorSpinorField &Tmp1, ColorSpinorField &Tmp2) const
2232  {
2233  bool reset1 = false;
2234  bool reset2 = false;
2235  if (!dirac->tmp1) {
2236  dirac->tmp1 = &Tmp1;
2237  reset1 = true;
2238  }
2239  if (!dirac->tmp2) {
2240  dirac->tmp2 = &Tmp2;
2241  reset2 = true;
2242  }
2243  dirac->Mdag(out, in);
2244  if (shift != 0.0) blas::axpy(shift, const_cast<ColorSpinorField&>(in), out);
2245  if (reset2) {
2246  dirac->tmp2 = NULL;
2247  reset2 = false;
2248  }
2249  if (reset1) {
2250  dirac->tmp1 = NULL;
2251  reset1 = false;
2252  }
2253  }
2254 
2255  int getStencilSteps() const
2256  {
2257  return dirac->getStencilSteps();
2258  }
2259  };
2260 
2261  /* Gloms onto a dirac matrix and gives back the dagger of whatever that was originally.
2262  (flips dagger before applying and restores afterwards */
2263  class DiracDagger : public DiracMatrix {
2264 
2265  protected:
2267 
2268  public:
2271 
2272  void operator()(ColorSpinorField &out, const ColorSpinorField &in) const
2273  {
2274  dirac->flipDagger();
2275  mat(out, in);
2276  dirac->flipDagger();
2277  }
2278 
2280  {
2281  dirac->flipDagger();
2282  mat(out, in, tmp);
2283  dirac->flipDagger();
2284  }
2285 
2287  ColorSpinorField &Tmp1, ColorSpinorField &Tmp2) const
2288  {
2289  dirac->flipDagger();
2290  mat(out, in, Tmp1, Tmp2);
2291  dirac->flipDagger();
2292  }
2293 
2294  int getStencilSteps() const
2295  {
2296  return mat.getStencilSteps();
2297  }
2298  };
2299 
2303  class DiracG5M : public DiracMatrix
2304  {
2305 
2306  public:
2307  DiracG5M(const Dirac &d) : DiracMatrix(d) {}
2308  DiracG5M(const Dirac *d) : DiracMatrix(d) {}
2309 
2316  {
2317  auto dirac_type = dirac->getDiracType();
2318  auto pc_type = dirac->getMatPCType();
2319  switch (dirac_type) {
2320  case QUDA_WILSON_DIRAC:
2321  case QUDA_CLOVER_DIRAC:
2325  // while the twisted ops don't have a Hermitian indefinite spectrum, they
2326  // do have a spectrum of the form (real) + i mu
2327  gamma5(vec, vec);
2328  break;
2329  case QUDA_WILSONPC_DIRAC:
2330  case QUDA_CLOVERPC_DIRAC:
2334  if (pc_type == QUDA_MATPC_EVEN_EVEN_ASYMMETRIC || pc_type == QUDA_MATPC_ODD_ODD_ASYMMETRIC) {
2335  gamma5(vec, vec);
2336  } else {
2337  errorQuda("Invalid matpc type for Hermitian gamma5 version of %d", dirac_type);
2338  }
2339  break;
2348  // needs 5th dimension reversal, Mobius needs that inversion...
2349  errorQuda("Support for Hermitian DWF operator %d does not exist yet", dirac_type);
2350  break;
2351  case QUDA_STAGGERED_DIRAC:
2352  case QUDA_ASQTAD_DIRAC:
2353  // Gamma5 is (-1)^(x+y+z+t)
2354  blas::ax(-1.0, vec.Odd());
2355  break;
2357  case QUDA_ASQTADPC_DIRAC:
2358  // even is unchanged
2359  if (pc_type == QUDA_MATPC_ODD_ODD || pc_type == QUDA_MATPC_ODD_ODD_ASYMMETRIC) {
2360  blas::ax(-1.0, vec); // technically correct
2361  } else if (pc_type == QUDA_MATPC_INVALID) {
2362  errorQuda("Invalid pc_type %d for operator %d", pc_type, dirac_type);
2363  }
2364  break;
2366  case QUDA_ASQTADKD_DIRAC:
2367  errorQuda("Kahler-Dirac preconditioned type %d does not have a Hermitian g5 operator", dirac_type);
2368  break;
2369  case QUDA_COARSE_DIRAC:
2370  case QUDA_COARSEPC_DIRAC:
2371  // more complicated, need to see if it's a repeated coarsening
2372  // of the coarse op
2373  errorQuda("Support for Hermitian coarse operator %d does not exist yet", dirac_type);
2374  break;
2378  // do nothing, technically correct, there is no gamma5
2379  break;
2380  default: errorQuda("Invalid Dirac type %d", dirac_type);
2381  }
2382  }
2383 
2384  void operator()(ColorSpinorField &out, const ColorSpinorField &in) const
2385  {
2386  dirac->M(out, in);
2387  if (shift != 0.0) blas::axpy(shift, const_cast<ColorSpinorField &>(in), out);
2388  applyGamma5(out);
2389  }
2390 
2392  {
2393  bool reset1 = false;
2394  if (!dirac->tmp1) {
2395  dirac->tmp1 = &tmp;
2396  reset1 = true;
2397  }
2398  dirac->M(out, in);
2399  if (shift != 0.0) blas::axpy(shift, const_cast<ColorSpinorField &>(in), out);
2400  applyGamma5(out);
2401  if (reset1) {
2402  dirac->tmp1 = NULL;
2403  reset1 = false;
2404  }
2405  }
2406 
2408  {
2409  bool reset1 = false;
2410  bool reset2 = false;
2411  if (!dirac->tmp1) {
2412  dirac->tmp1 = &Tmp1;
2413  reset1 = true;
2414  }
2415  if (!dirac->tmp2) {
2416  dirac->tmp2 = &Tmp2;
2417  reset2 = true;
2418  }
2419  dirac->M(out, in);
2420  if (shift != 0.0) blas::axpy(shift, const_cast<ColorSpinorField &>(in), out);
2421  applyGamma5(out);
2422  if (reset2) {
2423  dirac->tmp2 = NULL;
2424  reset2 = false;
2425  }
2426  if (reset1) {
2427  dirac->tmp1 = NULL;
2428  reset1 = false;
2429  }
2430  }
2431 
2432  int getStencilSteps() const { return dirac->getStencilSteps(); }
2433 
2437  virtual bool hermitian() const
2438  {
2439  auto dirac_type = dirac->getDiracType();
2440  auto pc_type = dirac->getMatPCType();
2441 
2442  if (dirac_type == QUDA_GAUGE_LAPLACE_DIRAC || dirac_type == QUDA_GAUGE_LAPLACEPC_DIRAC
2443  || dirac_type == QUDA_GAUGE_COVDEV_DIRAC)
2444  return true;
2445 
2446  // subtle: odd operator gets a minus sign
2447  if ((dirac_type == QUDA_STAGGEREDPC_DIRAC || dirac_type == QUDA_ASQTADPC_DIRAC)
2448  && (pc_type == QUDA_MATPC_EVEN_EVEN || pc_type == QUDA_MATPC_EVEN_EVEN_ASYMMETRIC))
2449  return true;
2450 
2451  return false;
2452  }
2453  };
2454 
2464  void createDirac(Dirac *&d, Dirac *&dSloppy, Dirac *&dPre, QudaInvertParam &param, const bool pc_solve);
2465 
2477  void createDiracWithRefine(Dirac *&d, Dirac *&dSloppy, Dirac *&dPre, Dirac *&dRef, QudaInvertParam &param,
2478  const bool pc_solve);
2479 
2492  void createDiracWithEig(Dirac *&d, Dirac *&dSloppy, Dirac *&dPre, Dirac *&dRef, QudaInvertParam &param,
2493  const bool pc_solve);
2494 
2495 } // namespace quda
2496 
const ColorSpinorField & Odd() const
void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass=0., double mu=0., double mu_factor=0.) const
Create the coarse clover operator.
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:635
DiracCloverHasenbuschTwist & operator=(const DiracCloverHasenbuschTwist &dirac)
virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
void DslashXpayTwistNoClovInv(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k, const double &b) const
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:685
void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass=0., double mu=0., double mu_factor=0.) const
Create the coarse even-odd preconditioned clover operator. Unlike the Wilson operator,...
void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
DiracCloverHasenbuschTwistPC & operator=(const DiracCloverHasenbuschTwistPC &dirac)
void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
void DslashXpayTwistClovInv(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k, const double &b) const
virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
DiracClover & operator=(const DiracClover &dirac)
virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
virtual ~DiracClover()
virtual void updateFields(cudaGaugeField *gauge_in, cudaGaugeField *fat_gauge_in, cudaGaugeField *long_gauge_in, cudaCloverField *clover_in)
Update the internal gauge, fat gauge, long gauge, clover field pointer as appropriate....
Definition: dirac_quda.h:506
DiracClover(const DiracParam &param)
Definition: dirac_clover.cpp:7
virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
void checkParitySpinor(const ColorSpinorField &, const ColorSpinorField &) const
Check parity spinors are usable (check geometry ?)
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:495
void Clover(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass=0., double mu=0., double mu_factor=0.) const
Create the coarse clover operator.
virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream=0) const
If managed memory and prefetch is enabled, prefetch all relevant memory fields (gauge,...
cudaCloverField * clover
Definition: dirac_quda.h:470
virtual void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
apply 'dslash' operator for the DiracOp. This may be e.g. AD
void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass=0., double mu=0., double mu_factor=0.) const
Create the coarse even-odd preconditioned clover operator. Unlike the Wilson operator,...
DiracCloverPC & operator=(const DiracCloverPC &dirac)
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:577
void CloverInv(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream=0) const
If managed memory and prefetch is enabled, prefetch all relevant memory fields (gauge,...
void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
DiracCloverPC(const DiracParam &param)
virtual bool isCoarse() const
Whether the Dirac object is the DiracCoarse.
Definition: dirac_quda.h:1647
cudaGaugeField * Yhat_d
Definition: dirac_quda.h:1578
void Clover(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
Apply the coarse clover operator.
double MuFactor() const
accessor for mu factoo for MG/ – override can return a better value
Definition: dirac_quda.h:1616
virtual ~DiracCoarse()
virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
Apply DslashXpay out = (D * in)
void createPreconditionedCoarseOp(GaugeField &Yhat, GaugeField &Xinv, const GaugeField &Y, const GaugeField &X)
Create the precondtioned coarse operator.
cpuGaugeField * Yhat_h
Definition: dirac_quda.h:1573
void createYhat(bool gpu=true) const
Allocate the Yhat and Xinv fields.
const bool mapped
Definition: dirac_quda.h:1598
cpuGaugeField * Xinv_h
Definition: dirac_quda.h:1572
virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
cpuGaugeField * Y_h
Definition: dirac_quda.h:1570
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:1697
virtual void updateFields(cudaGaugeField *gauge_in, cudaGaugeField *fat_gauge_in, cudaGaugeField *long_gauge_in, cudaCloverField *clover_in)
Update the internal gauge, fat gauge, long gauge, clover field pointer as appropriate....
Definition: dirac_quda.h:1699
const bool gpu_setup
Definition: dirac_quda.h:1595
virtual void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
const Transfer * transfer
Definition: dirac_quda.h:1565
cudaGaugeField * Xinv_d
Definition: dirac_quda.h:1577
void createY(bool gpu=true, bool mapped=false) const
Allocate the Y and X fields.
double Mu() const
accessor for twist parameter – overrride can return better value
Definition: dirac_quda.h:1615
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply the full operator.
void initializeLazy(QudaFieldLocation location) const
Create the CPU or GPU coarse gauge fields on demand (requires that the fields have been created in th...
const bool use_mma
Definition: dirac_quda.h:1568
cpuGaugeField * X_h
Definition: dirac_quda.h:1571
virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream=0) const
If managed memory and prefetch is enabled, prefetch all relevant memory fields (X,...
void CloverInv(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
Apply the inverse coarse clover operator.
double Mass() const
accessor for Mass (in case of a factor of 2 for staggered)
Definition: dirac_quda.h:1614
const Dirac * dirac
Definition: dirac_quda.h:1566
virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
cudaGaugeField * X_d
Definition: dirac_quda.h:1576
void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass, double mu, double mu_factor=0.) const
Create the coarse operator from this coarse operator.
const bool need_bidirectional
Definition: dirac_quda.h:1567
virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
Apply DslashXpay out = (D * in + A * x)
cudaGaugeField * Y_d
Definition: dirac_quda.h:1575
void initializeCoarse()
Initialize the coarse gauge fields. Location is determined by gpu_setup variable.
DiracCoarse(const DiracParam &param, bool gpu_setup=true, bool mapped=false)
Definition: dirac_coarse.cpp:7
void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply the full operator.
void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
Apply DslashXpay out = (D * in + A * x)
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:1770
DiracCoarsePC(const DiracParam &param, bool gpu_setup=true)
void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
Apply DslashXpay out = (D * in)
virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream=0) const
If managed memory and prefetch is enabled, prefetch all relevant memory fields (Xhat,...
void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass, double mu, double mu_factor=0.) const
Create the coarse even-odd preconditioned coarse operator. Unlike the Wilson operator,...
DiracDagger(const DiracMatrix &mat)
Definition: dirac_quda.h:2269
const DiracMatrix & mat
Definition: dirac_quda.h:2266
int getStencilSteps() const
Definition: dirac_quda.h:2294
DiracDagger(const DiracMatrix *mat)
Definition: dirac_quda.h:2270
void operator()(ColorSpinorField &out, const ColorSpinorField &in) const
Definition: dirac_quda.h:2272
void operator()(ColorSpinorField &out, const ColorSpinorField &in, ColorSpinorField &tmp) const
Definition: dirac_quda.h:2279
void operator()(ColorSpinorField &out, const ColorSpinorField &in, ColorSpinorField &Tmp1, ColorSpinorField &Tmp2) const
Definition: dirac_quda.h:2286
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:783
void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
DiracDomainWall4D(const DiracParam &param)
DiracDomainWall4D & operator=(const DiracDomainWall4D &dirac)
void Dslash4Xpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
void Dslash5(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
void Dslash4(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
Apply the local MdagM operator: equivalent to applying zero Dirichlet boundary condition to MdagM on ...
void Dslash5Xpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
DiracDomainWall4DPC & operator=(const DiracDomainWall4DPC &dirac)
void Dslash5invXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const double &kappa5, const ColorSpinorField &x, const double &k) const
DiracDomainWall4DPC(const DiracParam &param)
void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:811
void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
void Dslash5inv(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const double &kappa5) const
void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
apply 'dslash' operator for the DiracOp. This may be e.g. AD
DiracDomainWall & operator=(const DiracDomainWall &dirac)
virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
DiracDomainWall(const DiracParam &param)
void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
Xpay version of Dslash.
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:732
virtual void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
void checkDWF(const ColorSpinorField &out, const ColorSpinorField &in) const
void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:755
DiracDomainWallPC(const DiracParam &param)
DiracDomainWallPC & operator=(const DiracDomainWallPC &dirac)
void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
DiracG5M(const Dirac &d)
Definition: dirac_quda.h:2307
void operator()(ColorSpinorField &out, const ColorSpinorField &in, ColorSpinorField &tmp) const
Definition: dirac_quda.h:2391
int getStencilSteps() const
Definition: dirac_quda.h:2432
void operator()(ColorSpinorField &out, const ColorSpinorField &in) const
Definition: dirac_quda.h:2384
virtual bool hermitian() const
return if the operator is HPD
Definition: dirac_quda.h:2437
DiracG5M(const Dirac *d)
Definition: dirac_quda.h:2308
void applyGamma5(ColorSpinorField &vec) const
Left-apply gamma5 as appropriate for the operator.
Definition: dirac_quda.h:2315
void operator()(ColorSpinorField &out, const ColorSpinorField &in, ColorSpinorField &Tmp1, ColorSpinorField &Tmp2) const
Definition: dirac_quda.h:2407
virtual void Dslash4(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
Apply the local MdagM operator: equivalent to applying zero Dirichlet boundary condition to MdagM on ...
Definition: dirac_quda.h:243
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const =0
Apply M for the dirac op. E.g. the Schur Complement operator.
virtual void reconstructSpecialMG(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType solType) const
Definition: dirac_quda.h:269
unsigned long long flops
Definition: dirac_quda.h:150
QudaDiracType type
Definition: dirac_quda.h:153
virtual void MdagMLocal(ColorSpinorField &out, const ColorSpinorField &in) const
Apply the local MdagM operator: equivalent to applying zero Dirichlet boundary condition to MdagM on ...
Definition: dirac_quda.h:232
unsigned long long Flops() const
returns and then zeroes flopcount
Definition: dirac_quda.h:313
bool newTmp(ColorSpinorField **, const ColorSpinorField &) const
Definition: dirac.cpp:72
void MMdag(ColorSpinorField &out, const ColorSpinorField &in) const
Apply Normal Operator.
Definition: dirac.cpp:99
double Kappa() const
accessor for Kappa (mass parameter)
Definition: dirac_quda.h:293
virtual void updateFields(cudaGaugeField *gauge_in, cudaGaugeField *fat_gauge_in, cudaGaugeField *long_gauge_in, cudaCloverField *clover_in)
Update the internal gauge, fat gauge, long gauge, clover field pointer as appropriate....
Definition: dirac_quda.h:360
double kappa
Definition: dirac_quda.h:145
virtual bool hasSpecialMG() const
specifies whether or not there's a specialized prepare/reconstruct used before/after transfering to/f...
Definition: dirac_quda.h:280
void flipDagger() const
Flips value of daggered.
Definition: dirac_quda.h:338
virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const =0
Apply MdagM operator which may be optimized.
virtual double Mu() const
accessor for twist parameter – overrride can return better value
Definition: dirac_quda.h:303
virtual bool isCoarse() const
Whether the Dirac object is the DiracCoarse.
Definition: dirac_quda.h:181
virtual double Mass() const
accessor for Mass (in case of a factor of 2 for staggered)
Definition: dirac_quda.h:298
virtual void prepareSpecialMG(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType solType) const
Definition: dirac_quda.h:264
virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const =0
apply 'dslash' operator for the DiracOp. This may be e.g. AD
virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream=0) const
If managed memory and prefetch is enabled, prefetch the gauge field and temporary spinors to the CPU ...
Definition: dirac.cpp:305
QudaPrecision halo_precision
Definition: dirac_quda.h:154
void setHaloPrecision(QudaPrecision halo_precision_) const
Definition: dirac_quda.h:382
QudaMatPCType matpcType
Definition: dirac_quda.h:148
cudaGaugeField * gauge
Definition: dirac_quda.h:144
virtual double MuFactor() const
accessor for mu factoo for MG/ – override can return a better value
Definition: dirac_quda.h:308
double mass
Definition: dirac_quda.h:146
void setMass(double mass)
Definition: dirac_quda.h:282
QudaPrecision HaloPrecision() const
Definition: dirac_quda.h:381
virtual void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType solType) const =0
void deleteTmp(ColorSpinorField **, const bool &reset) const
Definition: dirac.cpp:83
virtual QudaDiracType getDiracType() const =0
returns the Dirac type
virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType solType) const =0
Dirac(const DiracParam &param)
Definition: dirac.cpp:12
virtual ~Dirac()
Definition: dirac.cpp:46
void Dagger(QudaDagType dag) const
sets whether operator is daggered or not
Definition: dirac_quda.h:333
virtual void checkParitySpinor(const ColorSpinorField &, const ColorSpinorField &) const
Check parity spinors are usable (check geometry ?)
Definition: dirac.cpp:108
virtual bool hermitian() const
is operator hermitian
Definition: dirac_quda.h:343
ColorSpinorField * tmp1
Definition: dirac_quda.h:151
virtual void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass=0., double mu=0., double mu_factor=0.) const
Create the coarse operator (virtual parent)
Definition: dirac_quda.h:377
static Dirac * create(const DiracParam &param)
Creates a subclass from parameters.
Definition: dirac.cpp:151
QudaMatPCType getMatPCType() const
returns preconditioning type
Definition: dirac_quda.h:323
TimeProfile profile
Definition: dirac_quda.h:161
QudaDagType dagger
Definition: dirac_quda.h:149
void checkSpinorAlias(const ColorSpinorField &, const ColorSpinorField &) const
check spinors do not alias
Definition: dirac.cpp:146
Dirac & operator=(const Dirac &dirac)
Definition: dirac.cpp:51
virtual void checkFullSpinor(const ColorSpinorField &, const ColorSpinorField &) const
check full spinors are compatible (check geometry ?)
Definition: dirac.cpp:138
void setCommDim(const int commDim_[QUDA_MAX_DIM]) const
Enable / disable communications for the Dirac operator.
Definition: dirac_quda.h:174
ColorSpinorField * tmp2
Definition: dirac_quda.h:152
int getStencilSteps() const
I have no idea what this does.
Definition: dirac.cpp:261
virtual bool hasDslash() const
Whether or not the operator has a single-parity Dslash.
Definition: dirac_quda.h:201
int commDim[QUDA_MAX_DIM]
Definition: dirac_quda.h:159
void Mdag(ColorSpinorField &out, const ColorSpinorField &in) const
Apply Mdag (daggered operator of M.
Definition: dirac.cpp:92
virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const =0
Xpay version of Dslash.
virtual void updateFields(cudaGaugeField *gauge_in, cudaGaugeField *fat_gauge_in, cudaGaugeField *long_gauge_in, cudaCloverField *clover_in)
Update the internal gauge, fat gauge, long gauge, clover field pointer as appropriate....
Definition: dirac_quda.h:1405
virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
DiracImprovedStaggered & operator=(const DiracImprovedStaggered &dirac)
cudaGaugeField * fatGauge
Definition: dirac_quda.h:1356
virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream=0) const
If managed memory and prefetch is enabled, prefetch all relevant memory fields (fat+long links,...
cudaGaugeField * longGauge
Definition: dirac_quda.h:1357
void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass, double mu=0., double mu_factor=0.) const
Create the coarse staggered operator.
virtual const cudaGaugeField * getFatLinkField() const
Get the fat link field for MG setup.
Definition: dirac_quda.h:1387
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:1380
virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
apply 'dslash' operator for the DiracOp. This may be e.g. AD
virtual void checkParitySpinor(const ColorSpinorField &, const ColorSpinorField &) const
Check parity spinors are usable (check geometry ?)
virtual const cudaGaugeField * getLongLinkField() const
Get the long link field for MG setup.
Definition: dirac_quda.h:1394
DiracImprovedStaggered(const DiracParam &param)
virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
Xpay version of Dslash.
virtual void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
DiracImprovedStaggeredKD(const DiracParam &param)
virtual bool hasDslash() const
Whether or not the operator has a single-parity Dslash.
Definition: dirac_quda.h:1487
void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass, double mu=0., double mu_factor=0.) const
Create the coarse improved staggered KD operator.
virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
Xpay version of Dslash.
virtual void prepareSpecialMG(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType solType) const
virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
virtual void checkParitySpinor(const ColorSpinorField &, const ColorSpinorField &) const
Check parity spinors are usable (check geometry ?)
virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
virtual bool hasSpecialMG() const
specifies whether or not there's a specialized prepare/reconstruct used before/after transfering to/f...
Definition: dirac_quda.h:1506
virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream=0) const
If managed memory and prefetch is enabled, prefetch all relevant memory fields (gauge,...
void KahlerDiracInv(ColorSpinorField &out, const ColorSpinorField &in) const
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:1508
virtual void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
DiracImprovedStaggeredKD & operator=(const DiracImprovedStaggeredKD &dirac)
virtual void reconstructSpecialMG(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType solType) const
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
virtual void updateFields(cudaGaugeField *gauge_in, cudaGaugeField *fat_gauge_in, cudaGaugeField *long_gauge_in, cudaCloverField *clover_in)
Update the internal gauge, fat gauge, long gauge, clover field pointer as appropriate....
virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
apply 'dslash' operator for the DiracOp. This may be e.g. AD
virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
DiracImprovedStaggeredPC & operator=(const DiracImprovedStaggeredPC &dirac)
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:1467
virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
virtual void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
virtual bool hermitian() const
is operator hermitian
Definition: dirac_quda.h:1469
DiracImprovedStaggeredPC(const DiracParam &param)
void operator()(ColorSpinorField &out, const ColorSpinorField &in, ColorSpinorField &tmp) const
Definition: dirac_quda.h:1995
DiracM(const Dirac &d)
Definition: dirac_quda.h:1974
int getStencilSteps() const
Definition: dirac_quda.h:2018
void operator()(ColorSpinorField &out, const ColorSpinorField &in, ColorSpinorField &Tmp1, ColorSpinorField &Tmp2) const
Definition: dirac_quda.h:2005
void operator()(ColorSpinorField &out, const ColorSpinorField &in) const
apply operator and potentially a shift
Definition: dirac_quda.h:1980
DiracM(const Dirac *d)
Definition: dirac_quda.h:1975
DiracMMdag(const Dirac &d)
Definition: dirac_quda.h:2145
int getStencilSteps() const
Definition: dirac_quda.h:2194
virtual bool hermitian() const
Definition: dirac_quda.h:2199
void operator()(ColorSpinorField &out, const ColorSpinorField &in, ColorSpinorField &Tmp1, ColorSpinorField &Tmp2) const
Definition: dirac_quda.h:2169
void operator()(ColorSpinorField &out, const ColorSpinorField &in) const
Definition: dirac_quda.h:2148
DiracMMdag(const Dirac *d)
Definition: dirac_quda.h:2146
void operator()(ColorSpinorField &out, const ColorSpinorField &in, ColorSpinorField &tmp) const
Definition: dirac_quda.h:2154
bool isDwf() const
return if the operator is a domain wall operator, that is, 5-dimensional
Definition: dirac_quda.h:1947
const Dirac * Expose() const
Definition: dirac_quda.h:1964
bool isStaggered() const
return if the operator is a staggered operator
Definition: dirac_quda.h:1935
DiracMatrix(const DiracMatrix *mat)
Definition: dirac_quda.h:1901
virtual bool hermitian() const
Definition: dirac_quda.h:1962
bool isWilsonType() const
return if the operator is a Wilson-type 4-d operator
Definition: dirac_quda.h:1920
DiracMatrix(const Dirac *d)
Definition: dirac_quda.h:1899
unsigned long long flops() const
Definition: dirac_quda.h:1909
virtual void operator()(ColorSpinorField &out, const ColorSpinorField &in) const =0
bool isCoarse() const
return if the operator is a coarse operator
Definition: dirac_quda.h:1960
double shift
Shift term added onto operator (M/M^dag M/M M^dag + shift)
Definition: dirac_quda.h:1967
DiracMatrix(const DiracMatrix &mat)
Definition: dirac_quda.h:1900
const Dirac * dirac
Definition: dirac_quda.h:1895
virtual ~DiracMatrix()
Definition: dirac_quda.h:1902
virtual void operator()(ColorSpinorField &out, const ColorSpinorField &in, ColorSpinorField &Tmp1, ColorSpinorField &Tmp2) const =0
virtual int getStencilSteps() const =0
std::string Type() const
Definition: dirac_quda.h:1915
virtual void operator()(ColorSpinorField &out, const ColorSpinorField &in, ColorSpinorField &tmp) const =0
QudaMatPCType getMatPCType() const
Definition: dirac_quda.h:1911
DiracMatrix(const Dirac &d)
Definition: dirac_quda.h:1898
void operator()(ColorSpinorField &out, const ColorSpinorField &in, ColorSpinorField &tmp) const
Definition: dirac_quda.h:2215
void operator()(ColorSpinorField &out, const ColorSpinorField &in) const
Definition: dirac_quda.h:2209
void operator()(ColorSpinorField &out, const ColorSpinorField &in, ColorSpinorField &Tmp1, ColorSpinorField &Tmp2) const
Definition: dirac_quda.h:2230
int getStencilSteps() const
Definition: dirac_quda.h:2255
DiracMdag(const Dirac &d)
Definition: dirac_quda.h:2206
DiracMdag(const Dirac *d)
Definition: dirac_quda.h:2207
virtual bool hermitian() const
Definition: dirac_quda.h:2082
void operator()(ColorSpinorField &out, const ColorSpinorField &in, ColorSpinorField &Tmp1, ColorSpinorField &Tmp2) const
Definition: dirac_quda.h:2052
void operator()(ColorSpinorField &out, const ColorSpinorField &in, ColorSpinorField &tmp) const
Definition: dirac_quda.h:2037
void operator()(ColorSpinorField &out, const ColorSpinorField &in) const
Definition: dirac_quda.h:2031
int getStencilSteps() const
Definition: dirac_quda.h:2077
DiracMdagM(const Dirac &d)
Definition: dirac_quda.h:2028
DiracMdagM(const Dirac *d)
Definition: dirac_quda.h:2029
DiracMdagMLocal(const Dirac &d)
Definition: dirac_quda.h:2090
void operator()(ColorSpinorField &out, const ColorSpinorField &in, ColorSpinorField &tmp) const
Definition: dirac_quda.h:2095
void operator()(ColorSpinorField &out, const ColorSpinorField &in) const
Definition: dirac_quda.h:2093
DiracMdagMLocal(const Dirac *d)
Definition: dirac_quda.h:2091
void operator()(ColorSpinorField &out, const ColorSpinorField &in, ColorSpinorField &Tmp1, ColorSpinorField &Tmp2) const
Definition: dirac_quda.h:2110
int getStencilSteps() const
Definition: dirac_quda.h:2134
double eofa_y[QUDA_MAX_DWF_LS]
Definition: dirac_quda.h:903
void m5_eofa_xpay(ColorSpinorField &out, const ColorSpinorField &in, const ColorSpinorField &x, double a=-1.) const
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:918
virtual void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
void m5_eofa(ColorSpinorField &out, const ColorSpinorField &in) const
virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
double eofa_x[QUDA_MAX_DWF_LS]
Definition: dirac_quda.h:902
DiracMobiusEofa(const DiracParam &param)
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
double eofa_u[QUDA_MAX_DWF_LS]
Definition: dirac_quda.h:901
virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
void full_dslash(ColorSpinorField &out, const ColorSpinorField &in) const
void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:942
void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
void m5inv_eofa_xpay(ColorSpinorField &out, const ColorSpinorField &in, const ColorSpinorField &x, double a=-1.) const
void m5inv_eofa(ColorSpinorField &out, const ColorSpinorField &in) const
DiracMobiusEofaPC(const DiracParam &param)
Complex c_5[QUDA_MAX_DWF_LS]
Definition: dirac_quda.h:820
void Dslash4(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
Apply the local MdagM operator: equivalent to applying zero Dirichlet boundary condition to MdagM on ...
double mobius_kappa_b
Definition: dirac_quda.h:829
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
void Dslash5(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:857
void Dslash5Xpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
void Dslash4Xpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
void Dslash4pre(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
Complex b_5[QUDA_MAX_DWF_LS]
Definition: dirac_quda.h:819
void Dslash4preXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
virtual void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
DiracMobius(const DiracParam &param)
Definition: dirac_mobius.cpp:7
double mobius_kappa_c
Definition: dirac_quda.h:830
cudaGaugeField * extended_gauge
Definition: dirac_quda.h:864
void Dslash5invXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
void Dslash5inv(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:885
void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
DiracMobiusPC(const DiracParam &param)
void MdagMLocal(ColorSpinorField &out, const ColorSpinorField &in) const
Apply the local MdagM operator: equivalent to applying zero Dirichlet boundary condition to MdagM on ...
DiracMobiusPC & operator=(const DiracMobiusPC &dirac)
Complex b_5[QUDA_MAX_DWF_LS]
Definition: dirac_quda.h:29
Transfer * transfer
Definition: dirac_quda.h:60
ColorSpinorField * tmp1
Definition: dirac_quda.h:52
cudaGaugeField * gauge
Definition: dirac_quda.h:41
int commDim[QUDA_MAX_DIM]
Definition: dirac_quda.h:55
QudaDiracType type
Definition: dirac_quda.h:24
cudaCloverField * clover
Definition: dirac_quda.h:45
Complex c_5[QUDA_MAX_DWF_LS]
Definition: dirac_quda.h:30
cudaGaugeField * longGauge
Definition: dirac_quda.h:43
double eofa_shift
Definition: dirac_quda.h:33
double mu_factor
Definition: dirac_quda.h:49
ColorSpinorField * tmp2
Definition: dirac_quda.h:53
bool need_bidirectional
Definition: dirac_quda.h:62
cudaGaugeField * fatGauge
Definition: dirac_quda.h:42
QudaPrecision halo_precision
Definition: dirac_quda.h:57
QudaMatPCType matpcType
Definition: dirac_quda.h:39
QudaDagType dagger
Definition: dirac_quda.h:40
cudaGaugeField * xInvKD
Definition: dirac_quda.h:46
virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
Xpay version of Dslash.
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:1210
virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
DiracStaggered & operator=(const DiracStaggered &dirac)
DiracStaggered(const DiracParam &param)
virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
virtual void checkParitySpinor(const ColorSpinorField &, const ColorSpinorField &) const
Check parity spinors are usable (check geometry ?)
void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass, double mu=0., double mu_factor=0.) const
Create the coarse staggered operator.
virtual void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
apply 'dslash' operator for the DiracOp. This may be e.g. AD
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
virtual const cudaGaugeField * getGaugeField() const
Get the fine gauge field for MG setup.
Definition: dirac_quda.h:1217
virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
virtual bool hasDslash() const
Whether or not the operator has a single-parity Dslash.
Definition: dirac_quda.h:1284
DiracStaggeredKD & operator=(const DiracStaggeredKD &dirac)
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
virtual void prepareSpecialMG(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType solType) const
void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass, double mu=0., double mu_factor=0.) const
Create the coarse staggered KD operator.
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:1305
DiracStaggeredKD(const DiracParam &param)
void KahlerDiracInv(ColorSpinorField &out, const ColorSpinorField &in) const
virtual void reconstructSpecialMG(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType solType) const
virtual void checkParitySpinor(const ColorSpinorField &, const ColorSpinorField &) const
Check parity spinors are usable (check geometry ?)
virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
virtual bool hasSpecialMG() const
specifies whether or not there's a specialized prepare/reconstruct used before/after transfering to/f...
Definition: dirac_quda.h:1303
virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
apply 'dslash' operator for the DiracOp. This may be e.g. AD
virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream=0) const
If managed memory and prefetch is enabled, prefetch all relevant memory fields (gauge,...
cudaGaugeField * Xinv
Definition: dirac_quda.h:1273
virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
Xpay version of Dslash.
virtual void updateFields(cudaGaugeField *gauge_in, cudaGaugeField *fat_gauge_in, cudaGaugeField *long_gauge_in, cudaCloverField *clover_in)
Update the internal gauge, fat gauge, long gauge, clover field pointer as appropriate....
virtual void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
DiracStaggeredPC & operator=(const DiracStaggeredPC &dirac)
virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
virtual bool hermitian() const
is operator hermitian
Definition: dirac_quda.h:1265
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:1263
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
DiracStaggeredPC(const DiracParam &param)
virtual void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:1075
double Mu() const
accessor for twist parameter – overrride can return better value
Definition: dirac_quda.h:1077
cudaCloverField * clover
Definition: dirac_quda.h:1049
void TwistClover(ColorSpinorField &out, const ColorSpinorField &in, const int parity) const
virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
Xpay version of Dslash.
virtual void updateFields(cudaGaugeField *gauge_in, cudaGaugeField *fat_gauge_in, cudaGaugeField *long_gauge_in, cudaCloverField *clover_in)
Update the internal gauge, fat gauge, long gauge, clover field pointer as appropriate....
Definition: dirac_quda.h:1088
virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
DiracTwistedClover(const DiracTwistedClover &dirac)
void twistedCloverApply(ColorSpinorField &out, const ColorSpinorField &in, const QudaTwistGamma5Type twistType, const int parity) const
virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
apply 'dslash' operator for the DiracOp. This may be e.g. AD
void checkParitySpinor(const ColorSpinorField &, const ColorSpinorField &) const
Check parity spinors are usable (check geometry ?)
virtual void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass, double mu, double mu_factor=0.) const
Create the coarse twisted-clover operator.
virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream=0) const
If managed memory and prefetch is enabled, prefetch all relevant memory fields (gauge,...
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
DiracTwistedClover & operator=(const DiracTwistedClover &dirac)
void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass, double mu, double mu_factor=0.) const
Create the coarse even-odd preconditioned twisted-clover operator. Unlike the Wilson operator,...
void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
apply 'dslash' operator for the DiracOp. This may be e.g. AD
void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
void TwistCloverInv(ColorSpinorField &out, const ColorSpinorField &in, const int parity) const
virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream=0) const
If managed memory and prefetch is enabled, prefetch all relevant memory fields (gauge,...
DiracTwistedCloverPC & operator=(const DiracTwistedCloverPC &dirac)
void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
DiracTwistedCloverPC(const DiracTwistedCloverPC &dirac)
virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
Xpay version of Dslash.
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:1153
virtual void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, QudaParity parity, const ColorSpinorField &x, const double &k) const
Xpay version of Dslash.
virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
void twistedApply(ColorSpinorField &out, const ColorSpinorField &in, const QudaTwistGamma5Type twistType) const
void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass, double mu, double mu_factor=0.) const
Create the coarse twisted-mass operator.
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:973
DiracTwistedMass(const DiracTwistedMass &dirac)
virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
double Mu() const
accessor for twist parameter – overrride can return better value
Definition: dirac_quda.h:975
virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, QudaParity parity) const
apply 'dslash' operator for the DiracOp. This may be e.g. AD
DiracTwistedMass & operator=(const DiracTwistedMass &dirac)
void Twist(ColorSpinorField &out, const ColorSpinorField &in) const
void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass, double mu, double mu_factor=0.) const
Create the coarse even-odd preconditioned twisted-mass operator.
void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
DiracTwistedMassPC(const DiracTwistedMassPC &dirac)
void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:1025
void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
void TwistInv(ColorSpinorField &out, const ColorSpinorField &in) const
DiracTwistedMassPC & operator=(const DiracTwistedMassPC &dirac)
virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
apply 'dslash' operator for the DiracOp. This may be e.g. AD
virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
Xpay version of Dslash.
DiracWilson(const DiracParam &param)
Definition: dirac_wilson.cpp:8
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:421
virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
DiracWilson & operator=(const DiracWilson &dirac)
virtual void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass=0., double mu=0., double mu_factor=0.) const
Create the coarse Wilson operator.
virtual ~DiracWilson()
virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
Xpay version of Dslash.
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
apply 'dslash' operator for the DiracOp. This may be e.g. AD
virtual void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:463
void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
DiracWilsonPC(const DiracParam &param)
void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
DiracWilsonPC & operator=(const DiracWilsonPC &dirac)
void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
Full Covariant Derivative operator. Although not a Dirac operator per se, it's a linear operator so i...
Definition: dirac_quda.h:1858
virtual void MCD(ColorSpinorField &out, const ColorSpinorField &in, const int mu) const
virtual void MdagMCD(ColorSpinorField &out, const ColorSpinorField &in, const int mu) const
virtual void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
virtual ~GaugeCovDev()
GaugeCovDev(const DiracParam &param)
Definition: gauge_covdev.cpp:9
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
Xpay version of Dslash.
virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
GaugeCovDev & operator=(const GaugeCovDev &covDev)
virtual void DslashCD(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const int mu) const
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:1884
virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
apply 'dslash' operator for the DiracOp. This may be e.g. AD
virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
Full Gauge Laplace operator. Although not a Dirac operator per se, it's a linear operator so it's con...
Definition: dirac_quda.h:1805
virtual bool hermitian() const
is operator hermitian
Definition: dirac_quda.h:1825
GaugeLaplace & operator=(const GaugeLaplace &laplace)
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:1827
GaugeLaplace(const DiracParam &param)
virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
apply 'dslash' operator for the DiracOp. This may be e.g. AD
virtual void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
Xpay version of Dslash.
Even-odd preconditioned Gauge Laplace operator.
Definition: dirac_quda.h:1833
virtual QudaDiracType getDiracType() const
returns the Dirac type
Definition: dirac_quda.h:1850
void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
virtual bool hermitian() const
is operator hermitian
Definition: dirac_quda.h:1848
void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
GaugeLaplacePC & operator=(const GaugeLaplacePC &laplace)
void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
GaugeLaplacePC(const DiracParam &param)
double mu
quda::mgarray< double > mu_factor
void mat(void *out, void **link, void *in, int dagger_bit, int mu, QudaPrecision sPrecision, QudaPrecision gPrecision)
GaugeCovDev * dirac
Definition: covdev_test.cpp:42
QudaParity parity
Definition: covdev_test.cpp:40
cudaColorSpinorField * tmp
Definition: covdev_test.cpp:34
QudaInvertParam inv_param
Definition: covdev_test.cpp:27
@ QUDA_TWISTED_MASSPC_DIRAC
Definition: enum_quda.h:312
@ QUDA_GAUGE_LAPLACE_DIRAC
Definition: enum_quda.h:317
@ QUDA_GAUGE_COVDEV_DIRAC
Definition: enum_quda.h:319
@ QUDA_TWISTED_CLOVERPC_DIRAC
Definition: enum_quda.h:314
@ QUDA_MOBIUS_DOMAIN_WALLPC_EOFA_DIRAC
Definition: enum_quda.h:304
@ QUDA_CLOVER_HASENBUSCH_TWIST_DIRAC
Definition: enum_quda.h:295
@ QUDA_TWISTED_MASS_DIRAC
Definition: enum_quda.h:311
@ QUDA_COARSEPC_DIRAC
Definition: enum_quda.h:316
@ QUDA_STAGGERED_DIRAC
Definition: enum_quda.h:305
@ QUDA_CLOVER_HASENBUSCH_TWISTPC_DIRAC
Definition: enum_quda.h:296
@ QUDA_DOMAIN_WALL_4D_DIRAC
Definition: enum_quda.h:299
@ QUDA_ASQTAD_DIRAC
Definition: enum_quda.h:308
@ QUDA_STAGGEREDPC_DIRAC
Definition: enum_quda.h:306
@ QUDA_MOBIUS_DOMAIN_WALL_EOFA_DIRAC
Definition: enum_quda.h:303
@ QUDA_ASQTADPC_DIRAC
Definition: enum_quda.h:309
@ QUDA_COARSE_DIRAC
Definition: enum_quda.h:315
@ QUDA_GAUGE_LAPLACEPC_DIRAC
Definition: enum_quda.h:318
@ QUDA_MOBIUS_DOMAIN_WALLPC_DIRAC
Definition: enum_quda.h:302
@ QUDA_ASQTADKD_DIRAC
Definition: enum_quda.h:310
@ QUDA_TWISTED_CLOVER_DIRAC
Definition: enum_quda.h:313
@ QUDA_DOMAIN_WALL_4DPC_DIRAC
Definition: enum_quda.h:300
@ QUDA_STAGGEREDKD_DIRAC
Definition: enum_quda.h:307
@ QUDA_CLOVER_DIRAC
Definition: enum_quda.h:293
@ QUDA_MOBIUS_DOMAIN_WALL_DIRAC
Definition: enum_quda.h:301
@ QUDA_DOMAIN_WALLPC_DIRAC
Definition: enum_quda.h:298
@ QUDA_DOMAIN_WALL_DIRAC
Definition: enum_quda.h:297
@ QUDA_WILSONPC_DIRAC
Definition: enum_quda.h:292
@ QUDA_CLOVERPC_DIRAC
Definition: enum_quda.h:294
@ QUDA_WILSON_DIRAC
Definition: enum_quda.h:291
@ QUDA_INVALID_DIRAC
Definition: enum_quda.h:320
enum QudaPrecision_s QudaPrecision
@ QUDA_DAG_INVALID
Definition: enum_quda.h:223
@ QUDA_DAG_NO
Definition: enum_quda.h:223
@ QUDA_DAG_YES
Definition: enum_quda.h:223
enum QudaDagType_s QudaDagType
enum QudaTwistGamma5Type_s QudaTwistGamma5Type
enum QudaDiracType_s QudaDiracType
enum QudaSolutionType_s QudaSolutionType
enum QudaFieldLocation_s QudaFieldLocation
@ QUDA_MATPC_ODD_ODD_ASYMMETRIC
Definition: enum_quda.h:219
@ QUDA_MATPC_EVEN_EVEN_ASYMMETRIC
Definition: enum_quda.h:218
@ QUDA_MATPC_ODD_ODD
Definition: enum_quda.h:217
@ QUDA_MATPC_EVEN_EVEN
Definition: enum_quda.h:216
@ QUDA_MATPC_INVALID
Definition: enum_quda.h:220
enum QudaMatPCType_s QudaMatPCType
@ QUDA_INVALID_PRECISION
Definition: enum_quda.h:66
enum QudaParity_s QudaParity
void ax(double a, ColorSpinorField &x)
void axpy(double a, ColorSpinorField &x, ColorSpinorField &y)
Definition: blas_quda.h:43
void setDiracSloppyParam(DiracParam &diracParam, QudaInvertParam *inv_param, bool pc)
void createDiracWithRefine(Dirac *&d, Dirac *&dSloppy, Dirac *&dPre, Dirac *&dRef, QudaInvertParam &param, const bool pc_solve)
std::complex< double > Complex
Definition: quda_internal.h:86
qudaStream_t * stream
void setDiracParam(DiracParam &diracParam, QudaInvertParam *inv_param, bool pc)
void gamma5(ColorSpinorField &out, const ColorSpinorField &in)
Applies a gamma5 matrix to a spinor (wrapper to ApplyGamma)
void createDiracWithEig(Dirac *&d, Dirac *&dSloppy, Dirac *&dPre, Dirac *&dRef, QudaInvertParam &param, const bool pc_solve)
void createDirac(Dirac *&d, Dirac *&dSloppy, Dirac *&dPre, QudaInvertParam &param, const bool pc_solve)
::std::string string
Definition: gtest-port.h:891
QudaGaugeParam param
Definition: pack_test.cpp:18
cudaStream_t qudaStream_t
Definition: quda_api.h:9
#define QUDA_MAX_DWF_LS
Maximum length of the Ls dimension for domain-wall fermions.
#define QUDA_MAX_DIM
Maximum number of dimensions supported by QUDA. In practice, no routines make use of more than 5.
#define printfQuda(...)
Definition: util_quda.h:114
#define warningQuda(...)
Definition: util_quda.h:132
#define errorQuda(...)
Definition: util_quda.h:120