Go to the documentation of this file.
14 #ifdef USE_FACTORY_AUTOREGISTER
16 bool init = Projection_Maximum_SU_N::register_factory();
21 =
"Projection_Maximum_SU_N";
79 err += params.
fetch_int(
"maximum_number_of_iteration", Niter);
80 err += params.
fetch_double(
"convergence_criterion", Enorm);
136 const int Nex = Uref.
nex();
137 const int Nvol = Uref.
nvol();
165 const int Nex = Uorg.
nex();
166 const int Nvol = Uorg.
nvol();
169 assert(Cst.
nex() == Nex);
170 assert(Cst.
nvol() == Nvol);
171 assert(U.
nex() == Nex);
172 assert(U.
nvol() == Nvol);
178 for (
int ex = 0; ex < Nex; ++ex) {
180 axpy(*
m_Ut, ex, 1.0 - alpha, Uorg, ex);
197 vout.
crucial(
m_vl,
"Error at %s: force_recursive() is not available.\n",
207 const int Nvol = Cst.
nvol();
208 const int Nex = Cst.
nex();
210 assert(Nvol == G0.
nvol());
211 assert(Nex == G0.
nex());
219 for (
int ex = 0; ex < Nex; ++ex) {
226 int ith, nth, is, ns;
227 set_threadtask(ith, nth, is, ns, Nvol);
229 for (
int ex = 0; ex < Nex; ++ex) {
230 for (
int site = is; site < ns; ++site) {
236 for (
int iter = 0; iter <
m_Niter; ++iter) {
238 for (
int ex = 0; ex < Nex; ++ex) {
239 for (
int site = is; site < ns; ++site) {
245 for (
int imt = 0; imt < Nmt; ++imt) {
246 for (
int i1 = 0; i1 < Nc; ++i1) {
247 int i2 = (i1 + 1) % Nc;
254 for (
int ex = 0; ex < Nex; ++ex) {
255 for (
int site = is; site < ns; ++site) {
256 for (
int cc = 0; cc < Nc; ++cc) {
257 retr1 +=
m_Dlt->
cmp_r(cc * (1 + Nc), site, ex);
266 double deltaV = 1.0 - retr / (Nc * Nvol * Nex * Npe);
270 for (
int ex = 0; ex < Nex; ++ex) {
271 for (
int site = is; site < ns; ++site) {
297 const int Nvol = A.
nvol();
298 const int Nex = A.
nex();
309 const int j1 =
mindex(i1, i1, Nc);
310 const int j2 =
mindex(i2, i2, Nc);
311 const int k1 =
mindex(i1, i2, Nc);
312 const int k2 =
mindex(i2, i1, Nc);
319 int ith, nth, is, ns;
320 set_threadtask(ith, nth, is, ns, Nvol);
322 for (
int ex = 0; ex < Nex; ++ex) {
323 for (
int site = is; site < ns; ++site) {
326 at = A.
mat(site, ex);
329 at.
r(j1) * at.
r(j1) + at.
i(j1) * at.
i(j1) + 2.0 * at.
r(j1) * at.
r(j2)
330 + at.
r(k1) * at.
r(k1) + at.
i(k1) * at.
i(k1) - 2.0 * at.
i(j1) * at.
i(j2)
331 + at.
r(k2) * at.
r(k2) + at.
i(k2) * at.
i(k2) - 2.0 * at.
r(k1) * at.
r(k2)
332 + at.
r(j2) * at.
r(j2) + at.
i(j2) * at.
i(j2) + 2.0 * at.
i(k1) * at.
i(k2);
333 xlamd = 1.0 / sqrt(xlamd);
337 vt.
set(j1, (at.
r(j1) + at.
r(j2)) * xlamd, (-at.
i(j1) + at.
i(j2)) * xlamd);
338 vt.
set(k1, (at.
r(k2) - at.
r(k1)) * xlamd, (-at.
i(k2) - at.
i(k1)) * xlamd);
339 vt.
set(k2, (at.
r(k1) - at.
r(k2)) * xlamd, (-at.
i(k1) - at.
i(k2)) * xlamd);
340 vt.
set(j2, (at.
r(j1) + at.
r(j2)) * xlamd, (at.
i(j1) - at.
i(j2)) * xlamd);
347 for (
int ex = 0; ex < Nex; ++ex) {
353 for (
int ex = 0; ex < Nex; ++ex) {
359 for (
int ex = 0; ex < Nex; ++ex) {
void init(const Parameters ¶ms)
void set_string(const string &key, const string &value)
Mat_SU_N mat_dag(const int site, const int mn=0) const
void set_double(const string &key, const double value)
void detailed(const char *format,...)
void set_mat(const int site, const int mn, const Mat_SU_N &U)
static int size()
size of small world.
void maxTr_SU2(const int, const int, Field_G &, Field_G &, Field_G &)
maximization by SU(2) subgroup.
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
int non_negative(const int v)
void copy(Field &y, const Field &x)
copy(y, x): y = x
void set(int c, const double &re, const double &im)
Bridge::VerboseLevel m_vl
verbose level
void get_parameters(Parameters ¶ms) const
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.
void project(Field_G &U, const double alpha, const Field_G &C, const Field_G &Uorg)
projection U = P[alpha, C, Uorg]
int mindex(const int i, const int j, const int Nc)
matrix index for convenience.
static void reduce_sum_global(dcomplex &value, const int i_thread, const int Nthread)
global reduction with summation: dcomplex values are assumed thread local.
void reset_field(const Field_G &Uref)
void set_parameters(const Parameters ¶ms)
static Bridge::VerboseLevel Vlevel()
double cmp_r(const int cc, const int site, const int mn=0) const
static VerboseLevel set_verbose_level(const std::string &str)
void mult_Field_Gnn(Field_G &W, const int ex, const Field_G &U1, const int ex1, const Field_G &U2, const int ex2)
int non_zero(const double v)
double m_Enorm
convergence criterion of maximization
void set_int(const string &key, const int value)
int fetch_string(const string &key, string &value) const
int fetch_double(const string &key, double &value) const
void maxTr(Field_G &U, const Field_G &V)
maximization of ReTr[U^\dag V].
static const std::string class_name
void crucial(const char *format,...)
static int get_thread_id()
returns thread id.
Mat_SU_N mat(const int site, const int mn=0) const
int fetch_int(const string &key, int &value) const
int m_Niter
maximum iteration of maximization steps
void general(const char *format,...)
static void assert_single_thread(const std::string &class_name)
assert currently running on single thread.
static std::string get_verbose_level(const VerboseLevel vl)