1#ifndef REPRESENTATIONS_H_
2#define REPRESENTATIONS_H_
23template <
int N,
typename radix>
30 using argument_type = radix;
35 constexpr static int size = N * N - 1;
47 template <typename scalart, std::enable_if_t<hila::is_arithmetic<scalart>::value,
int> = 0>
51 template <typename scalart, std::enable_if_t<hila::is_arithmetic<scalart>::value,
int> = 0>
61 static bool initialize =
true;
64 for (
int g = 0; g <
size; g++) {
66 sun tg = sun::generator(g);
67 for (
int j = 0; j <
size; j++) {
69 for (
int k = 0; k <
size; k++) {
73 r_generators[g].
e(j, k) = 2 * (tr1.im - tr2.im);
78 return r_generators[i];
83 for (
int i = 0; i <
size; i++)
84 for (
int j = 0; j <
size; j++) {
95 for (
int g = 0; g <
size; g++) {
98 fforce += C * sun::generator(g);
101 fforce = fforce * ct;
102 project_antihermitean(fforce);
125template <
int N,
typename radix>
130 using argument_type = radix;
135 constexpr static int size = N * (N - 1) / 2;
146 template <typename scalart, std::enable_if_t<hila::is_arithmetic<scalart>::value,
int> = 0>
150 template <typename scalart, std::enable_if_t<hila::is_arithmetic<scalart>::value,
int> = 0>
152 for (
int j = 0; j <
size; j++)
153 for (
int i = 0; i <
size; i++) {
154 this->
e(i, j) = m.
e(i, j);
162 template <typename scalart, std::enable_if_t<hila::is_arithmetic<scalart>::value,
int> = 0>
164 for (
int j = 0; j <
size; j++)
165 for (
int i = 0; i <
size; i++) {
166 this->
e(i, j) = m.
e(i, j);
173 static bool initialize =
true;
176 for (
int g = 0; g <
size; g++) {
179 for (
int m1 = 0; m1 < N; m1++)
180 for (
int m2 = m1 + 1; m2 < N; m2++) {
182 generators[g].
e(m1, m2).re = 0.5;
183 generators[g].
e(m2, m1).re = -0.5;
189 return generators[ng];
194 static bool initialize =
true;
197 for (
int g = 0; g <
size; g++) {
199 sun tg = sun::generator(g);
200 for (
int j = 0; j < N * (N - 1) / 2; j++) {
202 for (
int k = 0; k < N * (N - 1) / 2; k++) {
211 return r_generators[i];
216 for (
int i = 0; i <
size; i++)
217 for (
int j = 0; j <
size; j++) {
229 for (
int g = 0; g <
size; g++) {
232 fforce += C * sun::generator(g);
235 fforce = fforce * ct;
236 project_antihermitean(fforce);
259template <
int N,
typename radix>
264 using argument_type = radix;
274 constexpr static int size = N * (N + 1) / 2;
280 template <typename scalart, std::enable_if_t<hila::is_arithmetic<scalart>::value,
int> = 0>
282 for (
int j = 0; j <
size; j++) {
283 for (
int i = 0; i <
size; i++) {
291 template <typename scalart, std::enable_if_t<hila::is_arithmetic<scalart>::value,
int> = 0>
293 for (
int j = 0; j <
size; j++)
294 for (
int i = 0; i <
size; i++) {
295 this->
e(i, j) = m.
e(i, j);
300 template <typename scalart, std::enable_if_t<hila::is_arithmetic<scalart>::value,
int> = 0>
302 for (
int j = 0; j <
size; j++)
303 for (
int i = 0; i <
size; i++) {
304 this->
e(i, j) = m.
e(i, j);
311 static bool initialize =
true;
314 for (
int g = 0; g <
size; g++) {
317 generators[g].
e(g, g).re =
sqrt(0.5);
320 for (
int m1 = 0; m1 < N; m1++)
321 for (
int m2 = m1 + 1; m2 < N; m2++) {
323 generators[g].
e(m1, m2).re = 0.5;
324 generators[g].
e(m2, m1).re = 0.5;
330 return generators[ng];
335 static bool initialize =
true;
338 for (
int g = 0; g <
size; g++) {
340 sun tg = sun::generator(g);
341 for (
int j = 0; j < N * (N + 1) / 2; j++) {
343 for (
int k = 0; k < N * (N + 1) / 2; k++) {
352 return r_generators[i];
357 for (
int i = 0; i <
size; i++)
358 for (
int j = 0; j <
size; j++) {
369 for (
int g = 0; g <
size; g++) {
371 radix C = (rg * rforce).
trace().re;
372 fforce += C * sun::generator(g);
375 fforce = fforce * ct;
376 project_antihermitean(fforce);
Array< n, m, T > sqrt(Array< n, m, T > a)
Square root.
T trace() const
Computes Trace for Matrix.
T c[n *m]
The data as a one dimensional array.
T e(const int i, const int j) const
Standard array indexing operation for matrices and vectors.
Rtype transpose() const
Transpose of matrix.
Rtype adjoint() const
Adjoint of matrix.
Matrix class which defines matrix operations.
static sun generator(int i)
Info on group generators.
adjointRep(const adjointRep< N, scalart > m)
Copy constructor.
adjointRep(const adjointRep &a)=default
std ops required for triviality
~adjointRep()=default
std ops required for triviality
adjointRep(const scalart m)
Use square matrix constructor from radix.
static constexpr int size
Matrix size.
hila::arithmetic_type< radix > base_type
The underlying arithmetic type of the matrix.
void represent(sun &m)
Project a matrix into the adjoint representation.
adjointRep()=default
std ops required for triviality
adjointRep(const SquareMatrix< size, radix > m)
Automatic conversion from SquareMatrix is needed!
static SquareMatrix< N, Complex< radix > > project_force(SquareMatrix< size, Complex< radix > > rforce)
static adjointRep represented_generator_I(int i)
antisymmetric(const antisymmetric< N, scalart > m)
Copy constructor.
static SquareMatrix< N, Complex< radix > > project_force(SquareMatrix< size, Complex< radix > > rforce)
antisymmetric()=default
default constructor
static sun generator(int ng)
The antisymmetric generator.
void represent(sun &m)
Project a matrix into the antisymmetric representation.
static antisymmetric represented_generator_I(int i)
Return a SU(N) generator (times I) in the antisymmetric representation.
static constexpr int size
Matrix size.
hila::arithmetic_type< radix > base_type
The underlying arithmetic type of the matrix.
antisymmetric(const scalart m)
Square matrix constructor from scalar.
antisymmetric & operator=(const antisymmetric< N, scalart > m)
Needs assignment as well.
antisymmetric(const SquareMatrix< size, Complex< radix > > m)
automatic conversion from SquareMatrix – needed for methods!
static constexpr int size
Matrix size.
symmetric & operator=(const symmetric< N, scalart > m)
Needs assignment as well.
symmetric(const scalart m)
Constructor from scalar.
static sun generator(int ng)
Symmetric generators as SU(N) matrices.
symmetric(const symmetric< N, scalart > m)
Constructor from a symmetric matrix.
symmetric()=default
Use default constructor.
hila::arithmetic_type< radix > base_type
The underlying arithmetic type of the matrix.
static SquareMatrix< N, Complex< radix > > project_force(SquareMatrix< size, Complex< radix > > rforce)
void represent(sun &m)
Project a matrix into the symmetric representation.
static symmetric represented_generator_I(int i)
Return a symmetric generators (times I) in the symmetric representation.
Matrix< n, n, T > SquareMatrix
Square matrix is defined as alias with special case of Matrix<n,n,T>