TBTK
HoppingAmplitude.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_HOPPING_AMPLITUDE
24 #define COM_DAFER45_TBTK_HOPPING_AMPLITUDE
25 
26 #include "Index.h"
27 
28 #include <complex>
29 #include <initializer_list>
30 #include <vector>
31 
32 namespace TBTK{
33 
43 public:
46 
49 
52  Index fromIndex,
53  Index toIndex,
54  std::complex<double> amplitude
55  );
56 
61  Index fromIndex,
62  Index toIndex,
63  std::complex<double> (*amplitudeCallback)(Index, Index)
64  );
65 
68  std::complex<double> amplitude,
69  Index toIndex,
70  Index fromIndex
71  );
72 
77  std::complex<double> (*amplitudeCallback)(Index, Index),
78  Index toIndex,
79  Index fromIndex
80  );
81 
85  std::complex<double> amplitude,
86  Index toIndex,
87  Index fromIndex,
88  Index toUnitCell
89  );
90 
97  std::complex<double> (*amplitudeCallback)(Index, Index),
98  Index toIndex,
99  Index fromIndex,
100  Index toUnitCell
101  );
102 
105 
108 
110  void print();
111 
113  std::complex<double> getAmplitude() const;
114 private:
116  std::complex<double> amplitude;
117 
120  std::complex<double> (*amplitudeCallback)(
121  Index toIndex,
123  );
124 };
125 
126 inline std::complex<double> HoppingAmplitude::getAmplitude() const{
127  if(amplitudeCallback)
128  return amplitudeCallback(toIndex, fromIndex);
129  else
130  return amplitude;
131 }
132 
133 }; //End of namespace TBTK
134 
135 #endif
136 
void print()
Definition: HoppingAmplitude.cpp:115
Data structure for flexible physical indices.
HoppingAmplitude(Index fromIndex, Index toIndex, std::complex< double > amplitude)
std::complex< double > getAmplitude() const
Definition: HoppingAmplitude.h:126
Index toIndex
Definition: HoppingAmplitude.h:48
Definition: HoppingAmplitude.h:42
Definition: Index.h:44
Definition: AbstractOperator.h:26
Index fromIndex
Definition: HoppingAmplitude.h:45
HoppingAmplitude getHermitianConjugate() const
Definition: HoppingAmplitude.cpp:108