File SCFMethod.h

Copyright

This code is licensed under the 3-clause BSD license.

Copyright ETH Zurich, Laboratory for Physical Chemistry, Reiher Group.

See LICENSE.txt for details.

namespace Scine

This header file contains functions that allow for common notation for common things that can be done at a different degree of derivatives.

This header contains alias definitions defining which classes to use for the different degrees of derivatives.

namespace Utils
class SCFMethod : public Scine::Utils::LCAOMethod
#include <SCFMethod.h>

Base class for self-consistent-field methods.

Steps of SCF calculations

void calculateDensityDependentQuantities(Utils::derivativeType d = Utils::derivativeType::first)
void finalizeCalculation(Utils::derivativeType d = Utils::derivativeType::first)

Public Functions

SCFMethod(bool unrestrictedCalculationPossible, Utils::derivOrder maximalOrder, bool orthogonalBasisSet = false)
~SCFMethod()
void initialize()

Initialize the method after the parameters have been set or loaded.

void calculate(Utils::derivativeType d)

Performs one single-point calculation of the energy.

Parameters
  • derivativesOrder: which derivative to calculate up to, if possible.

void addModifier(std::shared_ptr<SCFModifier> modifier, int priority = 5)

Adds a modifier to the SCF method. First checks whether the SCFModifier already exists. Will call the functions setMethod(…) and initialize of modifier.

Parameters
  • priority: Number from 0 (early) to 10 (late) to set when the modifier will be called compared to other ones.

void removeModifier(const std::shared_ptr<SCFModifier> &modifier)

Removes the SCF modifier.

void convergedCalculation(Utils::derivativeType d = Utils::derivativeType::first)

Performs a converged calculation of the energy (NB: will stop after max number of cycles).

void performIteration(Utils::derivativeType d = Utils::derivativeType::first)
bool hasConverged() const
int getNumberIterations() const

Returns the number of iterations that were performed for the energy calculation.

void setScfMixer(scf_mixer_t mixer)
scf_mixer_t getScfMixer() const
void setConvergenceCriteria(double c)

Set the convergence threshold for a SCF calculation (RMSD of density matrix)

double getConvergenceThreshold() const

Get the currently applied threshold for SCF calculation.

void setMaxIterations(int max)
void resetConvergenceCheck()

Reset the convergence check; is useful if the starting density matrix in the SCF cycle is not the last one of the previous cycle.

int getMaxNumberIterations() const
void reinitializeDensityMatrixGuess()

Reset the density matrix.

DensityMatrix getDensityMatrixGuess() const

Returns the density matrix guess for the vurrent system

void evaluateDensity(Utils::derivativeType derivativeOrder)

Perform a calculation for the current density matrix without optimizing it.

Protected Attributes

std::shared_ptr<DensityMatrixGuessCalculator> densityMatrixGuess_
bool converged
int performedIterations_
int maxIterations

Private Types

using ModifierContainer = std::multimap<int, std::shared_ptr<SCFModifier>>

Private Functions

void solveEigenValueProblem()
void onConvergedCalculationStarts()

Private Members

ModifierContainer modifiers
ConvergenceChecker convergenceChecker_
ScfConvergenceAccelerator convergenceAccelerator_