TBTK
BasicState.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 
23 #ifndef COM_DAFER45_TBTK_BASIC_STATE
24 #define COM_DAFER45_TBTK_BASIC_STATE
25 
26 #include "AbstractState.h"
27 #include "Index.h"
28 #include "DefaultOperator.h"
29 
30 #include <complex>
31 #include <tuple>
32 
33 namespace TBTK{
34 
35 class BasicState : public AbstractState{
36 public:
38  BasicState(const Index &index, const Index &unitCellIndex = {});
39 
41  virtual ~BasicState();
42 
44  virtual BasicState* clone() const;
45 
47  void addOverlap(
48  std::complex<double> overlap,
49  const Index &braIndex,
50  const Index &braRelativeUnitCell = {}
51  );
52 
54  void addMatrixElement(
55  std::complex<double> matrixElement,
56  const Index &bra,
57  const Index &braRelativeUnitCell = {}
58  );
59 
61  virtual std::complex<double> getOverlap(const AbstractState &bra) const;
62 
64  virtual std::complex<double> getMatrixElement(
65  const AbstractState &bra,
67  ) const;
68 private:
72  std::vector<std::tuple<std::complex<double>, Index, Index>> overlaps;
73 
77  std::vector<std::tuple<std::complex<double>, Index, Index>> matrixElements;
78 };
79 
80 }; //End of namespace TBTK
81 
82 #endif
Data structure for flexible physical indices.
Abstract state class from which other states inherit.
void addMatrixElement(std::complex< double > matrixElement, const Index &bra, const Index &braRelativeUnitCell={})
Definition: BasicState.cpp:52
Definition: AbstractOperator.h:30
void addOverlap(std::complex< double > overlap, const Index &braIndex, const Index &braRelativeUnitCell={})
Definition: BasicState.cpp:44
BasicState(const Index &index, const Index &unitCellIndex={})
Definition: BasicState.cpp:28
virtual BasicState * clone() const
Definition: BasicState.cpp:38
Definition: AbstractState.h:37
virtual std::complex< double > getOverlap(const AbstractState &bra) const
Definition: BasicState.cpp:60
virtual ~BasicState()
Definition: BasicState.cpp:35
Definition: BasicState.h:35
Definition: Index.h:44
Definition: AbstractOperator.h:26
Default (dummy) operator class for indicating default behavior.
Definition: DefaultOperator.h:30
virtual std::complex< double > getMatrixElement(const AbstractState &bra, const AbstractOperator &o=DefaultOperator()) const
Definition: BasicState.cpp:118