VMPS++
Loading...
Searching...
No Matches
VumpsTypedefs.h
Go to the documentation of this file.
1#ifndef VUMPSTYPEDEFS
2#define VUMPSTYPEDEFS
3
5struct GAUGE
6{
7 enum OPTION {L=0, R=1, C=2};
8};
9
10std::ostream& operator<< (std::ostream& s, GAUGE::OPTION g)
11{
12 if (g==GAUGE::OPTION::L) {s << "L";}
13 else if (g==GAUGE::OPTION::R) {s << "R";}
14 else if (g==GAUGE::OPTION::C) {s << "C";}
15 return s;
16}
17
19{
21};
22
23std::ostream& operator<< (std::ostream& s, UMPS_ALG::OPTION a)
24{
25 if (a==UMPS_ALG::OPTION::PARALLEL) {s << "parallel";}
26 else if (a==UMPS_ALG::OPTION::SEQUENTIAL) {s << "sequential";}
27 else if (a==UMPS_ALG::OPTION::H2SITE) {s << "h2site";}
28 else if (a==UMPS_ALG::OPTION::IDMRG) {s << "IDMRG";}
29 else if (a==UMPS_ALG::OPTION::DYNAMIC) {s << "dynamic(par/seq)";}
30 return s;
31}
32
34struct VUMPS
35{
36 struct TWOSITE_A
37 {
38 enum OPTION
39 {
42 ALxCxAR=2
43 };
44 };
46 struct CONTROL
47 {
48 struct DEFAULT
49 {
50 //GLOB DEFAULTS
51 constexpr static size_t min_iterations = 1;
52 constexpr static size_t max_iterations = 1000;
53 constexpr static size_t min_iter_without_expansion = 10;
54 constexpr static size_t max_iter_without_expansion = 100;
55 constexpr static double tol_eigval = 1e-13;
56 constexpr static double tol_state = 1e-7;
57 constexpr static double tol_var = 1e-13;
58 constexpr static size_t Minit = 10;
59 constexpr static size_t Mlimit = 2000;
60 constexpr static size_t Qinit = 4;
61 constexpr static size_t savePeriod = 0;
62 constexpr static size_t truncatePeriod = std::numeric_limits<size_t>::max();
63 constexpr static bool INIT_TO_HALF_INTEGER_QN = false;
64 constexpr static char saveName[] = "UmpsBackup";
65 constexpr static bool FULLMMAX_FILENAME = true;
66 constexpr static bool CALC_S_ON_EXIT = true;
67 constexpr static int Niter_before_save = 100;
68 constexpr static bool CALC_STATE_ERROR = true;
69
70 //DYN DEFAULTS
71 static size_t max_deltaM (size_t i) {return (i<1800)? 100ul:0ul;} // Maximum expansion by 100 and turn off expansion completely after 1800 iterations
72 static size_t Mincr_abs (size_t i) {return 50ul;} // increase M by at least Mincr_abs
73 static double Mincr_rel (size_t i) {return 1.04;} // increase M by at least 4%
74 static void doSomething (size_t i) {return;}
75 static UMPS_ALG::OPTION iteration (size_t i) {return UMPS_ALG::PARALLEL;}
76
77 //LANCZOS DEFAULTS
78 constexpr static ::LANCZOS::REORTHO::OPTION REORTHO = LANCZOS::REORTHO::FULL;
79 constexpr static double eps_eigval = 1.e-14;
80 constexpr static double eps_coeff = 1.e-14;
81 constexpr static size_t dimK = 200ul;
82 };
83
84 struct GLOB
85 {
99 std::string saveName = std::string(CONTROL::DEFAULT::saveName);
104 };
105
106 struct DYN
107 {
108 function<size_t(size_t)> max_deltaM = CONTROL::DEFAULT::max_deltaM;
109 function<size_t(size_t)> Mincr_abs = CONTROL::DEFAULT::Mincr_abs;
110 function<double(size_t)> Mincr_rel = CONTROL::DEFAULT::Mincr_rel;
111 // function<double(size_t)> eps_svd = CONTROL::DEFAULT::eps_svd;
113 function<size_t(size_t)> iteration = CONTROL::DEFAULT::iteration;
114 };
115
116 struct LOC
117 {
118 ::LANCZOS::REORTHO::OPTION REORTHO = CONTROL::DEFAULT::REORTHO;
122 };
123 };
124};
125
126std::ostream& operator<< (std::ostream& s, VUMPS::TWOSITE_A::OPTION a)
127{
128 if (a==VUMPS::TWOSITE_A::ALxAC) {s << "ALxAC";}
129 else if (a==VUMPS::TWOSITE_A::ACxAR) {s << "ACxAR";}
130 else if (a==VUMPS::TWOSITE_A::ALxCxAR) {s << "ALxCxAR";}
131 return s;
132}
133
134#endif
std::ostream & operator<<(std::ostream &s, GAUGE::OPTION g)
Definition: VumpsTypedefs.h:10
static constexpr size_t max_iter_without_expansion
Definition: VumpsTypedefs.h:54
static constexpr size_t Qinit
Definition: VumpsTypedefs.h:60
static UMPS_ALG::OPTION iteration(size_t i)
Definition: VumpsTypedefs.h:75
static double Mincr_rel(size_t i)
Definition: VumpsTypedefs.h:73
static constexpr bool CALC_S_ON_EXIT
Definition: VumpsTypedefs.h:66
static constexpr int Niter_before_save
Definition: VumpsTypedefs.h:67
static constexpr double eps_coeff
Definition: VumpsTypedefs.h:80
static constexpr size_t Mlimit
Definition: VumpsTypedefs.h:59
static constexpr size_t dimK
Definition: VumpsTypedefs.h:81
static constexpr double tol_var
Definition: VumpsTypedefs.h:57
static constexpr ::LANCZOS::REORTHO::OPTION REORTHO
Definition: VumpsTypedefs.h:78
static size_t max_deltaM(size_t i)
Definition: VumpsTypedefs.h:71
static constexpr size_t max_iterations
Definition: VumpsTypedefs.h:52
static constexpr size_t min_iterations
Definition: VumpsTypedefs.h:51
static constexpr bool INIT_TO_HALF_INTEGER_QN
Definition: VumpsTypedefs.h:63
static constexpr size_t Minit
Definition: VumpsTypedefs.h:58
static constexpr double tol_eigval
Definition: VumpsTypedefs.h:55
static constexpr bool FULLMMAX_FILENAME
Definition: VumpsTypedefs.h:65
static size_t Mincr_abs(size_t i)
Definition: VumpsTypedefs.h:72
static constexpr double tol_state
Definition: VumpsTypedefs.h:56
static void doSomething(size_t i)
Definition: VumpsTypedefs.h:74
static constexpr double eps_eigval
Definition: VumpsTypedefs.h:79
static constexpr bool CALC_STATE_ERROR
Definition: VumpsTypedefs.h:68
static constexpr size_t savePeriod
Definition: VumpsTypedefs.h:61
static constexpr size_t truncatePeriod
Definition: VumpsTypedefs.h:62
static constexpr size_t min_iter_without_expansion
Definition: VumpsTypedefs.h:53
static constexpr char saveName[]
Definition: VumpsTypedefs.h:64
function< size_t(size_t)> max_deltaM
function< double(size_t)> Mincr_rel
function< size_t(size_t)> Mincr_abs
function< void(size_t)> doSomething
function< size_t(size_t)> iteration
std::string saveName
Definition: VumpsTypedefs.h:99
size_t min_iter_without_expansion
Definition: VumpsTypedefs.h:88
size_t max_iter_without_expansion
Definition: VumpsTypedefs.h:89
::LANCZOS::REORTHO::OPTION REORTHO