-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.h
401 lines (347 loc) · 13.5 KB
/
default.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
// default.h - default constants are put here
#include <vector>
#include <sstream>
struct default_value // A structure to handle default values
{
string name;
string value;
};
class default_dict // A dictionary for all default values
{
vector<default_value> dict;
public:
default_dict(); //Default constants initialization
int int_value(const char *name); //Returns an integer value, which corresponds to value in @name
n_type value(const char *name); //Returns a float value, which corresponds to value in @name
void print() {for (int i=0;i<dict.size();i++) cout << dict[i].name << "\t" << dict[i].value << endl; }
};
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
int default_dict::int_value(const char *name)
//Returns an integer value, which corresponds to value in @name
{
bool found = false;
int i=0;
stringstream input;
input << name;
string s = input.str();
while ((!found) && (i<dict.size()))
{
if (dict[i].name==s)
{
found = true;
stringstream value(dict[i].value);
int out;
if (value >> out)
{
return out;
}
else
{
cout << "Conversion error of " << s << endl;
}
};
i++;
}
cout << "What the hell I'm doing here?" << endl;
cout << "ERROR : no such default value : " + s << endl;
return 0;
}
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
n_type default_dict::value(const char *name)
//Returns a float value, which corresponds to value in @name
{
bool found = false;
int i=0;
stringstream input;
input << name;
string s = input.str();
while ((!found) && (i<dict.size()))
{
if (dict[i].name==s)
{
found = true;
stringstream value(dict[i].value);
n_type out;
if (value >> out)
{
return out;
}
else
{
cout << "Conversion error of " << s << endl;
}
};
i++;
}
cout << "What the hell I'm doing here?" << endl;
cout << "ERROR : no such default value : " + s << endl;
return 0.0;
}
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
default_dict::default_dict()
//Default constants initialization
{
default_value current;
//===================================================================================//
current.name = "desired_accuracy";
current.value = "0.001";
/*
* desired errorbar in G(\tau)
*/
dict.push_back(current);
//===================================================================================//
current.name = "use_Wang_Landau";
current.value = "1";
/*
* indicates how to deal with quantum Wang Landau reweighting
* A-priory guerss for WL weights can be read from the file "WL.dat" and then modified by the standard WL procedure
* The modified weights are stored in file "WL1.dat".
* Normally, use "WL1.dat" as an a-priory guess for the futher runs.
* Possible values
* 0: do not use WL reveighting at all
* 1: read from the file and modify
* (recommended)
* 2: do not read from the file; start from the same WL weights for all orders and modify this set
* (use it if you do not have any a-priory guess)
* 3: import from the file, but not modify
* If input file is absent, option 1 and 3 coincide with 2 and 0, respectively.
*/
dict.push_back(current);
//===================================================================================//
current.name = "Initial_steps_without_WL";
current.value = "3000";
dict.push_back(current);
//===================================================================================//
current.name = "U";
current.value = "1";
/*
* Hubbard U
*/
dict.push_back(current);
//===================================================================================//
current.name="read_delta";
current.value="0";
/*
* whether to read self-energy from the external file
* Possible values
* 0: do not read
* 1: read from file "Delta.dat" the same self-energy for all zones
* 2: read from file "Delta.dat" different self-energies for different zones
*/
dict.push_back(current);
//===================================================================================//
current.name="number_of_Matsubara_frequencies";
current.value="21";
dict.push_back(current);
//===================================================================================//
current.name="sparse_Matsubaras";
current.value="0";
dict.push_back(current);
//===================================================================================//
current.name="sparse_Matsubaras_start_from";
current.value="10";
dict.push_back(current);
//===================================================================================//
current.name="N_tau";
current.value="128";
dict.push_back(current);
//===================================================================================//
current.name="rotate_basis";
current.value="0";
/*
* whether to rotate basis for the observables;
* file "gg.dat" contains only diagonal elements of the Green function; the same information
* is used in the sampling procedure/ One may want to deal with, say, momentum representation for
* the Green function. In this case, write an appropriate file "rotate.dat".
* For simple cases, do not bother youself, an put this flag zero.
*/
dict.push_back(current);
//===================================================================================//
current.name="alpha";
current.value="-0.03";
/*
* \alpha for the interaction operator; put it approximately -0.03
*/
dict.push_back(current);
//===================================================================================//
current.name="alpha_offdiagonal";
current.value="0.0001";
dict.push_back(current);
//===================================================================================//
current.name="Spin_Flips_Only_In_Global_Move";
current.value="1";
dict.push_back(current);
//===================================================================================//
current.name="expected_occupancy";
current.value="0.5";
dict.push_back(current);
//===================================================================================//
current.name="maximum_MC_steps";
current.value="100000000";
/*
* maximal number of MC steps to be performed;
* also used at certain initial stages of the program, particularly alphaW_accumulation...
*/
dict.push_back(current);
//===================================================================================//
current.name="scratch_period";
current.value="500";
/*
* How often do you recalculate from a scratch
*/
dict.push_back(current);
//===================================================================================//
current.name="output_period";
current.value="100000";
/*
* How often results are written to the files, MC trials
*/
dict.push_back(current);
//===================================================================================//
current.name="output_period_time";
current.value="5";
/*
* Minimal period of the update of external files, seconds
*/
dict.push_back(current);
//===================================================================================//
current.name="WL_factor";
current.value="0.5";
/*
* Maximal order in WL weight calculation is WL_factor*beta*U*n_part
*/
dict.push_back(current);
//===================================================================================//
current.name="WL_initial_factor";
current.value="0.01";
dict.push_back(current);
//===================================================================================//
current.name="WL_circles_number";
current.value="4";
dict.push_back(current);
//===================================================================================//
current.name="Additional_Delta_WL";
current.value="0";
dict.push_back(current);
//===================================================================================//
current.name="WL_Tolerance_factor";
current.value="0.8";
/*
* Fine tune of the procedure of WL weights determination.
* See ini.cpp for details...
*/
dict.push_back(current);
//===================================================================================//
current.name="N_autocorr";
current.value="50";
/*
* Number of points in the plot for autocorrelation function ("autocorr.dat")
*/
dict.push_back(current);
//===================================================================================//
current.name="Use_Global_moves";
current.value="0";
dict.push_back(current);
//===================================================================================//
current.name="W_group_generators";
current.value="0";
/*
* This is a total number of irreducible group representations in the hamiltonian of the coulomb interaction.
* In case of all 'n_zone' zones being equivalent leave this number as zero.
* Otherwise the first number represents total number of symmetry considerations, the following n_zone*first number digits,
* separated by space, represent a permutation which commutes with an interactive hamiltonian.
* Examples:
* - For a 2+3 code in the corresponding directory one can compile it with a n_part=1, n_zone=4, which gives a density-density interaction.
* In this case the first two zones are allocated for one spin directions, the second two - for the opposing one.
* The following line should be provided here: '1 1 0 3 2', which means a permutation 0->1, 1->0, 2->3, 3->2 leaves the Hamiltonian untouched.
* - For the same 2+3 code in a three orbital case being compiled with n_part=1, n_zone=6, the situtation is the same,
* though now first three digits correspond to one spin direction, second three - for the opposing.
* The corresponding value for W_group_generators is '2 3 4 5 0 1 2 2 0 1 5 3 4'.
* Warning. Assuming too strong symmetry such as with 'W_group_generators' will lead to wrong results. Be careful!
*/
dict.push_back(current);
//===================================================================================//
current.name="calculate_Gamma4";
current.value="0";
/*
* whether to calculate 4-point correlators
*/
dict.push_back(current);
//===================================================================================//
current.name="calculate_Gamma60";
current.value="0";
/*
* whether to calculate 6-point 4-frequency correlators
*/
dict.push_back(current);
//===================================================================================//
current.name="calculate_Gamma6";
current.value="0";
/*
* whether to calculate 6-point 4-frequency correlators
*/
dict.push_back(current);
//===================================================================================//
current.name="chi4_numerical_zero";
current.value="1e-10";
dict.push_back(current);
//===================================================================================//
current.name="chi6_numerical_zero";
current.value="1e-10";
dict.push_back(current);
//===================================================================================//
current.name="number_of_Matsubara_frequencies_for_Gamma4";
current.value="12";
/*
* Doubled number of Matsubara's for 4-point correlators
*/
dict.push_back(current);
//===================================================================================//
current.name="Enable_cluster_updates";
current.value="0";
dict.push_back(current);
//===================================================================================//
current.name="cluster_size";
current.value="4";
dict.push_back(current);
//===================================================================================//
current.name="number_of_trials_in_cluster";
current.value="6";
dict.push_back(current);
//===================================================================================//
current.name="Part_of_cluster_steps";
current.value="0.1";
dict.push_back(current);
//===================================================================================//
current.name="number_of_fields";
current.value="1";
dict.push_back(current);
//===================================================================================//
current.name="calculate_nn";
current.value="0";
dict.push_back(current);
//===================================================================================//
current.name="nn_number1";
current.value="0";
dict.push_back(current);
//===================================================================================//
current.name="nn_number2";
current.value="0";
dict.push_back(current);
//===================================================================================//
current.name="nn_zone1";
current.value="0";
dict.push_back(current);
//===================================================================================//
current.name="nn_zone2";
current.value="0";
dict.push_back(current);
//===================================================================================//
current.name="write_sigma";
current.value="0";
/*
* whether to write "Sigma.dat"
*/
dict.push_back(current);
//===================================================================================//
;}