Go to the documentation of this file.
15 #ifndef MAT_SU_N_INCLUDED
16 #define MAT_SU_N_INCLUDED
39 std::valarray<double>
va;
54 }
else if (
m_Nc == 2) {
115 double r(
int c)
const {
return va[2 *
c]; }
116 double i(
int c)
const {
return va[2 *
c + 1]; }
117 dcomplex
c(
int c)
const {
return cmplx(
va[2 *
c],
va[2 *
c + 1]); }
119 double r(
int c1,
int c2)
const {
return r(
m_Nc * c1 + c2); }
120 double i(
int c1,
int c2)
const {
return i(
m_Nc * c1 + c2); }
121 dcomplex
c(
int c1,
int c2)
const {
return c(
m_Nc * c1 + c2); }
124 void set_i(
int c,
const double& im) {
va[2 *
c + 1] = im; }
125 void set_c(
int c,
const dcomplex& z) {
va[2 *
c] = real(z);
va[2 *
c + 1] = imag(z); }
127 void set_r(
int c1,
int c2,
const double& re)
132 void set_i(
int c1,
int c2,
const double& im)
137 void set(
int c,
const double& re,
const double& im)
143 void set(
int c1,
int c2,
const double& re,
const double& im)
148 void set(
int c,
const dcomplex& z)
151 va[2 *
c + 1] = imag(z);
154 void set(
int c1,
int c2,
const dcomplex& z)
159 void add(
int c,
const double& re,
const double& im)
165 void add(
int c1,
int c2,
const double& re,
const double& im)
170 void add(
int c,
const dcomplex& z)
172 va[2 *
c] += real(z);
173 va[2 *
c + 1] += imag(z);
176 void add(
int c1,
int c2,
const dcomplex& z)
191 for (
int a = 0; a <
m_Nc; ++a) {
192 for (
int b = 0; b <
m_Nc; ++b) {
193 va[2 * (b +
m_Nc * a)] = 0.0;
194 va[2 * (b +
m_Nc * a) + 1] = 0.0;
195 for (
int c = 0;
c <
m_Nc; ++
c) {
199 va[2 * (b +
m_Nc * a) + 1] +=
209 for (
int a = 0; a <
m_Nc; ++a) {
210 for (
int b = 0; b <
m_Nc; ++b) {
211 for (
int c = 0;
c <
m_Nc; ++
c) {
215 va[2 * (b +
m_Nc * a) + 1] +=
225 for (
int a = 0; a <
m_Nc; ++a) {
226 for (
int b = 0; b <
m_Nc; ++b) {
227 va[2 * (b +
m_Nc * a)] = 0.0;
228 va[2 * (b +
m_Nc * a) + 1] = 0.0;
229 for (
int c = 0;
c <
m_Nc; ++
c) {
233 va[2 * (b +
m_Nc * a) + 1] +=
243 for (
int a = 0; a <
m_Nc; ++a) {
244 for (
int b = 0; b <
m_Nc; ++b) {
245 for (
int c = 0;
c <
m_Nc; ++
c) {
249 va[2 * (b +
m_Nc * a) + 1] +=
259 for (
int a = 0; a <
m_Nc; ++a) {
260 for (
int b = 0; b <
m_Nc; ++b) {
261 va[2 * (b +
m_Nc * a)] = 0.0;
262 va[2 * (b +
m_Nc * a) + 1] = 0.0;
263 for (
int c = 0;
c <
m_Nc; ++
c) {
267 va[2 * (b +
m_Nc * a) + 1] -=
277 for (
int a = 0; a <
m_Nc; ++a) {
278 for (
int b = 0; b <
m_Nc; ++b) {
279 for (
int c = 0;
c <
m_Nc; ++
c) {
283 va[2 * (b +
m_Nc * a) + 1] -=
293 for (
int cc = 0; cc <
m_Nc *
m_Nc; ++cc) {
294 va[2 * cc] = re * v.
va[2 * cc] - im * v.
va[2 * cc + 1];
295 va[2 * cc + 1] = re * v.
va[2 * cc + 1] + im * v.
va[2 * cc];
301 const double re = real(z);
302 const double im = imag(z);
303 for (
int cc = 0; cc <
m_Nc *
m_Nc; ++cc) {
304 va[2 * cc] = re * v.
va[2 * cc] - im * v.
va[2 * cc + 1];
305 va[2 * cc + 1] = re * v.
va[2 * cc + 1] + im * v.
va[2 * cc];
311 for (
int cc = 0; cc <
m_Nc *
m_Nc; ++cc) {
312 va[2 * cc] += re * v.
va[2 * cc] - im * v.
va[2 * cc + 1];
313 va[2 * cc + 1] += re * v.
va[2 * cc + 1] + im * v.
va[2 * cc];
319 const double re = real(z);
320 const double im = imag(z);
321 for (
int cc = 0; cc <
m_Nc *
m_Nc; ++cc) {
322 va[2 * cc] += re * v.
va[2 * cc] - im * v.
va[2 * cc + 1];
323 va[2 * cc + 1] += re * v.
va[2 * cc + 1] + im * v.
va[2 * cc];
331 for (
int a = 0; a <
m_Nc; ++a) {
332 for (
int b = a; b <
m_Nc; ++b) {
333 double re =
va[2 * (
m_Nc * a + b)];
334 double im =
va[2 * (
m_Nc * a + b) + 1];
337 va[2 * (
m_Nc * a + b) + 1] = -
va[2 * (
m_Nc * b + a) + 1];
339 va[2 * (
m_Nc * b + a)] = re;
340 va[2 * (
m_Nc * b + a) + 1] = -im;
349 for (
int a = 0; a <
m_Nc; ++a) {
350 for (
int b = a + 1; b <
m_Nc; ++b) {
351 double re =
va[2 * (
m_Nc * a + b)] +
va[2 * (
m_Nc * b + a)];
352 double im =
va[2 * (
m_Nc * a + b) + 1] -
va[2 * (
m_Nc * b + a) + 1];
354 va[2 * (
m_Nc * a + b)] = 0.5 * re;
355 va[2 * (
m_Nc * a + b) + 1] = 0.5 * im;
357 va[2 * (
m_Nc * b + a)] = 0.5 * re;
358 va[2 * (
m_Nc * b + a) + 1] = -0.5 * im;
362 for (
int cc = 0; cc <
m_Nc; ++cc) {
363 tr +=
va[2 * (
m_Nc * cc + cc)];
366 for (
int cc = 0; cc <
m_Nc; ++cc) {
367 va[2 * (
m_Nc * cc + cc)] -= tr;
368 va[2 * (
m_Nc * cc + cc) + 1] = 0.0;
377 for (
int a = 0; a <
m_Nc; ++a) {
378 for (
int b = a + 1; b <
m_Nc; ++b) {
379 double re =
va[2 * (
m_Nc * a + b)] -
va[2 * (
m_Nc * b + a)];
380 double im =
va[2 * (
m_Nc * a + b) + 1] +
va[2 * (
m_Nc * b + a) + 1];
382 va[2 * (
m_Nc * a + b)] = 0.5 * re;
383 va[2 * (
m_Nc * a + b) + 1] = 0.5 * im;
385 va[2 * (
m_Nc * b + a)] = -0.5 * re;
386 va[2 * (
m_Nc * b + a) + 1] = 0.5 * im;
390 for (
int cc = 0; cc <
m_Nc; ++cc) {
391 tr +=
va[2 * (
m_Nc * cc + cc) + 1];
394 for (
int cc = 0; cc <
m_Nc; ++cc) {
395 va[2 * (
m_Nc * cc + cc)] = 0.0;
396 va[2 * (
m_Nc * cc + cc) + 1] -= tr;
405 for (
int a = 0; a <
m_Nc; ++a) {
406 for (
int b = a; b <
m_Nc; ++b) {
407 double re =
va[2 * (
m_Nc * a + b)] -
va[2 * (
m_Nc * b + a)];
408 double im =
va[2 * (
m_Nc * a + b) + 1] +
va[2 * (
m_Nc * b + a) + 1];
409 va[2 * (
m_Nc * a + b)] = 0.5 * re;
410 va[2 * (
m_Nc * a + b) + 1] = 0.5 * im;
411 va[2 * (
m_Nc * b + a)] = -0.5 * re;
412 va[2 * (
m_Nc * b + a) + 1] = 0.5 * im;
422 for (
int c = 0;
c <
m_Nc; ++
c) {
438 for (
int c = 0;
c <
va.size() / 2; ++
c) {
439 double tmp =
va[2 *
c];
440 va[2 *
c] = -
va[2 *
c + 1];
491 std::valarray<double> tmp(2 *
m_Nc *
m_Nc);
493 for (
int a = 0; a <
m_Nc; ++a) {
494 for (
int b = 0; b <
m_Nc; ++b) {
495 tmp[2 * (
m_Nc * a + b)] = 0.0;
496 tmp[2 * (
m_Nc * a + b) + 1] = 0.0;
497 for (
int c = 0;
c <
m_Nc; ++
c) {
500 tmp[2 * (
m_Nc * a + b) + 1] +=
va[2 * (
m_Nc * a +
c) + 1] * rhs.
va[2 * (
m_Nc *
c + b)]
539 for (
int c = 0; c < Nc; ++c) {
551 for (
int c = 0; c < Nc; ++c) {
564 for (
int c = 0; c < Nc; ++c) {
568 return cmplx(tr_r, tr_i);
577 for (
int a = 0; a < Nc; a++) {
578 for (
int b = 0; b < Nc; b++) {
579 tmp.
set(a, b, u.
r(b, a), -u.
i(b, a));
591 for (
int c = 0; c < u.
size() / 2; ++c) {
592 tmp.
set(c, -u.
i(c), u.
r(c));
646 for (
int iprec = 0; iprec < Nprec; ++iprec) {
647 double exp_factor = alpha / (Nprec - iprec);
void set_i(int c1, int c2, const double &im)
Mat_SU_N & ah()
antihermitian
double i(int c1, int c2) const
void multadd_dn(const Mat_SU_N &u1, const Mat_SU_N &u2)
void add(int c, const double &re, const double &im)
void zaxpy(dcomplex z, const Mat_SU_N &v)
double ImTr(const Mat_SU_N &m)
std::valarray< double > va
dcomplex c(int c1, int c2) const
Mat_SU_N operator*(const Mat_SU_N &m1, const Mat_SU_N &m2)
Mat_SU_N & operator+=(const Mat_SU_N &)
void set(int c, const dcomplex &z)
Mat_SU_N & operator*=(const Mat_SU_N &)
Base class of random number generators.
void multadd_nn(const Mat_SU_N &u1, const Mat_SU_N &u2)
void add(int c1, int c2, const dcomplex &z)
Mat_SU_N operator-(const Mat_SU_N &m1, const Mat_SU_N &m2)
Mat_SU_N & set_random_SU3(RandomNumbers *)
void set(int c, const double &re, const double &im)
void add(int c1, int c2, const double &re, const double &im)
Mat_SU_N & reunit_general()
Mat_SU_N mat_exp(double alpha, const Mat_SU_N &iv, const Mat_SU_N &u, int Nprec)
void add(int c, const dcomplex &z)
dcomplex Tr(const Mat_SU_N &m)
void zcopy(dcomplex z, const Mat_SU_N &v)
void mult_dn(const Mat_SU_N &u1, const Mat_SU_N &u2)
Mat_SU_N & at()
antihermitian traceless
void mult_nn(const Mat_SU_N &u1, const Mat_SU_N &u2)
void zaxpy(double re, double im, const Mat_SU_N &v)
Mat_SU_N & set_random_SU2(RandomNumbers *)
Mat_SU_N xI(const Mat_SU_N &u)
double r(int c1, int c2) const
void zcopy(double re, double im, const Mat_SU_N &v)
Mat_SU_N & operator=(const double &)
void set_i(int c, const double &im)
Mat_SU_N & set_random(RandomNumbers *rand)
void set_r(int c, const double &re)
Mat_SU_N & set_random_general(RandomNumbers *)
void multadd_nd(const Mat_SU_N &u1, const Mat_SU_N &u2)
Mat_SU_N(int Nc, double r=0.0)
Mat_SU_N reunit(const Mat_SU_N &m)
Mat_SU_N operator+(const Mat_SU_N &m1, const Mat_SU_N &m2)
void set_r(int c1, int c2, const double &re)
void set_c(int c, const dcomplex &z)
void set(int c1, int c2, const double &re, const double &im)
Mat_SU_N dag(const Mat_SU_N &u)
double ReTr(const Mat_SU_N &m)
void mult_nd(const Mat_SU_N &u1, const Mat_SU_N &u2)
Mat_SU_N & operator-=(const Mat_SU_N &)
Mat_SU_N & operator/=(const double &)
Mat_SU_N &(Mat_SU_N::* m_reunit)()
void set(int c1, int c2, const dcomplex &z)
Mat_SU_N &(SU_N::Mat_SU_N::* m_set_random)(RandomNumbers *)
pointer to reunitalization.