16 #ifdef USE_PARAMETERS_FACTORY
28 bool init = Projection::Factory::Register(
"Maximum_SU_N", create_object);
43 #ifdef USE_PARAMETERS_FACTORY
56 const string str_vlevel = params.
get_string(
"verbose_level");
65 err += params.
fetch_int(
"maximum_number_of_iteration", Niter);
66 err += params.
fetch_double(
"convergence_criterion", Enorm);
69 vout.
crucial(
m_vl,
"Projection_Maximum_SU_N: fetch error, input parameter not found.\n");
92 vout.
crucial(
m_vl,
"Projection_Maximum_SU_N: parameter range check failed.\n");
107 int Nex = Uorg.
nex();
108 int Nvol = Uorg.
nvol();
111 assert(Cst.
nex() == Nex);
112 assert(Cst.
nvol() == Nvol);
113 assert(U.
nex() == Nex);
114 assert(U.
nvol() == Nvol);
117 for (
int ex = 0; ex < Nex; ++ex) {
118 u_tmp.setpart_ex(ex, Cst, ex);
119 u_tmp.addpart_ex(ex, Uorg, ex, 1.0 - alpha);
128 double alpha,
const Field_G& Sigmap,
131 vout.
crucial(
m_vl,
"Projection_Maximum_SU_N: force_recursive() is not available.\n");
140 int Nvol = Cst.
nvol();
143 assert(Nvol == G0.
nvol());
144 assert(Nex == G0.
nex());
152 Field_G Udelta(Nvol, Nex), A(Nvol, Nex);
157 for (
int ex = 0; ex < Nex; ++ex) {
158 for (
int site = 0; site < Nvol; ++site) {
163 for (
int iter = 0; iter <
m_Niter; ++iter) {
164 for (
int ex = 0; ex < Nex; ++ex) {
165 for (
int site = 0; site < Nvol; ++site) {
166 Udelta.set_mat(site, ex, unity);
170 for (
int imt = 0; imt < Nmt; ++imt) {
171 for (
int i1 = 0; i1 < Nc; ++i1) {
172 int i2 = (i1 + 1) % Nc;
190 for (
int ex = 0; ex < Nex; ++ex) {
191 for (
int site = 0; site < Nvol; ++site) {
192 for (
int cc = 0; cc < Nc; ++cc) {
193 retr1 += Udelta.cmp_r(cc * (1 + Nc), site, ex);
200 double deltaV = 1.0 - retr / (Nc * Nvol * Nex * Npe);
205 for (
int ex = 0; ex < Nex; ++ex) {
206 for (
int site = 0; site < Nvol; ++site) {
235 int j1 =
mindex(i1, i1, Nc);
236 int j2 =
mindex(i2, i2, Nc);
237 int k1 =
mindex(i1, i2, Nc);
238 int k2 =
mindex(i2, i1, Nc);
241 Field_G v(Nvol, Nex), w(Nvol, Nex);
247 for (
int ex = 0; ex < Nex; ++ex) {
248 for (
int site = 0; site < Nvol; ++site) {
249 at = A.
mat(site, ex);
252 at.
r(j1) * at.r(j1) + at.i(j1) * at.i(j1) + 2.0 * at.r(j1) * at.r(j2)
253 + at.r(k1) * at.r(k1) + at.i(k1) * at.i(k1) - 2.0 * at.i(j1) * at.i(j2)
254 + at.r(k2) * at.r(k2) + at.i(k2) * at.i(k2) - 2.0 * at.r(k1) * at.r(k2)
255 + at.r(j2) * at.r(j2) + at.i(j2) * at.i(j2) + 2.0 * at.i(k1) * at.i(k2);
256 xlamd = 1.0 / sqrt(xlamd);
259 vt.
set(j1, (at.r(j1) + at.r(j2)) * xlamd, (-at.i(j1) + at.i(j2)) * xlamd);
260 vt.
set(k1, (at.r(k2) - at.r(k1)) * xlamd, (-at.i(k2) - at.i(k1)) * xlamd);
261 vt.
set(k2, (at.r(k1) - at.r(k2)) * xlamd, (-at.i(k1) - at.i(k2)) * xlamd);
262 vt.
set(j2, (at.r(j1) + at.r(j2)) * xlamd, (at.i(j1) - at.i(j2)) * xlamd);
264 v.set_mat(site, ex, vt);
268 for (
int ex = 0; ex < Nex; ++ex) {
273 for (
int ex = 0; ex < Nex; ++ex) {
278 for (
int ex = 0; ex < Nex; ++ex) {