24 #ifndef COM_DAFER45_TBTK_HARTREE_FOCK_DIAGONALIZATION
25 #define COM_DAFER45_TBTK_HARTREE_FOCK_DIAGONALIZATION
34 class HartreeFock :
public Diagonalizer{
43 public HoppingAmplitude::AmplitudeCallback,
44 public OverlapAmplitude::AmplitudeCallback
53 virtual std::complex<double> getHoppingAmplitude(
61 virtual std::complex<double> getOverlapAmplitude(
71 void setSolver(
const HartreeFock &solver);
75 const HartreeFock *solver;
82 virtual ~HartreeFock();
87 void setOccupationNumber(
unsigned int occupationNumber);
92 double getTotalEnergy()
const;
98 void addNuclearCenter(
const Atom &atom,
const Vector3d &position);
104 class PositionedAtom :
public Atom{
110 PositionedAtom(
const Atom &atom,
const Vector3d &position);
115 const Vector3d& getPosition()
const;
122 std::vector<const AbstractState*> basisStates;
125 Matrix<std::complex<double>> densityMatrix;
128 std::vector<PositionedAtom> nuclearCenters;
131 unsigned int occupationNumber;
137 class SelfConsistencyCallback :
138 public Diagonalizer::SelfConsistencyCallback
145 SelfConsistencyCallback(HartreeFock &solver);
150 virtual bool selfConsistencyCallback(
151 Diagonalizer &diagonalizer
156 } selfConsistencyCallback;
159 const Matrix<std::complex<double>>& getDensityMatrix()
const;
162 const std::vector<PositionedAtom>& getNuclearCenters()
const;
165 void calculateTotalEnergy();
168 inline void HartreeFock::setOccupationNumber(
unsigned int occupationNumber){
169 this->occupationNumber = occupationNumber;
172 inline double HartreeFock::getTotalEnergy()
const{
176 inline const Matrix<std::complex<double>>&
177 HartreeFock::getDensityMatrix()
const{
178 return densityMatrix;
181 inline void HartreeFock::addNuclearCenter(
183 const Vector3d &position
185 nuclearCenters.push_back(PositionedAtom(atom, position));
188 inline const std::vector<HartreeFock::PositionedAtom>&
189 HartreeFock::getNuclearCenters()
const{
190 return nuclearCenters;
193 inline void HartreeFock::Callbacks::setSolver(
const HartreeFock &solver){
194 this->solver = &solver;
197 inline HartreeFock::PositionedAtom::PositionedAtom(
199 const Vector3d &position
206 inline const Vector3d& HartreeFock::PositionedAtom::getPosition()
const{