Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
tensorProd.cpp
Go to the documentation of this file.
1 
15 #include <cassert>
16 
17 //====================================================================
18 void tensorProd_Field_F(Field_G& u, const Field_F& v1, const Field_F& v2)
19 {
20  return tensorProd_Field_F(u, 0, v1, v2);
21 }
22 
23 
24 //====================================================================
25 void tensorProd_Field_F(Field_G& u, const int ex, const Field_F& v1, const Field_F& v2)
26 {
27  const int Nvol = u.nvol();
28  const int Nc = CommonParameters::Nc();
29  const int Nd = CommonParameters::Nd();
30 
31  assert(u.nvol() == v1.nvol());
32  assert(u.nvol() == v2.nvol());
33  assert(ex < u.nex());
34  assert(v1.nex() == 1);
35  assert(v2.nex() == 1);
36 
37  Mat_SU_N ut(v1.nc());
38  double ut_r, ut_i;
39 
40  for (int site = 0; site < Nvol; ++site) {
41  for (int c1 = 0; c1 < Nc; ++c1) {
42  for (int c2 = 0; c2 < Nc; ++c2) {
43  ut_r = 0.0;
44  ut_i = 0.0;
45  for (int s = 0; s < Nd; ++s) {
46  ut_r += v1.cmp_r(c2, s, site) * v2.cmp_r(c1, s, site)
47  + v1.cmp_i(c2, s, site) * v2.cmp_i(c1, s, site);
48  ut_i += v1.cmp_r(c2, s, site) * v2.cmp_i(c1, s, site)
49  - v1.cmp_i(c2, s, site) * v2.cmp_r(c1, s, site);
50  }
51  ut.set(c1, c2, ut_r, ut_i);
52  }
53  }
54  u.set_mat(site, ex, ut);
55  }
56 }
57 
58 
59 //====================================================================
60 //============================================================END=====
double cmp_i(const int cc, const int s, const int site, const int e=0) const
Definition: field_F.h:100
int nvol() const
Definition: field.h:127
Wilson-type fermion field.
Definition: field_F.h:37
SU(N) gauge field.
Definition: field_G.h:38
int nex() const
Definition: field.h:128
void tensorProd_Field_F(Field_G &u, const Field_F &v1, const Field_F &v2)
Definition: tensorProd.cpp:32
int nc() const
Definition: field_F.h:89
void set_mat(const int site, const int mn, const Mat_SU_N &U)
Definition: field_G.h:160
double cmp_r(const int cc, const int s, const int site, const int e=0) const
Definition: field_F.h:94