16 #ifdef USE_FACTORY_AUTOREGISTER
18 bool init = Projection_Maximum_SU_N::register_factory();
27 const string str_vlevel = params.
get_string(
"verbose_level");
36 err += params.
fetch_int(
"maximum_number_of_iteration", Niter);
37 err += params.
fetch_double(
"convergence_criterion", Enorm);
78 const int Nex = Uorg.
nex();
79 const int Nvol = Uorg.
nvol();
82 assert(Cst.
nex() == Nex);
83 assert(Cst.
nvol() == Nvol);
84 assert(U.
nex() == Nex);
85 assert(U.
nvol() == Nvol);
88 for (
int ex = 0; ex < Nex; ++ex) {
89 u_tmp.setpart_ex(ex, Cst, ex);
90 u_tmp.addpart_ex(ex, Uorg, ex, 1.0 - alpha);
99 const double alpha,
const Field_G& Sigmap,
111 const int Nvol = Cst.
nvol();
112 const int Nex = Cst.
nex();
114 assert(Nvol == G0.
nvol());
115 assert(Nex == G0.
nex());
117 const static int Nmt = 1;
128 for (
int ex = 0; ex < Nex; ++ex) {
129 for (
int site = 0; site < Nvol; ++site) {
134 for (
int iter = 0; iter <
m_Niter; ++iter) {
137 for (
int ex = 0; ex < Nex; ++ex) {
138 for (
int site = 0; site < Nvol; ++site) {
139 Udelta.
set_mat(site, ex, unity);
143 for (
int imt = 0; imt < Nmt; ++imt) {
144 for (
int i1 = 0; i1 < Nc; ++i1) {
145 int i2 = (i1 + 1) % Nc;
163 for (
int ex = 0; ex < Nex; ++ex) {
164 for (
int site = 0; site < Nvol; ++site) {
165 for (
int cc = 0; cc < Nc; ++cc) {
166 retr1 += Udelta.
cmp_r(cc * (1 + Nc), site, ex);
173 double deltaV = 1.0 - retr / (Nc * Nvol * Nex * Npe);
177 for (
int ex = 0; ex < Nex; ++ex) {
178 for (
int site = 0; site < Nvol; ++site) {
202 const int Nvol = A.
nvol();
203 const int Nex = A.
nex();
208 const int j1 =
mindex(i1, i1, Nc);
209 const int j2 =
mindex(i2, i2, Nc);
210 const int k1 =
mindex(i1, i2, Nc);
211 const int k2 =
mindex(i2, i1, Nc);
218 for (
int ex = 0; ex < Nex; ++ex) {
219 for (
int site = 0; site < Nvol; ++site) {
221 at = A.
mat(site, ex);
224 at.
r(j1) * at.
r(j1) + at.
i(j1) * at.
i(j1) + 2.0 * at.
r(j1) * at.
r(j2)
225 + at.
r(k1) * at.
r(k1) + at.
i(k1) * at.
i(k1) - 2.0 * at.
i(j1) * at.
i(j2)
226 + at.
r(k2) * at.
r(k2) + at.
i(k2) * at.
i(k2) - 2.0 * at.
r(k1) * at.
r(k2)
227 + at.
r(j2) * at.
r(j2) + at.
i(j2) * at.
i(j2) + 2.0 * at.
i(k1) * at.
i(k2);
228 xlamd = 1.0 / sqrt(xlamd);
232 vt.
set(j1, (at.
r(j1) + at.
r(j2)) * xlamd, (-at.
i(j1) + at.
i(j2)) * xlamd);
233 vt.
set(k1, (at.
r(k2) - at.
r(k1)) * xlamd, (-at.
i(k2) - at.
i(k1)) * xlamd);
234 vt.
set(k2, (at.
r(k1) - at.
r(k2)) * xlamd, (-at.
i(k1) - at.
i(k2)) * xlamd);
235 vt.
set(j2, (at.
r(j1) + at.
r(j2)) * xlamd, (at.
i(j1) - at.
i(j2)) * xlamd);
242 for (
int ex = 0; ex < Nex; ++ex) {
247 for (
int ex = 0; ex < Nex; ++ex) {
252 for (
int ex = 0; ex < Nex; ++ex) {
void detailed(const char *format,...)
void maxTr(Field_G &U, const Field_G &V)
void general(const char *format,...)
void set_parameters(const Parameters ¶ms)
int fetch_double(const string &key, double &value) const
double m_Enorm
convergence criterion of maximization
int mindex(const int i, const int j, const int Nc)
void force_recursive(Field_G &Xi, Field_G &iTheta, const double alpha, const Field_G &Sigmap, const Field_G &C, const Field_G &U)
force calculation: invalid in this class.
int fetch_int(const string &key, int &value) const
void project(Field_G &U, const 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 maxTr_SU2(const int, const int, Field_G &, Field_G &, Field_G &)
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,...)
static const std::string class_name
static int size()
size of small world.
int non_zero(const double v)
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...
double cmp_r(const int cc, const int site, const int mn=0) const
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