QNANO
Eigenvector_Printer.h
1 #ifndef QNANO_NEW_EIGENVECTOR_PRINTER_DEFINED_H
2 #define QNANO_NEW_EIGENVECTOR_PRINTER_DEFINED_H
3 
4 #include "orbitals/Organize_Blocks_By_Orbital_List.h"
5 #include "tools/Parameter_Map.h"
6 
7 
9 protected:
10  bool delete_orb_blocks_on_destruction;
11  bool spinless;
12 public:
13 
14  int round_figure;
15  std::string EV_filename_pattern;
16  std::string eigenvalue_filename;
17  int nr_print;
18  bool override_printEV;
19  std::string EV_header;
20  std::vector<std::string> EV_header_individual;
21  bool print_sparse;
22  double print_sparse_cutoff;
23  bool print_error_cout;
24  bool silent;
25 
28  double kramers_tolerance;
29  //Eigenvector_Printer_Kramers_Data kramers; <- might remove class eventually?
30 
31 
32  Organize_Blocks *orb_blocks;
33  bool orbs_are_spinless()const{return spinless;}
34 
35  //function that defines how the state indices are printed
36  std::string (*sparse_print_index)(size_t line_counter, void* spi_ctx);
37  void* spi_ctx;
38  static std::string sparse_print_index_default(size_t line_counter, void* spi_ctx);
39 
40 
41  virtual void setup(Parameter_Map &param_map);
42 
43  const std::string & get_EV_header(int i) const;
44 
45  //prints (and defines printing format) of a block of states to a string
46  void print_block(std::string &str, std::complex<double> *ptr, int blocksize, int baseindex)const;
47 
48 
49  //implementation specific: nr of converged eigenpairs and i-th eigenvalue
50  virtual int get_n_converged() const=0;
51  virtual double get_eigenvalue(int i) const=0;
52  virtual int get_actual_nr_print()const;
53 
54  //(abstract) functions for printing
55  virtual void print() const;
56  virtual void print_eigenvalues()const;
57  virtual void print_eigenvector(int n_print)const=0;
58  //print when print_Kramers_sz is set; default: just print state i and i+1
59  virtual void print_eigenvector_Kramers(int i)const;
60  virtual bool has_Kramers_partner(int i)const;
61  //calculate alpha and beta for Kramers rotation
62  virtual void calculate_alpha_beta_Kramers_sz( \
63  std::complex<double> &alpha, std::complex<double> &beta, int i) const;
64  //obtain phase factor of orbital with maximal density
65  virtual std::complex<double> calculate_max_phase_factor( \
66  std::complex<double> alpha, std::complex<double> beta, int i) const;
67 
68 
69 
70 
71  Eigenvector_Printer(Organize_Blocks *org, bool spinless_=true)
72  : delete_orb_blocks_on_destruction(false),
73  spinless(spinless_), orb_blocks(org) {
74  }
75  Eigenvector_Printer(size_t DIM, bool spinless_=true)
76  : delete_orb_blocks_on_destruction(true), spinless(spinless_),
77  orb_blocks(new Organize_Blocks_Equal(1,DIM)){
78  }
79  virtual ~Eigenvector_Printer(){
80  if(delete_orb_blocks_on_destruction){
81  delete orb_blocks;
82  }
83  }
84 };
85 
86 #endif
Definition: Organize_Blocks.h:13
Definition: Parameter_Map.h:12
virtual void setup(Parameter_Map &param_map)
Definition: Eigenvector_Printer.cc:35
bool print_Kramers_sz
variables dealing with Kramers pairs:
Definition: Eigenvector_Printer.h:27
Definition: Eigenvector_Printer.h:8
Definition: Organize_Blocks.h:28