QNANO
Selected_Manybody_Hilbert_Space.h
1 #ifndef QNANO_NEW_SELECTED_MANYBODY_HILBERT_SPACE_DEFINED_H
2 #define QNANO_NEW_SELECTED_MANYBODY_HILBERT_SPACE_DEFINED_H
3 
4 #include "manybody/Manybody_Hilbert_Space.h"
5 #include "manybody/Selected_Manybody_States_with_Hash_Table.h"
6 
8 public:
10 
11  virtual void setup(Parameter_Map &param_map, bool do_print=false);
12  virtual size_t size()const{return states.size();}
13  virtual int get_index(const Fermion_Double_Index & fi)const;
14  virtual Fermion_Double_Index get_Fermion_Double_Index(int index)const;
15 
16  void add_singles(){
17  states.add_singles(nr_e,nr_h);
18  }
19 
21  virtual Selected_Manybody_Hilbert_Space* clone() const;
22  //Copy from Selected_Manybody_Hilbert_Space:
23  virtual void copy(const Selected_Manybody_Hilbert_Space &other){
24  rank_e=other.rank_e;
25  rank_h=other.rank_h;
26  nr_e=other.nr_e;
27  nr_h=other.nr_h;
28  states=other.states;
29  }
31  copy(other);
32  return *this;
33  }
35  copy(other);
36  }
37 
39  virtual void copy(const Manybody_Hilbert_Space &other){
40  rank_e=other.rank_e;
41  rank_h=other.rank_h;
42  nr_e=other.nr_e;
43  nr_h=other.nr_h;
44  states.clear();
45  for(size_t i=0; i<other.size(); i++){
46  Fermion_Double_Index fi=other.get_Fermion_Double_Index(i);
47  states.add_if_not_contained(fi);
48  }
49  }
51  copy(other);
52  return *this;
53  }
55  copy(other);
56  }
57 
58 
59  //Constructor from parameters
60  Selected_Manybody_Hilbert_Space(Parameter_Map &param_map, bool do_print=false){
61  setup(param_map, do_print);
62  }
63 };
64 
65 #endif
virtual void copy(const Manybody_Hilbert_Space &other)
Copy from more general Manybody_Hilbert_Space:
Definition: Selected_Manybody_Hilbert_Space.h:39
Definition: Parameter_Map.h:12
virtual Selected_Manybody_Hilbert_Space * clone() const
Clone.
Definition: Selected_Manybody_Hilbert_Space.cc:64
Definition: Manybody_Hilbert_Space.h:8
Definition: Fermion_Double_Index.h:14
int nr_e
nr of electrons/holes
Definition: Manybody_Hilbert_Space.h:11
Definition: Selected_Manybody_Hilbert_Space.h:7
Definition: Selected_Manybody_States_with_Hash_Table.h:8