25 bool init = Projection::Factory::Register(
"Maximum_SU_N", create_object);
36 const string str_vlevel = params.
get_string(
"verbose_level");
45 err += params.
fetch_int(
"maximum_number_of_iteration", Niter);
46 err += params.
fetch_double(
"convergence_criterion", Enorm);
88 int Nvol = Uorg.
nvol();
91 assert(Cst.
nex() == Nex);
92 assert(Cst.
nvol() == Nvol);
93 assert(U.
nex() == Nex);
94 assert(U.
nvol() == Nvol);
97 for (
int ex = 0; ex < Nex; ++ex) {
98 u_tmp.setpart_ex(ex, Cst, ex);
99 u_tmp.addpart_ex(ex, Uorg, ex, 1.0 - alpha);
108 double alpha,
const Field_G& Sigmap,
120 int Nvol = Cst.
nvol();
123 assert(Nvol == G0.
nvol());
124 assert(Nex == G0.
nex());
132 Field_G Udelta(Nvol, Nex), A(Nvol, Nex);
137 for (
int ex = 0; ex < Nex; ++ex) {
138 for (
int site = 0; site < Nvol; ++site) {
143 for (
int iter = 0; iter <
m_Niter; ++iter) {
144 for (
int ex = 0; ex < Nex; ++ex) {
145 for (
int site = 0; site < Nvol; ++site) {
146 Udelta.set_mat(site, ex, unity);
150 for (
int imt = 0; imt < Nmt; ++imt) {
151 for (
int i1 = 0; i1 < Nc; ++i1) {
152 int i2 = (i1 + 1) % Nc;
170 for (
int ex = 0; ex < Nex; ++ex) {
171 for (
int site = 0; site < Nvol; ++site) {
172 for (
int cc = 0; cc < Nc; ++cc) {
173 retr1 += Udelta.cmp_r(cc * (1 + Nc), site, ex);
180 double deltaV = 1.0 - retr / (Nc * Nvol * Nex * Npe);
185 for (
int ex = 0; ex < Nex; ++ex) {
186 for (
int site = 0; site < Nvol; ++site) {
215 int j1 =
mindex(i1, i1, Nc);
216 int j2 =
mindex(i2, i2, Nc);
217 int k1 =
mindex(i1, i2, Nc);
218 int k2 =
mindex(i2, i1, Nc);
221 Field_G v(Nvol, Nex), w(Nvol, Nex);
227 for (
int ex = 0; ex < Nex; ++ex) {
228 for (
int site = 0; site < Nvol; ++site) {
229 at = A.
mat(site, ex);
232 at.
r(j1) * at.r(j1) + at.i(j1) * at.i(j1) + 2.0 * at.r(j1) * at.r(j2)
233 + at.r(k1) * at.r(k1) + at.i(k1) * at.i(k1) - 2.0 * at.i(j1) * at.i(j2)
234 + at.r(k2) * at.r(k2) + at.i(k2) * at.i(k2) - 2.0 * at.r(k1) * at.r(k2)
235 + at.r(j2) * at.r(j2) + at.i(j2) * at.i(j2) + 2.0 * at.i(k1) * at.i(k2);
236 xlamd = 1.0 / sqrt(xlamd);
239 vt.
set(j1, (at.r(j1) + at.r(j2)) * xlamd, (-at.i(j1) + at.i(j2)) * xlamd);
240 vt.
set(k1, (at.r(k2) - at.r(k1)) * xlamd, (-at.i(k2) - at.i(k1)) * xlamd);
241 vt.
set(k2, (at.r(k1) - at.r(k2)) * xlamd, (-at.i(k1) - at.i(k2)) * xlamd);
242 vt.
set(j2, (at.r(j1) + at.r(j2)) * xlamd, (at.i(j1) - at.i(j2)) * xlamd);
244 v.set_mat(site, ex, vt);
248 for (
int ex = 0; ex < Nex; ++ex) {
253 for (
int ex = 0; ex < Nex; ++ex) {
258 for (
int ex = 0; ex < Nex; ++ex) {
void detailed(const char *format,...)
void general(const char *format,...)
void set_parameters(const Parameters ¶ms)
int fetch_double(const string &key, double &value) const
void maxTr(Field_G &U, Field_G &V)
double m_Enorm
convergence criterion of maximization
Maximum projection to SU(N) gauge group.
int fetch_int(const string &key, int &value) const
void project(Field_G &U, double alpha, const Field_G &C, const Field_G &Uorg)
projection U = P[alpha, C, Uorg]
int m_Niter
maximum iteration of maximization steps
void mult_Field_Gnn(Field_G &W, const int ex, const Field_G &U1, const int ex1, const Field_G &U2, const int ex2)
void crucial(const char *format,...)
base class for projection operator into gauge group.
static const std::string class_name
static int size()
size of small world.
void maxTr_SU2(int, int, Field_G &, Field_G &, Field_G &)
int mindex(int i, int j, int Nc)
int non_zero(const double v)
void force_recursive(Field_G &Xi, Field_G &iTheta, double alpha, const Field_G &Sigmap, const Field_G &C, const Field_G &U)
force calculation: invalid in this class.
Mat_SU_N mat_dag(const int site, const int mn=0) const
int non_negative(const int v)
static int reduce_sum(int count, double *recv_buf, double *send_buf, int pattern=0)
make a global sum of an array of double over the communicator. pattern specifies the dimensions to be...
void set(int c, double re, const double &im)
string get_string(const string &key) const
void set_mat(const int site, const int mn, const Mat_SU_N &U)
Mat_SU_N mat(const int site, const int mn=0) const
static VerboseLevel set_verbose_level(const std::string &str)
Bridge::VerboseLevel m_vl