18template <
typename T,
int N>
25 for (
int ina = 0; ina < N - 1; ina++)
26 for (
int inb = ina + 1; inb < N; inb++) {
33 a = project_from_matrix(action, ina, inb);
44 auto r = a.d * a.d - a.a * a.a - a.b * a.b - a.c * a.c;
52 u = a.convert_to_2x2_matrix();
101#define USE_deForcrandJahn
103template <
typename T,
int N,
typename Btype>
107 auto phiN = S.
det().arg() / N;
109#ifdef USE_deForcrandJahn
112 double smin = svdS.singularvalues.e(0);
113 for (
int i = 1; i < N; i++) {
114 if (svdS.singularvalues.e(i) < smin) {
115 smin = svdS.singularvalues.e(i);
122 for (
int i = 0; i < N; i++) {
124 diag.e(j++) = svdS.singularvalues.e(i);
129 (
tan(phiN) * (diag - smin).asVector());
134 for (
int i = 0; i < N; i++) {
136 P.
e(i) =
expi(diag.e(j++) - phiN);
138 P.
e(imin) =
expi(-trace(diag) - phiN);
147 auto Z = svdS.U * P * svdS.V.
dagger();
Array< n, m, T > exp(Array< n, m, T > a)
Exponential.
Array< n, m, T > tan(Array< n, m, T > a)
Tangent.
Array< n, m, hila::arithmetic_type< T > > real(const Array< n, m, T > &arg)
Return real part of Array.
Define type DiagonalMatrix<n,T>
T e(const int i) const
Element access - e(i) gives diagonal element i.
DiagonalMatrix dagger() const
dagger - conjugate elements
void mult_by_2x2_left(int p, int q, const Matrix_t< 2, 2, R, Mt > &M)
Multiply -matrix from the left by matrix defined by sub matrix.
T det() const
determinant function - if matrix size is < 5, use Laplace, otherwise LU
Rtype dagger() const
Hermitian conjugate of matrix.
int svd(Matrix_t< n, n, Mt, MT > &_U, DiagonalMatrix< n, Et > &_D, Matrix_t< n, n, Mt, MT > &_V, enum hila::sort sorted=hila::sort::unsorted) const
Singular value decomposition: divide matrix A = U S V*, where U,V unitary and S diagonal matrix of re...
SU2< T > & normalize()
Normalize det = 1 to make sure it's an element of SU2.
auto mul_trace(const Mtype1 &a, const Mtype2 &b)
Returns trace of product of two matrices.
auto invert_diagonal_plus_constant_matrix(const DiagonalMatrix< N, T > &D, const C c)
double random()
Real valued uniform random number generator.
SU(N) Matrix definitions.
void suN_overrelax(SU< N, T > &U, const SU< N, T > &staple)
Overrelaxation using SU(2) subgroups