QNANO
Finite_Manybody_Hilbert_Space.h
1 #ifndef QNANO_NEW_FINITE_MANYBODY_HILBERT_SPACE_DEFINED_H
2 #define QNANO_NEW_FINITE_MANYBODY_HILBERT_SPACE_DEFINED_H
3 
4 #include "tools/Parameter_Map.h"
5 #include "tools/Organize_Blocks.h"
6 #include "manybody/Fermion_Double_Index.h"
7 #include "manybody/Manybody_Hilbert_Space.h"
8 #include "tools/Binomial.h"
9 
18 protected:
19 // int rank_e, rank_h; ///nr of electrons/holes
20 //->Manybody_Hilbert_Space int nr_e, nr_h; ///nr of electron/hole _states_
21 
22  int dim_e, dim_h;
23 
24 public:
25 // inline int get_rank_e()const{return rank_e;}
26 // inline int get_rank_h()const{return rank_h;}
27 //->Manybody_Hilbert_Space inline int get_nr_e()const{return nr_e;}
28 //->Manybody_Hilbert_Space inline int get_nr_h()const{return nr_h;}
29  inline int get_dim_e()const{return dim_e;}
30  inline int get_dim_h()const{return dim_h;}
31  virtual size_t size()const{return get_dim_e()*get_dim_h();}
32 
33  virtual void resize(int rk_e, int rk_h, int n_e, int n_h){
34  Manybody_Hilbert_Space::resize(rk_e,rk_h,n_e,n_h);
35 // rank_e=rk_e; rank_h=rk_h; nr_e=n_e; nr_h=n_h;
36  recalc_dims();
37  }
38  virtual void setup(Parameter_Map &param_map){
39  Manybody_Hilbert_Space::setup(param_map);
40 /*
41  rank_e=param_map.get_as_double("rank_e",0);
42  rank_h=param_map.get_as_double("rank_h",0);
43  nr_e=param_map.get_as_double("nr_e",0);
44  nr_h=param_map.get_as_double("nr_h",0);
45 */
46  recalc_dims();
47  }
48 
49 
50  // recall: get_DIM inherited from Organiz_Blocks
51 
52 
53  virtual void recalc_dims();
54 
55  virtual int get_Index_from_Fermion_Index(const Fermion_Index & fi, bool hole)const;
56  virtual int get_index(const Fermion_Double_Index & fi)const;
57 
58  virtual Fermion_Index get_Fermion_Index_from_Index(int index, bool hole)const;
59  virtual Fermion_Double_Index get_Fermion_Double_Index(int index)const;
60 
61  //test the Fermion_Double_Index <-> index relation
62  virtual void dump_indices(const std::string &filename)const;
63 
65  virtual Finite_Manybody_Hilbert_Space* clone() const;
66  virtual void copy(const Finite_Manybody_Hilbert_Space &other){
67  rank_e=other.rank_e;
68  rank_h=other.rank_h;
69  nr_e=other.nr_e;
70  nr_h=other.nr_h;
71  dim_e=other.dim_e;
72  dim_h=other.dim_h;
73  }
75  copy(other);
76  return *this;
77  }
79  copy(other);
80  }
82  rank_e=rank_h=nr_e=nr_h=dim_e=dim_h=0;
83  }
85  setup(param_map);
86  }
87  Finite_Manybody_Hilbert_Space(int rk_e, int rk_h, int n_e, int n_h){
88  rank_e=rk_e; rank_h=rk_h; nr_e=n_e; nr_h=n_h;
89  recalc_dims();
90  }
91 
92  virtual bool is_Full_Hilbert_Space() const;
93 };
94 
95 #endif
Definition: Parameter_Map.h:12
Definition: Manybody_Hilbert_Space.h:8
int get_dim_e() const
dimensions of the electron and hole parts separately. Calculated in recalc_nr_blocks() ...
Definition: Finite_Manybody_Hilbert_Space.h:29
virtual bool is_Full_Hilbert_Space() const
indicates if Instance is the full Hilbert space with all states defined by rank_e/h and nr_e/h ...
Definition: Finite_Manybody_Hilbert_Space.cc:4
Definition: Fermion_Double_Index.h:14
int nr_e
nr of electrons/holes
Definition: Manybody_Hilbert_Space.h:11
virtual Finite_Manybody_Hilbert_Space * clone() const
Clone & Constructors.
Definition: Finite_Manybody_Hilbert_Space.cc:95
Definition: Fermion_Index.h:19
Definition: Finite_Manybody_Hilbert_Space.h:17