TBTK
Model.h
Go to the documentation of this file.
1 /* Copyright 2016 Kristofer Björnson
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
23 #ifndef COM_DAFER45_TBTK_MODEL
24 #define COM_DAFER45_TBTK_MODEL
25 
26 #include <complex>
27 #include "AmplitudeSet.h"
28 #include <string>
29 #include <fstream>
30 
31 namespace TBTK{
32 
33 class Geometry;
34 class FileReader;
35 
40 class Model{
41 public:
43  Model();
44 
46  ~Model();
47 
49  void addHA(HoppingAmplitude ha);
50 
53 
56  int getBasisIndex(Index index);
57 
59  int getBasisSize();
60 
63  void construct();
64 
66  bool getIsConstructed();
67 
69  void constructCOO();
70 
72  void destructCOO();
73 
78  void reconstructCOO();
79 
81  void setTemperature(double temperature);
82 
84  double getTemperature();
85 
87  void setChemicalPotential(double chemicalPotential);
88 
90  double getChemicalPotential();
91 
93  enum class Statistics {FermiDirac, BoseEinstein};
94 
96  void setStatistics(Statistics statistics);
97 
100 
103 
105  void createGeometry(int dimensions, int numSpecifiers = 0);
106 
109 
110  void saveEV(std::string path = "./", std::string filename = "EV.dat");
111 
112  void setTalkative(bool isTalkative);
113 private:
115  double temperature;
116 
118  double chemicalPotential;
119 
121  Statistics statistics;
122 
125  AmplitudeSet *amplitudeSet;
126 
128  Geometry *geometry;
129 
132  bool isTalkative;
133 
135  friend class FileReader;
136 };
137 
139  amplitudeSet->addHA(ha);
140 }
141 
143  amplitudeSet->addHAAndHC(ha);
144 }
145 
146 inline int Model::getBasisSize(){
147  return amplitudeSet->getBasisSize();
148 }
149 
150 inline int Model::getBasisIndex(Index index){
151  return amplitudeSet->getBasisIndex(index);
152 }
153 
155  return amplitudeSet->getIsConstructed();
156 }
157 
158 inline void Model::constructCOO(){
159  amplitudeSet->sort();
160  amplitudeSet->constructCOO();
161 }
162 
163 inline void Model::destructCOO(){
164  amplitudeSet->destructCOO();
165 }
166 
167 inline void Model::reconstructCOO(){
168  amplitudeSet->reconstructCOO();
169 }
170 
171 inline void Model::setTemperature(double temperature){
172  this->temperature = temperature;
173 }
174 
175 inline double Model::getTemperature(){
176  return temperature;
177 }
178 
179 inline void Model::setChemicalPotential(double chemicalPotential){
180  this->chemicalPotential = chemicalPotential;
181 }
182 
184  return chemicalPotential;
185 }
186 
187 inline void Model::setStatistics(Statistics statistics){
188  this->statistics = statistics;
189 }
190 
192  return statistics;
193 }
194 
196  return amplitudeSet;
197 }
198 
200  return geometry;
201 }
202 
203 inline void Model::setTalkative(bool isTalkative){
204  this->isTalkative = isTalkative;
205 }
206 
207 }; //End of namespace TBTK
208 
209 #endif
210 
~Model()
Definition: Model.cpp:43
bool getIsConstructed()
Definition: Model.h:154
AmplitudeSet * getAmplitudeSet()
Definition: Model.h:195
void addHAAndHC(HoppingAmplitude ha)
Definition: Model.h:142
double getChemicalPotential()
Definition: Model.h:183
Statistics getStatistics()
Definition: Model.h:191
Statistics
Definition: Model.h:93
Definition: FileReader.h:46
void destructCOO()
Definition: Model.h:163
void setStatistics(Statistics statistics)
Definition: Model.h:187
void construct()
Definition: Model.cpp:57
Geometry * getGeometry()
Definition: Model.h:199
Model()
Definition: Model.cpp:34
Definition: HoppingAmplitude.h:42
HoppingAmplitude container.
void reconstructCOO()
Definition: Model.h:167
Definition: Index.h:44
Definition: AbstractOperator.h:26
int getBasisSize()
Definition: Model.h:146
void constructCOO()
Definition: Model.h:158
Definition: Geometry.h:32
void createGeometry(int dimensions, int numSpecifiers=0)
Definition: Model.cpp:69
void addHA(HoppingAmplitude ha)
Definition: Model.h:138
int getBasisIndex(Index index)
Definition: Model.h:150
double getTemperature()
Definition: Model.h:175
Definition: Model.h:40
void setChemicalPotential(double chemicalPotential)
Definition: Model.h:179
Definition: AmplitudeSet.h:45
void setTemperature(double temperature)
Definition: Model.h:171