File AdditiveElectronicContribution.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
AdditiveElectronicContribution
This class represents an additive electronic contribution.
On one sides it stores the matrix with the matrix elements, on the other side it is an interface for the addDerivatives<Utils::derivativeType O> methods in the derived classes.
Public Functions
-
virtual
~AdditiveElectronicContribution
() Virtual destructor.
-
virtual bool
isDensityDependent
() const = 0 Function to identify the density dependence of the electronic contribution.
-
virtual bool
isValid
() const Function to check if a contribution is already present.
Does not check for correctness.
-
virtual bool
hasMatrixContribution
() const Function to check if a contribution in form of matrix is present.
-
void
invalidate
() Invalidates the contribution, which has to be set again.
-
void
setElectronicContribution
(const SpinAdaptedMatrix &contribution) Setter function.
- Parameters
contribution
: The matrix containing the electronic contributions.
-
const SpinAdaptedMatrix &
getElectronicContribution
() const Getter for the electronic contributions.
-
virtual double
getElectronicEnergyContribution
() const = 0 Returns the energy contribution.
It needs the density matrix for the contraction of the matrix elements.
-
virtual void
calculate
(const DensityMatrix &densityMatrix, derivOrder order) = 0 Calculates the energy contribution.
For example, calculates the dipole-field interaction energy.
-
virtual void
addDerivatives
(AutomaticDifferentiation::DerivativeContainerType<derivativeType::first> &derivativeContainer) const = 0 Functions to calculate the first derivatives of the electronic contribution.
- Parameters
derivativeContainer
: A container for the derivatives up to the first order.
-
virtual void
addDerivatives
(AutomaticDifferentiation::DerivativeContainerType<derivativeType::second_atomic> &derivativeContainer) const = 0 Functions to calculate the atomic second derivatives of the electronic contribution.
- Parameters
derivativeContainer
: A container for the atomic derivatives up to the second order.
-
virtual void
addDerivatives
(AutomaticDifferentiation::DerivativeContainerType<derivativeType::second_full> &derivativeContainer) const = 0 Functions to calculate the second derivatives of the electronic contribution.
- Parameters
derivativeContainer
: A container for the derivatives up to the second order.
Private Members
-
SpinAdaptedMatrix
electronicContribution_
¶
-
bool
isValid_
= {false}¶
-
bool
hasMatrixContribution_
= {false}¶
-
virtual
-
class
-
namespace