forked from sanshar/Block
-
Notifications
You must be signed in to change notification settings - Fork 0
/
input.h
577 lines (535 loc) · 26 KB
/
input.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
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
/*
Developed by Sandeep Sharma and Garnet K.-L. Chan, 2012
Copyright (c) 2012, Garnet K.-L. Chan
This program is integrated in Molpro with the permission of
Sandeep Sharma and Garnet K.-L. Chan
*/
#ifndef SPIN_INPUT_HEADER_H
#define SPIN_INPUT_HEADER_H
#include <vector>
#include <string>
#include <map>
#include <boost/serialization/serialization.hpp>
#include <boost/shared_array.hpp>
#include "IrrepSpace.h"
#include "SpinQuantum.h"
#include "timer.h"
#include "couplingCoeffs.h"
#include <boost/tr1/unordered_map.hpp>
#include "IntegralMatrix.h"
namespace SpinAdapted{
class SpinBlock;
class OneElectronArray;
class TwoElectronArray;
//typedef OneElectronArray PerturbOneElectronArray;
//typedef TwoElectronArray PerturbTwoElectronArray;
class PerturbTwoElectronArray;
class PairArray;
class CCCCArray;
class CCCDArray;
enum OnePerturbType{ Va_1=0, Vi_1, Vai_1, OnePertEnd};
enum TwoPerturbType{Va=0,Vi,Vab,Vij,Vai,Vabi,Vaij,Vabij,TwoPertEnd};
//enum OnePerturbType : int;
//enum TwoPerturbType : int;
enum WarmUpTypes {WILSON, LOCAL0, LOCAL2, LOCAL3, LOCAL4};
enum hamTypes {QUANTUM_CHEMISTRY, HUBBARD, BCS, HEISENBERG};
enum solveTypes {LANCZOS, DAVIDSON, CONJUGATE_GRADIENT};
enum algorithmTypes {ONEDOT, TWODOT, TWODOT_TO_ONEDOT};
enum noiseTypes {RANDOM, EXCITEDSTATE};
enum calcType {DMRG, ONEPDM, TWOPDM, THREEPDM, FOURPDM, NEVPT2PDM, RESTART_TWOPDM,
RESTART_ONEPDM, RESTART_THREEPDM, RESTART_FOURPDM, RESTART_NEVPT2PDM, TINYCALC, FCI,
EXCITEDDMRG, CALCOVERLAP, CALCHAMILTONIAN, COMPRESS, RESPONSE, RESPONSEBW,
TRANSITION_ONEPDM, TRANSITION_TWOPDM, TRANSITION_THREEPDM, RESTART_T_ONEPDM, RESTART_T_TWOPDM, RESTART_T_THREEPDM,
NEVPT2,RESTART_NEVPT2, MPS_NEVPT, RESTART_MPS_NEVPT,
DS1_ONEPDM, RESTART_DS1_ONEPDM, DS0_ONEPDM, RESTART_DS0_ONEPDM};
enum orbitalFormat{MOLPROFORM, DMRGFORM};
enum reorderType{FIEDLER, GAOPT, MANUAL, NOREORDER};
enum keywords{ORBS, LASTM, STARTM, MAXM, REORDER, HF_OCC, SCHEDULE, SYM, NELECS, SPIN, IRREP,
MAXJ, PREFIX, NROOTS, DOCD, DEFLATION_MAX_SIZE, MAXITER, BASENERGY,
SCREEN_TOL, ODOT, SWEEP_TOL, OUTPUTLEVEL, NONSPINADAPTED, BOGOLIUBOV, TWODOT_NOISE, WARMUP, NPDM_INTERMEDIATE, NPDM_NO_INTERMEDIATE, NPDM_MULTINODE, NPDM_NO_MULTINODE, SPECIFICPDM, NUMKEYWORDS};
class Input {
private:
std::vector<int> m_thrds_per_node;
int m_norbs;
int m_alpha;
int m_beta;
//
int m_bra_alpha;
int m_bra_beta;
int n_bra_spin;
//
int m_Sz;
bool m_spinAdapted;
bool m_Bogoliubov;
int m_permSymm;
IrrepSpace m_total_symmetry_number;
IrrepSpace m_bra_symmetry_number;// This is used when bra and ket have different spatial symmetry irrep;
// It is only used for transition density matrix calculations.
bool m_transition_diff_spatial_irrep;
bool m_transition_diff_spin =false; //Elvira: This is used when bra and ket have different spins
SpinQuantum m_bra_molecule_quantum; // It is only to calculate <s1|T^1|s2> pdms for SOC
SpinQuantum m_molecule_quantum;
int m_total_spin;
int m_guess_permutations;
bool m_stateSpecific; //when targetting excited states we switch from state
//average to statespecific
int m_occupied_orbitals;
vector<int> m_openorbs;
vector<int> m_closedorbs;
vector<int> m_baseState;
vector<int> m_projectorState;
int m_targetState;
int m_guessState;
std::vector<int> m_hf_occupancy;
std::string m_hf_occ_user;
std::vector<double> m_weights;
std::vector<int> m_sweep_iter_schedule;
std::vector<int> m_sweep_state_schedule;
std::vector<int> m_sweep_qstate_schedule;
std::vector<double> m_sweep_tol_schedule;
std::vector<double> m_sweep_noise_schedule;
std::vector<double> m_sweep_additional_noise_schedule;
bool m_schedule_type_default;
bool m_schedule_type_backward;
int m_lastM;
int m_startM;
int m_maxM;
int m_integral_disk_storage_thresh;
int m_num_Integrals;
bool m_do_diis;
double m_diis_error;
int m_start_diis_iter;
int m_diis_keep_states;
double m_diis_error_tol;
calcType m_calc_type;
noiseTypes m_noise_type;
hamTypes m_ham_type;
WarmUpTypes m_warmup;
int m_nroots;
solveTypes m_solve_type;
bool m_do_deriv;
bool m_do_fci;
bool m_do_pdm;
bool m_do_npdm_ops;
bool m_do_npdm_in_core;
bool m_npdm_generate;
bool m_new_npdm_code;
bool m_store_spinpdm;
bool m_spatpdm_disk_dump;
bool m_pdm_unsorted;
bool m_store_nonredundant_pdm;
bool m_npdm_intermediate;
std::vector<int> m_specificpdm;
bool m_npdm_multinode;
bool m_set_Sz;
int m_maxiter;
double m_oneindex_screen_tol;
double m_twoindex_screen_tol;
bool m_no_transform;
bool m_add_noninteracting_orbs;
bool m_non_SE;
int m_nquanta;
int m_sys_add;
int m_env_add;
int m_deflation_min_size;
int m_deflation_max_size;
algorithmTypes m_algorithm_type;
int m_twodot_to_onedot_iter;
std::vector< std::map<SpinQuantum, int> > m_quantaToKeep;
std::string m_save_prefix;
std::string m_load_prefix;
bool m_direct;
std::vector<double> m_orbenergies;
int m_maxj;
ninejCoeffs m_ninej;
int m_max_lanczos_dimension;
int n_twodot_noise;
double m_twodot_noise;
double m_twodot_gamma;
double m_sweep_tol;
bool m_restart;
bool m_backward;
bool m_fullrestart;
bool m_restart_warm;
bool m_reset_iterations;
bool m_implicitTranspose;
std::vector<int> m_spin_vector;
std::vector<int> m_spin_orbs_symmetry;
int m_num_spatial_orbs;
std::vector<int> m_spatial_to_spin;
std::vector<int> m_spin_to_spatial;
int m_act_size;
int m_core_size;
int m_virt_size;
int m_total_orbs;
int m_nevpt_state_num;
std::vector<int> m_total_spin_orbs_symmetry;
std::vector<int> m_total_spatial_to_spin;
std::vector<int> m_total_spin_to_spatial;
int m_outputlevel;
orbitalFormat m_orbformat;
int m_reorderType;
string m_reorderfile;
std::vector<int> m_reorder;//this can be manual, fiedler, gaopt or noreorder
string m_gaconffile;
bool m_calc_ri_4pdm;
bool m_store_ripdm_readable;
bool m_nevpt2;
bool m_conventional_nevpt2;
int m_kept_nevpt2_states;
pair<bool,int> NevPrint;
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
{
ar & m_thrds_per_node & m_spinAdapted & m_Bogoliubov & m_stateSpecific & m_implicitTranspose & m_num_Integrals;
ar & m_norbs & m_alpha & m_beta & m_solve_type & m_Sz & m_set_Sz & m_baseState& m_projectorState& m_targetState;
ar & m_spin_vector & m_spin_orbs_symmetry & m_guess_permutations & m_nroots & m_weights & m_hf_occ_user & m_hf_occupancy;
ar & m_sweep_iter_schedule & m_sweep_state_schedule & m_sweep_qstate_schedule & m_sweep_tol_schedule & m_sweep_noise_schedule &m_sweep_additional_noise_schedule & m_reorder;
ar & m_molecule_quantum & m_total_symmetry_number & m_total_spin & m_orbenergies & m_add_noninteracting_orbs;
ar & m_bra_symmetry_number & m_permSymm & m_openorbs & m_closedorbs;
ar & m_bra_molecule_quantum & m_bra_symmetry_number & m_add_noninteracting_orbs; //diff spins case
ar & m_bra_alpha & m_bra_beta & n_bra_spin; //diff spins case
ar & m_transition_diff_spin;
ar & m_non_SE;
// ar & m_save_prefix & m_load_prefix & m_direct & m_max_lanczos_dimension;
ar & m_direct & m_max_lanczos_dimension;
ar & m_deflation_min_size & m_deflation_max_size & m_outputlevel & m_reorderfile;
ar & m_algorithm_type & m_twodot_to_onedot_iter & m_orbformat ;
ar & m_nquanta & m_sys_add & m_env_add & m_do_fci & m_no_transform ;
ar & m_do_pdm & m_do_npdm_ops & m_do_npdm_in_core & m_npdm_generate & m_new_npdm_code & m_specificpdm;
ar & m_transition_diff_spatial_irrep & m_occupied_orbitals;
ar & m_store_spinpdm &m_spatpdm_disk_dump & m_pdm_unsorted & m_npdm_intermediate & m_npdm_multinode;
ar & m_maxj & m_ninej & m_maxiter & m_do_deriv & m_oneindex_screen_tol & m_twoindex_screen_tol & m_quantaToKeep & m_noise_type;
ar & m_sweep_tol & m_restart & m_backward & m_fullrestart & m_restart_warm & m_reset_iterations & m_calc_type & m_ham_type & m_warmup;
ar & m_do_diis & m_diis_error & m_start_diis_iter & m_diis_keep_states & m_diis_error_tol & m_num_spatial_orbs;
ar & m_spatial_to_spin & m_spin_to_spatial & m_maxM & m_schedule_type_backward & m_schedule_type_default &m_integral_disk_storage_thresh;
ar & n_twodot_noise & m_twodot_noise & m_twodot_gamma & m_guessState;
ar & m_calc_ri_4pdm & m_store_ripdm_readable & m_nevpt2 & m_conventional_nevpt2 & m_kept_nevpt2_states & NevPrint;
ar & m_act_size & m_core_size & m_virt_size & m_total_orbs & m_total_spin_orbs_symmetry & m_total_spatial_to_spin & m_total_spin_to_spatial;
}
void initialize_defaults();
std::vector<int> hfOccGenerator_ ();
public:
//Input() : m_ninej(ninejCoeffs::getinstance()){}
Input() {}
Input (const std::string& config_name);
// ROA
void initCumulTimer()
{
ddscreen = boost::shared_ptr<cumulTimer> (new cumulTimer());
cdscreen = boost::shared_ptr<cumulTimer> (new cumulTimer());
dscreen = boost::shared_ptr<cumulTimer> (new cumulTimer());
buildcsfops = boost::shared_ptr<cumulTimer> (new cumulTimer());
sysdotmake = boost::shared_ptr<cumulTimer> (new cumulTimer());
initnewsystem = boost::shared_ptr<cumulTimer> (new cumulTimer());
guessgenT = boost::shared_ptr<cumulTimer> (new cumulTimer());
multiplierT = boost::shared_ptr<cumulTimer> (new cumulTimer());
operrotT = boost::shared_ptr<cumulTimer> (new cumulTimer());
davidsonT = boost::shared_ptr<cumulTimer> (new cumulTimer());
rotmatrixT = boost::shared_ptr<cumulTimer> (new cumulTimer());
blockdavid = boost::shared_ptr<cumulTimer> (new cumulTimer());
datatransfer = boost::shared_ptr<cumulTimer> (new cumulTimer());
hmultiply = boost::shared_ptr<cumulTimer> (new cumulTimer());
oneelecT = boost::shared_ptr<cumulTimer> (new cumulTimer());
twoelecT = boost::shared_ptr<cumulTimer> (new cumulTimer());
makeopsT = boost::shared_ptr<cumulTimer> (new cumulTimer());
collectqT = boost::shared_ptr<cumulTimer> (new cumulTimer());
opallocate = boost::shared_ptr<cumulTimer> (new cumulTimer());
opcatenate = boost::shared_ptr<cumulTimer> (new cumulTimer());
oprelease = boost::shared_ptr<cumulTimer> (new cumulTimer());
opequateT = boost::shared_ptr<cumulTimer> (new cumulTimer());
justmultiply = boost::shared_ptr<cumulTimer> (new cumulTimer());
spinrotation = boost::shared_ptr<cumulTimer> (new cumulTimer());
otherrotation = boost::shared_ptr<cumulTimer> (new cumulTimer());
solvewf = boost::shared_ptr<cumulTimer> (new cumulTimer());
postwfrearrange = boost::shared_ptr<cumulTimer> (new cumulTimer());
couplingcoeff = boost::shared_ptr<cumulTimer> (new cumulTimer());
buildsumblock = boost::shared_ptr<cumulTimer> (new cumulTimer());
buildblockops = boost::shared_ptr<cumulTimer> (new cumulTimer());
addnoise = boost::shared_ptr<cumulTimer> (new cumulTimer());
s0time = boost::shared_ptr<cumulTimer> (new cumulTimer());
s1time = boost::shared_ptr<cumulTimer> (new cumulTimer());
s2time = boost::shared_ptr<cumulTimer> (new cumulTimer());
blockintegrals = boost::shared_ptr<cumulTimer> (new cumulTimer());
blocksites = boost::shared_ptr<cumulTimer> (new cumulTimer());
statetensorproduct = boost::shared_ptr<cumulTimer> (new cumulTimer());
statecollectquanta = boost::shared_ptr<cumulTimer> (new cumulTimer());
builditeratorsT = boost::shared_ptr<cumulTimer> (new cumulTimer());
diskio = boost::shared_ptr<cumulTimer> (new cumulTimer());
}
void writeSummary();
#ifdef MOLPRO
void writeSummaryForMolpro();
#endif
void performSanityTest();
void generateDefaultSchedule();
void readorbitalsfile(string& dumpFile, OneElectronArray& v1, TwoElectronArray& v2, double& coreEnergy, int integralIndex);
void readorbitalsfile(string& dumpFile, OneElectronArray& v1, TwoElectronArray& v2, OneElectronArray& vpt1, std::map<TwoPerturbType,PerturbTwoElectronArray>& vpt2, double& coreEnergy);
void readorbitalsfile(string& dumpFile, OneElectronArray& v1, TwoElectronArray& v2, double& coreEnergy, PairArray& vcc, CCCCArray& vcccc, CCCDArray& vcccd);
int getNumIntegrals() { return m_num_Integrals;}
void readreorderfile(ifstream& dumpFile, std::vector<int>& reorder);
std::vector<int> getgaorder(ifstream& gaconfFile, string& orbitalfile, std::vector<int>& fiedlerorder);
std::vector<int> get_fiedler(string& dumpname);
std::vector<int> get_fiedler_nevpt(string& dumpname, int nact);
std::vector<int> get_fiedler_bcs(string& dumpname);
void usedkey_error(string& key, string& line);
void makeInitialHFGuess();
static void ReadMeaningfulLine(ifstream&, string&, int);
boost::shared_ptr<cumulTimer> dscreen;
boost::shared_ptr<cumulTimer> cdscreen;
boost::shared_ptr<cumulTimer> ddscreen;
boost::shared_ptr<cumulTimer> buildcsfops;
boost::shared_ptr<cumulTimer> sysdotmake;
boost::shared_ptr<cumulTimer> initnewsystem;
boost::shared_ptr<cumulTimer> diskio;
boost::shared_ptr<cumulTimer> builditeratorsT;
boost::shared_ptr<cumulTimer> blockintegrals;
boost::shared_ptr<cumulTimer> blocksites;
boost::shared_ptr<cumulTimer> statetensorproduct;
boost::shared_ptr<cumulTimer> statecollectquanta;
boost::shared_ptr<cumulTimer> guessgenT;
boost::shared_ptr<cumulTimer> multiplierT;
boost::shared_ptr<cumulTimer> operrotT;
boost::shared_ptr<cumulTimer> davidsonT;
boost::shared_ptr<cumulTimer> rotmatrixT;
boost::shared_ptr<cumulTimer> blockdavid;
boost::shared_ptr<cumulTimer> datatransfer;
boost::shared_ptr<cumulTimer> hmultiply;
boost::shared_ptr<cumulTimer> oneelecT;
boost::shared_ptr<cumulTimer> twoelecT;
boost::shared_ptr<cumulTimer> makeopsT;
boost::shared_ptr<cumulTimer> collectqT;
boost::shared_ptr<cumulTimer> opallocate;
boost::shared_ptr<cumulTimer> opcatenate;
boost::shared_ptr<cumulTimer> oprelease;
boost::shared_ptr<cumulTimer> opequateT;
boost::shared_ptr<cumulTimer> justmultiply;
boost::shared_ptr<cumulTimer> spinrotation;
boost::shared_ptr<cumulTimer> otherrotation;
boost::shared_ptr<cumulTimer> solvewf;
boost::shared_ptr<cumulTimer> postwfrearrange;
boost::shared_ptr<cumulTimer> couplingcoeff;
boost::shared_ptr<cumulTimer> buildsumblock;
boost::shared_ptr<cumulTimer> buildblockops;
boost::shared_ptr<cumulTimer> addnoise;
boost::shared_ptr<cumulTimer> s0time;
boost::shared_ptr<cumulTimer> s1time;
boost::shared_ptr<cumulTimer> s2time;
std::vector<int>& get_openorbs() { return m_openorbs;}
std::vector<int>& get_closedorbs() { return m_closedorbs;}
const std::vector<int>& baseStates() const {return m_baseState;}
const int& targetState() const {return m_targetState;}
const int& guessState() const {return m_guessState;}
int& setGuessState() {return m_guessState;}
const std::vector<int>& projectorStates() const {return m_projectorState;}
std::vector<int>& baseStates() {return m_baseState;}
int& targetState() {return m_targetState;}
std::vector<int>& projectorStates() {return m_projectorState;}
void reorderOpenAndClosed();
const int& num_occupied_orbitals() const {return m_occupied_orbitals;}
const bool& doimplicitTranspose() const {return m_implicitTranspose;}
bool& setimplicitTranspose() {return m_implicitTranspose;}
const bool& setStateSpecific() const {return m_stateSpecific;}
bool& setStateSpecific() {return m_stateSpecific;}
const orbitalFormat& orbformat() const {return m_orbformat;}
const int& outputlevel() const {return m_outputlevel;}
int& setOutputlevel() {return m_outputlevel;}
const vector<int>& spatial_to_spin() const {return m_spatial_to_spin;}
int spatial_to_spin(int i) const {return m_spatial_to_spin.at(i);}
const vector<int>& spin_to_spatial() const {return m_spin_to_spatial;}
const double& diis_error_tol() const {return m_diis_error_tol;}
const bool& do_diis() const {return m_do_diis;}
const double& diis_error() const {return m_diis_error;}
const int& start_diis_iter() const {return m_start_diis_iter;}
const int& diis_keep_states() const {return m_diis_keep_states;}
bool use_partial_two_integrals() const {return (m_norbs/2 >= m_integral_disk_storage_thresh);}
bool& set_fullrestart() {return m_fullrestart;}
const bool& get_fullrestart() const {return m_fullrestart;}
const bool& get_backward() const {return m_backward;}
const double& get_sweep_tol() const {return m_sweep_tol;}
const int& get_twodot_method() const {return n_twodot_noise;}
const double& get_twodot_noise() const {return m_twodot_noise;}
double& set_twodot_noise() {return m_twodot_noise;}
const double& get_twodot_gamma() const {return m_twodot_gamma;}
double& set_twodot_gamma() {return m_twodot_gamma;}
const bool& get_restart() const {return m_restart;}
const bool& get_restart_warm() const {return m_restart_warm;}
const bool& get_reset_iterations() const {return m_reset_iterations;}
const ninejCoeffs& get_ninej() const {return m_ninej;}
const hamTypes &hamiltonian() const {return m_ham_type;}
const WarmUpTypes &warmup() const {return m_warmup;}
const int &guess_permutations() const { return m_guess_permutations; }
const int &max_lanczos_dimension() const {return m_max_lanczos_dimension;}
std::vector<int> thrds_per_node() const { return m_thrds_per_node; }
const calcType &calc_type() const { return m_calc_type; }
calcType &calc_type() { return m_calc_type; }
const solveTypes &solve_method() const { return m_solve_type; }
const noiseTypes &noise_type() const {return m_noise_type;}
const bool &set_Sz() const {return m_set_Sz;}
const algorithmTypes &algorithm_method() const { return m_algorithm_type; }
algorithmTypes &set_algorithm_method() { return m_algorithm_type; }
int twodot_to_onedot_iter() const { return m_twodot_to_onedot_iter; }
std::vector< std::map<SpinQuantum, int> >& get_quantaToKeep() { return m_quantaToKeep;}
const std::vector<int> &hf_occupancy() const { return m_hf_occupancy; }
const std::vector<int> &spin_orbs_symmetry() const { return m_spin_orbs_symmetry; }
std::vector<double> weights(int sweep_iter) const;// { return m_weights; }
std::vector<double> weights() const { return m_weights; }
const std::vector<int> &sweep_iter_schedule() const { return m_sweep_iter_schedule; }
const std::vector<int> &sweep_state_schedule() const { return m_sweep_state_schedule; }
const std::vector<int> &sweep_qstate_schedule() const { return m_sweep_qstate_schedule; }
const std::vector<double> &sweep_tol_schedule() const { return m_sweep_tol_schedule; }
const std::vector<double> &sweep_noise_schedule() const { return m_sweep_noise_schedule; }
const std::vector<double> &sweep_additional_noise_schedule() const { return m_sweep_additional_noise_schedule; }
std::vector<double> &set_sweep_noise_schedule() { return m_sweep_noise_schedule; }
std::vector<double> &set_sweep_additional_noise_schedule() { return m_sweep_additional_noise_schedule; }
int& Sz() {return m_Sz;}
int nroots(int sweep_iter) const;
int nroots() const {return m_nroots;}
int real_particle_number() const { return (m_alpha + m_beta);}
int total_particle_number() const { if(!m_add_noninteracting_orbs) return (m_alpha + m_beta); else return (2*m_alpha); }
int bra_particle_number() const { if(!m_add_noninteracting_orbs) return (m_bra_alpha + m_bra_beta); else return (2*m_bra_alpha); } // diff spins case
bool calc_ri_4pdm() const {return m_calc_ri_4pdm;}
bool store_ripdm_readable() const {return m_store_ripdm_readable;}
bool nevpt2() const {return m_nevpt2;}
bool read_higherpdm() const {return m_conventional_nevpt2;}
int kept_nevpt2_states() const {return m_kept_nevpt2_states;}
bool Print() const {return NevPrint.first;}
int PrintIndex() const{return NevPrint.second;}
void SetPrint(bool p, int i=0){NevPrint.first = p;NevPrint.second=i;}
const SpinSpace total_spin_number() const { if (!m_add_noninteracting_orbs) return SpinSpace(m_alpha - m_beta); else return SpinSpace(0); }
const SpinSpace bra_spin_number() const { if (!m_add_noninteracting_orbs) return SpinSpace(m_bra_alpha - m_bra_beta); else return SpinSpace(0); } // diff spins case
int last_site() const
{
if(m_spinAdapted)
{
if(m_calc_type == MPS_NEVPT)
return m_act_size;
else
return m_num_spatial_orbs;
}
else
{
if(m_calc_type == MPS_NEVPT)
return 2*m_act_size;
else
return 2*m_num_spatial_orbs;
}
}
const bool &no_transform() const { return m_no_transform; }
const int &deflation_min_size() const { return m_deflation_min_size; }
const bool &direct() const { return m_direct; }
const int &deflation_max_size() const { return m_deflation_max_size; }
const IrrepSpace &total_symmetry_number() const { return m_total_symmetry_number; }
const IrrepSpace &bra_symmetry_number() const { return m_bra_symmetry_number; }
const SpinQuantum &molecule_quantum() const { return m_molecule_quantum; }
const SpinQuantum &bra_molecule_quantum() const { return m_bra_molecule_quantum; } // diff spins case
const int &sys_add() const { return m_sys_add; }
const bool &add_noninteracting_orbs() const {return m_add_noninteracting_orbs;}
bool &add_noninteracting_orbs() {return m_add_noninteracting_orbs;}
const bool &non_SE() {return m_non_SE;} //for calculations without singlet embedding
const int &nquanta() const { return m_nquanta; }
const int &env_add() const { return m_env_add; }
const bool &do_fci() const { return m_do_fci; }
const int &max_iter() const { return m_maxiter; }
const double &oneindex_screen_tol() const { return m_oneindex_screen_tol; }
double &oneindex_screen_tol() { return m_oneindex_screen_tol; }
const double &twoindex_screen_tol() const { return m_twoindex_screen_tol; }
double &twoindex_screen_tol() { return m_twoindex_screen_tol; }
const int &total_spin() const {return m_total_spin;}
const std::vector<int> &spin_vector() const { return m_spin_vector; }
const std::string &save_prefix() const { return m_save_prefix; }
const std::string &load_prefix() const { return m_load_prefix; }
SpinQuantum& set_molecule_quantum() {return m_molecule_quantum;}
bool transition_diff_spin() {
return m_transition_diff_spin;
}
SpinQuantum effective_molecule_quantum() {
if (!m_add_noninteracting_orbs)
return m_molecule_quantum;
else
return SpinQuantum(m_molecule_quantum.particleNumber + m_molecule_quantum.totalSpin.getirrep(), SpinSpace(0), m_molecule_quantum.orbitalSymmetry);
//return SpinQuantum(total_particle_number() + total_spin_number().getirrep(), SpinSpace(0), total_symmetry_number());
}
//
SpinQuantum bra_quantum() {
if (!m_add_noninteracting_orbs)
{
if (m_transition_diff_spin) {
return SpinQuantum(bra_particle_number(), SpinSpace(m_bra_alpha - m_bra_beta), bra_symmetry_number());
}
else
return SpinQuantum(total_particle_number(), SpinSpace(m_alpha - m_beta), bra_symmetry_number());
}
else {
if (m_transition_diff_spin) {
return SpinQuantum(bra_particle_number()+bra_spin_number().getirrep(), SpinSpace(0), bra_symmetry_number());
}
else
return SpinQuantum(total_particle_number() + total_spin_number().getirrep(), SpinSpace(0), bra_symmetry_number()); }
}
vector<SpinQuantum> effective_molecule_quantum_vec() {
vector<SpinQuantum> q;
if (!m_Bogoliubov) q.push_back(effective_molecule_quantum());
else {
SpinQuantum q_max = effective_molecule_quantum();
for (int n = 0; n <= q_max.get_n(); n+=2) {
q.push_back(SpinQuantum(n, q_max.get_s(), q_max.get_symm()));
}
}
return q;
}
vector<SpinQuantum> bra_quantum_vec() {
vector<SpinQuantum> q;
if (!m_Bogoliubov) q.push_back(bra_quantum());
else {
SpinQuantum q_max = bra_quantum();
for (int n = 0; n <= q_max.get_n(); n+=2) {
q.push_back(SpinQuantum(n, q_max.get_s(), q_max.get_symm()));
}
}
return q;
}
bool transition_diff_irrep(){
return m_transition_diff_spatial_irrep;
}
std::vector<double>& get_orbenergies() {return m_orbenergies;}
int getHFQuanta(const SpinBlock& b) const;
const bool &do_pdm() const {return m_do_pdm;}
bool &do_pdm() {return m_do_pdm;}
const bool &do_npdm_ops() const {return m_do_npdm_ops;}
bool &do_npdm_ops() {return m_do_npdm_ops;}
const bool &do_npdm_in_core() const {return m_do_npdm_in_core;}
bool &do_npdm_in_core() {return m_do_npdm_in_core;}
bool new_npdm_code() const{
if( m_do_pdm) return m_new_npdm_code;
else return false;
}
void set_new_npdm_code(){ m_new_npdm_code= true;}
const bool &npdm_generate() const { return m_npdm_generate;}
bool &npdm_generate() { return m_npdm_generate;}
const bool &store_spinpdm() const {return m_store_spinpdm;}
bool &store_spinpdm() {return m_store_spinpdm;}
const bool &spatpdm_disk_dump() const {return m_spatpdm_disk_dump;}
bool &spatpdm_disk_dump() {return m_spatpdm_disk_dump;}
const bool &pdm_unsorted() const {return m_pdm_unsorted;}
bool &pdm_unsorted(){return m_pdm_unsorted;}
const std::vector<int> &specificpdm() const {return m_specificpdm;}
std::vector<int> &specificpdm() {return m_specificpdm;}
const bool &store_nonredundant_pdm() const { return m_store_nonredundant_pdm;}
bool &store_nonredundant_pdm() { return m_store_nonredundant_pdm;}
int slater_size() const {return m_norbs;}
const std::vector<int> &reorder_vector() {return m_reorder;}
const int &act_size() const { return m_act_size;}
const int &core_size() const { return m_core_size;}
const int &virt_size() const { return m_virt_size;}
const int &total_size() const { return m_total_orbs;}
bool spinAdapted() {return m_spinAdapted;}
const int &nevpt_state_num() const {return m_nevpt_state_num;}
bool &npdm_intermediate() { return m_npdm_intermediate; }
const bool &npdm_intermediate() const { return m_npdm_intermediate; }
bool &npdm_multinode() { return m_npdm_multinode; }
const bool &npdm_multinode() const { return m_npdm_multinode; }
};
}
#endif