Kindfield
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Friends Pages
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
HartreeFockSolver Class Referenceabstract

Base class for the Hartree-Fock type solvers. More...

#include <hartreefocksolver.h>

Inheritance diagram for HartreeFockSolver:
Inheritance graph
[legend]

Public Member Functions

 HartreeFockSolver (ElectronSystem *electronSystem)
 
virtual ~HartreeFockSolver ()
 
virtual void setup ()
 
virtual void advance ()
 
virtual void solve ()
 
void setElectronSystem (ElectronSystem *electronSystem)
 
ElectronSystemelectronSystem ()
 
virtual double energy ()=0
 
double convergenceTreshold () const
 
void setConvergenceTreshold (double convergenceTreshold)
 
int iterationsUsed () const
 
int nIterationsMax () const
 
void setNIterationsMax (int nIterationsMax)
 
const mat & uncoupledMatrix () const
 
const mat & overlapMatrix () const
 
const mat & transformationMatrix () const
 
const field< mat > & coupledMatrix () const
 
double densityMixFactor () const
 
void setDensityMixFactor (double densityMixFactor)
 

Public Attributes

double alpha [4]
 

Protected Member Functions

void setupIntegralMatrices ()
 
void normalizeCoefficientMatrix (uint nParticles, mat &coefficientMatrix)
 

Protected Attributes

int m_iterationsUsed
 

Detailed Description

Base class for the Hartree-Fock type solvers.

Solver for the Pople-Nesbet equations.

Definition at line 11 of file hartreefocksolver.h.

Constructor & Destructor Documentation

HartreeFockSolver::HartreeFockSolver ( ElectronSystem electronSystem)
explicit

Definition at line 17 of file hartreefocksolver.cpp.

17  :
18  m_electronSystem(basisFunction),
19  m_convergenceTreshold(1e-8),
20  m_nIterationsMax(1e3),
21  m_densityMixFactor(0.5),
22  m_hasBeenSetup(false)
23 {
24 }
HartreeFockSolver::~HartreeFockSolver ( )
virtual

Definition at line 26 of file hartreefocksolver.cpp.

27 {
28  cleanUpCoupledMatrix();
29 }

Member Function Documentation

void HartreeFockSolver::advance ( )
virtual

Reimplemented in RestrictedHartreeFockSolver, and UnrestrictedHartreeFockSolver.

Definition at line 38 of file hartreefocksolver.cpp.

39 {
40  if(!m_hasBeenSetup) {
41  setup();
42  }
43 }
double HartreeFockSolver::convergenceTreshold ( ) const

Definition at line 164 of file hartreefocksolver.cpp.

165 {
166  return m_convergenceTreshold;
167 }
const field< mat > & HartreeFockSolver::coupledMatrix ( ) const

Definition at line 191 of file hartreefocksolver.cpp.

192 {
193  return m_coupledMatrix;
194 }
double HartreeFockSolver::densityMixFactor ( ) const

Definition at line 211 of file hartreefocksolver.cpp.

212 {
213  return m_densityMixFactor;
214 }
ElectronSystem * HartreeFockSolver::electronSystem ( )

Definition at line 178 of file hartreefocksolver.cpp.

178  {
179  return m_electronSystem;
180 }
virtual double HartreeFockSolver::energy ( )
pure virtual
int HartreeFockSolver::iterationsUsed ( ) const

Definition at line 159 of file hartreefocksolver.cpp.

160 {
161  return m_iterationsUsed;
162 }
int HartreeFockSolver::nIterationsMax ( ) const

Definition at line 196 of file hartreefocksolver.cpp.

197 {
198  return m_nIterationsMax;
199 }
void HartreeFockSolver::normalizeCoefficientMatrix ( uint  nParticles,
mat &  coefficientMatrix 
)
protected

Definition at line 140 of file hartreefocksolver.cpp.

140  {
141  ElectronSystem* f = m_electronSystem;
142  uint no = f->nBasisFunctions();
143  uint nk = nParticles;
144 
145  const mat& S = m_overlapMatrix;
146  mat& C = coefficientMatrix;
147 
148  for(uint k = 0; k < nk; k++) {
149  double factor = 0.0;
150  for(uint p = 0; p < no; p++){
151  for(uint q = 0; q < no; q++){
152  factor += C(p,k) * S(p,q) * C(q,k);
153  }
154  }
155  C.col(k) = C.col(k) / sqrt(factor);
156  }
157 }
const mat & HartreeFockSolver::overlapMatrix ( ) const

Definition at line 182 of file hartreefocksolver.cpp.

182  {
183  return m_overlapMatrix;
184 }
void HartreeFockSolver::setConvergenceTreshold ( double  convergenceTreshold)

Definition at line 169 of file hartreefocksolver.cpp.

170 {
171  m_convergenceTreshold = convergenceTreshold;
172 }
void HartreeFockSolver::setDensityMixFactor ( double  densityMixFactor)

Definition at line 216 of file hartreefocksolver.cpp.

217 {
218  m_densityMixFactor = densityMixFactor;
219 }
void HartreeFockSolver::setElectronSystem ( ElectronSystem electronSystem)

Definition at line 174 of file hartreefocksolver.cpp.

174  {
175  m_electronSystem = basisFunction;
176 }
void HartreeFockSolver::setNIterationsMax ( int  nIterationsMax)

Definition at line 201 of file hartreefocksolver.cpp.

202 {
203  m_nIterationsMax = nIterationsMax;
204 }
void HartreeFockSolver::setup ( )
virtual

Reimplemented in RestrictedHartreeFockSolver, and UnrestrictedHartreeFockSolver.

Definition at line 31 of file hartreefocksolver.cpp.

32 {
33  allocateCoupledMatrix();
35  m_hasBeenSetup = true;
36 }
void HartreeFockSolver::setupIntegralMatrices ( )
protected

Definition at line 52 of file hartreefocksolver.cpp.

53 {
54  setupUncoupledMatrix();
55  setupOverlapMatrix();
56  setupTransformationMatrix();
57  setupCoupledMatrix();
58 }
void HartreeFockSolver::solve ( )
virtual

Reimplemented in RestrictedHartreeFockSolver, and UnrestrictedHartreeFockSolver.

Definition at line 45 of file hartreefocksolver.cpp.

46 {
47  if(!m_hasBeenSetup) {
48  setup();
49  }
50 }
const mat & HartreeFockSolver::transformationMatrix ( ) const

Definition at line 186 of file hartreefocksolver.cpp.

187 {
188  return m_transformationMatrix;
189 }
const mat & HartreeFockSolver::uncoupledMatrix ( ) const

Definition at line 206 of file hartreefocksolver.cpp.

207 {
208  return m_uncoupledMatrix;
209 }

Member Data Documentation

double HartreeFockSolver::alpha[4]

Definition at line 18 of file hartreefocksolver.h.

int HartreeFockSolver::m_iterationsUsed
protected

Definition at line 47 of file hartreefocksolver.h.


The documentation for this class was generated from the following files: