QNANO
Manybody_Hamiltonian.h
1 #ifndef QNANO_NEW_MANYBODY_HAMILTONIAN_DENSE_DEFINED_H
2 #define QNANO_NEW_MANYBODY_HAMILTONIAN_DENSE_DEFINED_H
3 
4 #include "tools/QNANO_Matrix.h"
5 #include "tools/Sparse_Matrix_Generator.h"
6 #include "manybody/Finite_Manybody_Hilbert_Space.h"
7 #include "manybody/Selected_Manybody_Hilbert_Space.h"
8 #include "manybody/Coulomb_Matrix_Elements.h"
9 #include "manybody/Manybody_Eigenvector.h"
10 #include "tools/Map.h"
11 #include "manybody/CdaggerCdaggerCC_Iterator.h"
12 
13 
15 public:
16  bool no_dir, no_exc, no_ee, no_hh;
17  Coulomb_Matrix_Elements Vdir, Vexc, Vee, Vhh;
18 
19  bool use_offdiag_energies_e;
20  bool use_offdiag_energies_h;
21  std::vector<double> cb_energies;
22  std::vector<double> vb_energies;
23  QNANO_Matrix cb_energies_mat;
24  QNANO_Matrix vb_energies_mat;
25 
26 
27  Manybody_Hilbert_Space *hilbert;
28 
29  void setup(Parameter_Map &param_map, bool do_print=false);
30  void setup_energies(Parameter_Map &param_map);
31  void setup_Organize_Blocks();
32  void replace_hilbert_space(const Manybody_Hilbert_Space &hs);
33 
34  virtual void get_Matrix_row_block( std::vector< col_val > & col_val_vec, const Fermion_Double_Index &fi);
35  virtual void get_Matrix_row_block( std::vector< col_val > & col_val_vec, const int atom_index);
36 
37  //helper functions for get_Matrix_row_block
38  void add_eh_terms(Map<std::complex<double> > &col_val_map, const Fermion_Double_Index &fi)const;
39  void add_ee_terms(Map<std::complex<double> > &col_val_map, const Fermion_Double_Index &fi)const;
40  void add_hh_terms(Map<std::complex<double> > &col_val_map, const Fermion_Double_Index &fi)const;
41 
42  double get_diagonal(const Fermion_Double_Index &fi)const;
43 
45 
46  //Constructors
47  void copy(const Manybody_Hamiltonian &other){
48  //Sparse_Matrix_Generator
49  Organize_Blocks_Single_Forward::copy(other);
50 
51  no_dir=other.no_dir;
52  no_exc=other.no_exc;
53  no_ee=other.no_ee;
54  no_hh=other.no_hh;
55  Vdir.copy(other.Vdir);
56  Vexc.copy(other.Vexc);
57  Vee.copy(other.Vee);
58  Vhh.copy(other.Vhh);
59  cb_energies=other.cb_energies;
60  vb_energies=other.vb_energies;
61 
62  hilbert=other.hilbert->clone();
63  }
64  Manybody_Hamiltonian &operator=(const Manybody_Hamiltonian &other){
65  copy(other);
66  return *this;
67  }
69  copy(other);
70  }
71  Manybody_Hamiltonian() : hilbert(NULL){
72  Parameter_Map param_map;
73  setup(param_map);
74  }
75  Manybody_Hamiltonian(Parameter_Map &param_map) : hilbert(NULL){
76  setup(param_map);
77  }
78 
79  virtual ~Manybody_Hamiltonian(){
80  if(hilbert!=NULL)delete hilbert;
81  }
82 };
83 
84 #endif
Definition: Parameter_Map.h:12
Definition: Manybody_Hilbert_Space.h:8
Definition: Coulomb_Matrix_Elements.h:13
Definition: Sparse_Matrix_Generator.h:22
Definition: Fermion_Double_Index.h:14
Definition: Organize_Blocks.h:55
Definition: Map.h:10
Definition: Manybody_Eigenvector.h:10
Definition: Manybody_Hamiltonian.h:14
Definition: QNANO_Matrix.h:7