Bridge++  Ver. 2.0.2
aindex_coarse_lex.h
Go to the documentation of this file.
1 
10 #ifndef AINDEX_COARSE_LEX_QXS_H
11 #define AINDEX_COARSE_LEX_QXS_H
12 
15 #include "lib/IO/bridgeIO.h"
16 using Bridge::vout;
17 
18 // uses the same indexing as the fine lattice
20 
21 template<typename REALTYPE>
22 class AIndex_coarse_lex<REALTYPE, QXS> {
23  protected:
24  int m_Nc, m_Nd, m_Nin, m_Nin2, m_Ncol;
25  int m_Nx, m_Ny, m_Nz, m_Nt, m_Nvol;
26  int m_Nxv, m_Nyv, m_Nzt, m_Nstv;
27 
28  private:
29  AIndex_coarse_lex(); // coare lattice size is always needed
30 
31  public:
32  AIndex_coarse_lex(const int Nx, const int Ny, const int Nz, const int Nt, const int Nc, const int Nd)
33  {
34  m_Nx = Nx;
35  m_Ny = Ny;
36  m_Nz = Nz;
37  m_Nt = Nt;
38  m_Nc = Nc; // "color"
39  m_Nd = Nd; // "spin"
40  m_Ncol = Nc * Nd;
41  m_Nin = 2 * Nc * Nd; // "color" x "spin" x "complex"
42  m_Nin2 = 2 * m_Ncol * m_Ncol;
43  m_Nvol = m_Nx * m_Ny * m_Nz * m_Nt;
44  // m_Nxv = Index_lex_alt_qxs::set_Nxv<REALTYPE>(m_Nx);
45  // m_Nyv = Index_lex_alt_qxs::set_Nyv<REALTYPE>(m_Ny);
46  m_Nxv = AIndex_lex_qxs::set_Nxv<REALTYPE>(m_Nx);
47  m_Nyv = AIndex_lex_qxs::set_Nyv<REALTYPE>(m_Ny);
48  m_Nzt = m_Nz * m_Nt;
49  m_Nstv = m_Nxv * m_Nyv * m_Nzt;
50  }
51 
52  int site(const int x, const int y, const int z, const int t) const
53  { return x + m_Nx * (y + m_Ny * (z + m_Nz * t)); }
54 
55  int idx(const int in, const int Nin, const int ist, const int ex) const
56  {
57  //return Index_lex_alt_qxs::idx<REALTYPE>(in, Nin, ist, m_Nx, m_Ny,
58  return AIndex_lex_qxs::idx<REALTYPE>(in, Nin, ist, m_Nx, m_Ny,
59  m_Nxv, m_Nyv, m_Nstv, ex);
60  }
61 
62  int idx_G(const int idf, const int ist, const int ex) const
63  { return idx(idf, m_Nin2, ist, ex); }
64 
65  int idx_Gr(const int ic1, const int ic2, const int ist, const int ex) const
66  {
67  int idf = 2 * (ic2 + m_Ncol * ic1);
68  return idx_G(idf, ist, ex);
69  }
70 
71  int idx_Gi(const int ic1, const int ic2, const int ist, const int ex) const
72  {
73  int idf = 1 + 2 * (ic2 + m_Ncol * ic1);
74  return idx_G(idf, ist, ex);
75  }
76 
77  int idx_SP(const int in, const int ist, const int ex) const
78  { return idx(in, m_Nin, ist, ex); }
79 
80  int idx_SPr(const int ic, const int id, const int ist, const int ex) const
81  {
82  int in = 2 * (id + m_Nd * ic);
83  return idx_SP(in, ist, ex);
84  }
85 
86  int idx_SPi(const int ic, const int id, const int ist, const int ex) const
87  {
88  int in = 1 + 2 * (id + m_Nd * ic);
89  return idx_SP(in, ist, ex);
90  }
91 
92  /*
93  int idx(const int in, const int Nin, const int ist, const int ex) const
94  {
95  return in+ Nin*ist + Nin*m_Nvol*ex;
96  }
97 
98  int idx_SPr(const int ic, const int id, const int ist, const int ex) const
99  {
100  int in=2*(id+m_Nd*ic);
101  return in + m_Nin*ist + m_Nin*m_Nvol*ex;
102  }
103 
104  int idx_SPi(const int ic, const int id, const int ist, const int ex) const
105  {
106  int in=2*(id+m_Nd*ic)+1;
107  return in + m_Nin*ist + m_Nin*m_Nvol*ex;
108  }
109  */
110 };
111 
112 #endif
bridgeIO.h
AIndex_coarse_lex< REALTYPE, QXS >::idx
int idx(const int in, const int Nin, const int ist, const int ex) const
Definition: aindex_coarse_lex.h:55
AIndex_coarse_lex
Definition: aindex_coarse_lex_base.h:17
AIndex_coarse_lex< REALTYPE, QXS >::site
int site(const int x, const int y, const int z, const int t) const
Definition: aindex_coarse_lex.h:52
AIndex_coarse_lex< REALTYPE, QXS >::idx_SP
int idx_SP(const int in, const int ist, const int ex) const
Definition: aindex_coarse_lex.h:77
aindex_lex.h
aindex_coarse_lex_base.h
AIndex_eo_qxs::idx
int idx(const int in, const int Nin, const int ist, const int Nx2, const int Ny, const int leo, const int Nvol2, const int ex)
Definition: aindex_eo.h:27
AIndex_coarse_lex< REALTYPE, QXS >::idx_SPi
int idx_SPi(const int ic, const int id, const int ist, const int ex) const
Definition: aindex_coarse_lex.h:86
AIndex_coarse_lex< REALTYPE, QXS >::m_Nz
int m_Nz
Definition: aindex_coarse_lex.h:25
AIndex_coarse_lex< REALTYPE, QXS >::idx_G
int idx_G(const int idf, const int ist, const int ex) const
Definition: aindex_coarse_lex.h:62
QXS
@ QXS
Definition: alt_impl.h:15
AIndex_coarse_lex< REALTYPE, QXS >::idx_SPr
int idx_SPr(const int ic, const int id, const int ist, const int ex) const
Definition: aindex_coarse_lex.h:80
AIndex_coarse_lex< REALTYPE, QXS >::m_Nzt
int m_Nzt
Definition: aindex_coarse_lex.h:26
commonParameters.h
AIndex_coarse_lex< REALTYPE, QXS >::idx_Gr
int idx_Gr(const int ic1, const int ic2, const int ist, const int ex) const
Definition: aindex_coarse_lex.h:65
AIndex_coarse_lex< REALTYPE, QXS >::m_Nin2
int m_Nin2
Definition: aindex_coarse_lex.h:24
AIndex_coarse_lex< REALTYPE, QXS >::idx_Gi
int idx_Gi(const int ic1, const int ic2, const int ist, const int ex) const
Definition: aindex_coarse_lex.h:71
AIndex_coarse_lex< REALTYPE, QXS >::AIndex_coarse_lex
AIndex_coarse_lex(const int Nx, const int Ny, const int Nz, const int Nt, const int Nc, const int Nd)
Definition: aindex_coarse_lex.h:32
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512