TBTK
Need a break? Support the development by playing Polarity Puzzles
GaussianState.h
1 /* Copyright 2019 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 
17 
24 #ifndef COM_DAFER45_TBTK_GAUSSIAN_STATE
25 #define COM_DAFER45_TBTK_GAUSSIAN_STATE
26 
27 #include "TBTK/AbstractState.h"
28 
29 namespace TBTK{
30 
31 class GaussianState : public AbstractState{
32 public:
34  GaussianState(
35  const Index &index,
36  const Vector3d &coordinates,
37  unsigned int linearIndex,
38  unsigned int basisSize
39  );
40 
42  virtual GaussianState* clone() const;
43 
45  virtual std::complex<double> getOverlap(
46  const AbstractState &ket
47  ) const;
48 
50  virtual std::complex<double> getMatrixElement(
51  const AbstractState &ket,
52  const AbstractOperator &o
53  ) const;
54 
60  void setOverlap(
61  const std::complex<double> &overlap,
62  unsigned int linearKetIndex
63  );
64 
70  void setKineticTerm(
71  const std::complex<double> &kineticTerm,
72  unsigned int linearKetIndex
73  );
74 
80  void setNuclearTerm(
81  const std::complex<double> &nuclearTerm,
82  unsigned int linearKetIndex
83  );
84 private:
89  unsigned int linearIndex;
90 
91  /*** Total number of basis functions that has been generated by libint,
92  * of which this is one state. */
93  unsigned int basisSize;
94 
97  std::vector<std::complex<double>> overlaps;
98 
101  std::vector<std::complex<double>> kineticTerms;
102 
105  std::vector<std::complex<double>> nuclearTerms;
106 };
107 
108 inline GaussianState* GaussianState::clone() const{
109  return new GaussianState(*this);
110 }
111 
112 inline void GaussianState::setOverlap(
113  const std::complex<double> &overlap,
114  unsigned int linearKetIndex
115 ){
116  overlaps[linearKetIndex] = overlap;
117 }
118 
119 inline void GaussianState::setKineticTerm(
120  const std::complex<double> &kineticTerm,
121  unsigned int linearKetIndex
122 ){
123  kineticTerms[linearKetIndex] = kineticTerm;
124 }
125 
126 inline void GaussianState::setNuclearTerm(
127  const std::complex<double> &nuclearTerm,
128  unsigned int linearKetIndex
129 ){
130  nuclearTerms[linearKetIndex] = nuclearTerm;
131 }
132 
133 }; //End of namespace TBTK
134 
135 #endif
136 
Definition: Boolean.h:32