TBTK
Need a break? Support the development by playing Polarity Puzzles
ReciprocalLattice.h
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 
16 
18 
26 #ifndef COM_DAFER45_TBTK_RECIPROCAL_LATTICE
27 #define COM_DAFER45_TBTK_RECIPROCAL_LATTICE
28 
29 #include "TBTK/Model.h"
30 #include "TBTK/StateTreeNode.h"
31 #include "TBTK/UnitCell.h"
32 
33 #include <initializer_list>
34 #include <vector>
35 
36 namespace TBTK{
37 
69 class ReciprocalLattice{
70 public:
72  ReciprocalLattice(UnitCell *unitCell/*, std::initializer_list<int> size*/);
73 
75  ~ReciprocalLattice();
76 
78  Model* generateModel(std::initializer_list<double> momentum) const;
79 
81  Model* generateModel(std::vector<double> momentum) const;
82 
84  Model* generateModel(
85  const std::vector<std::vector<double>> &momentums,
86  const std::vector<Index> &blockIndices
87  ) const;
88 
90  const std::vector<std::vector<double>>& getReciprocalLatticeVectors() const;
91 
93  unsigned int getNumBands() const;
94 private:
96  UnitCell *unitCell;
97 
102  StateSet *realSpaceEnvironment;
103 
105  StateTreeNode *realSpaceEnvironmentStateTree;
106 
111  StateSet *realSpaceReferenceCell;
112 
114  std::vector<std::vector<double>> reciprocalLatticeVectors;
115 
118  static constexpr double ROUNDOFF_MARGIN_MULTIPLIER = 1.01;
119 
121  void setupReciprocalLatticeVectors(const UnitCell *unitCell);
122 
124  void setupRealSpaceEnvironment(const UnitCell *unitCell);
125 };
126 
127 inline const std::vector<std::vector<double>>& ReciprocalLattice::getReciprocalLatticeVectors() const{
128  return reciprocalLatticeVectors;
129 }
130 
131 inline unsigned int ReciprocalLattice::getNumBands() const{
132  return unitCell->getNumStates();
133 }
134 
135 }; //End of namespace TBTK
136 
137 #endif
138 
Container of Model related information.
Definition: Boolean.h:32