Namespace Scine¶
-
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
Typedefs
-
using
PropertyTypeTuple
= std::tuple<double, GradientCollection, HessianMatrix, Dipole, DipoleGradient, DipoleMatrix, DipoleMatrix, DensityMatrix, Eigen::MatrixXd, SpinAdaptedMatrix, Eigen::MatrixXd, MolecularOrbitals, SingleParticleEnergies, LcaoUtils::ElectronicOccupation, ThermochemicalComponentsContainer, SpinAdaptedElectronicTransitionResult, AtomsOrbitalsIndexes, std::vector<double>, BondOrderCollection, std::string, bool, std::string>
-
using
Bohr
= StrongType<double, struct BohrType>
-
using
Angstrom
= StrongType<double, struct AngstromType>
-
using
Hartree
= StrongType<double, struct HartreeType>
-
using
kJPerMol
= StrongType<double, struct kJPerMolType>
-
using
kCalPerMol
= StrongType<double, struct kCalPerMolType>
-
using
eV
= StrongType<double, struct eVType>
-
using
SecondDerivative
= AutomaticDifferentiation::Second3D
-
using
EigenContainer
= std::pair<Eigen::VectorXd, Eigen::MatrixXd> Alias for a pair of eigenvalues and eigenvectors.
-
using
Displacement
= Eigen::RowVector3d
-
using
DisplacementCollection
= Eigen::Matrix<double, Eigen::Dynamic, 3, Eigen::RowMajor>
-
using
ElementTypeCollection
= std::vector<ElementType>
-
using
Gradient
= Eigen::RowVector3d
-
using
GradientCollection
= Eigen::Matrix<double, Eigen::Dynamic, 3, Eigen::RowMajor>
-
using
HessianMatrix
= Eigen::MatrixXd
-
using
Dipole
= Eigen::RowVector3d
-
using
DipoleGradient
= Eigen::Matrix<double, Eigen::Dynamic, 3, Eigen::RowMajor>
-
using
Position
= Eigen::RowVector3d
-
using
PositionCollection
= Eigen::Matrix<double, Eigen::Dynamic, 3, Eigen::RowMajor>
Enums
-
enum
Property
The properties contained are assigned a bit. This can be switched on or off to flag the presence or absence of the property.
Values:
-
Energy
= (1 << 0)
-
Gradients
= (1 << 1)
-
Hessian
= (1 << 2)
-
Dipole
= (1 << 3)
-
DipoleGradient
= (1 << 4)
-
DipoleMatrixAO
= (1 << 5)
-
DipoleMatrixMO
= (1 << 6)
-
DensityMatrix
= (1 << 7)
-
OneElectronMatrix
= (1 << 8)
-
TwoElectronMatrix
= (1 << 9)
-
OverlapMatrix
= (1 << 10)
-
CoefficientMatrix
= (1 << 11)
-
OrbitalEnergies
= (1 << 12)
-
ElectronicOccupation
= (1 << 13)
-
Thermochemistry
= (1 << 14)
-
ExcitedStates
= (1 << 15)
-
AOtoAtomMapping
= (1 << 16)
-
AtomicCharges
= (1 << 17)
-
BondOrderMatrix
= (1 << 18)
-
Description
= (1 << 19)
-
SuccessfulCalculation
= (1 << 20)
-
ProgramName
= (1 << 21)
-
-
enum
ElementType
Enum class defining all elements and isotopes.
Values:
-
none
= 0
-
H
= 1
-
He
= 2
-
Li
= 3
-
B
= 5
-
C
= 6
-
N
= 7
-
O
= 8
-
Ne
= 10
-
Mg
= 12
-
Si
= 14
-
S
= 16
-
Cl
= 17
-
Ar
= 18
-
K
= 19
-
Ca
= 20
-
Ti
= 22
-
V
= 23
-
Cr
= 24
-
Fe
= 26
-
Ni
= 28
-
Cu
= 29
-
Zn
= 30
-
Ga
= 31
-
Ge
= 32
-
Se
= 34
-
Br
= 35
-
Kr
= 36
-
Rb
= 37
-
Sr
= 38
-
Zr
= 40
-
Mo
= 42
-
Tc
= 43
-
Ru
= 44
-
Pd
= 46
-
Ag
= 47
-
Cd
= 48
-
In
= 49
-
Sn
= 50
-
Sb
= 51
-
Te
= 52
-
Xe
= 54
-
Ba
= 56
-
La
= 57
-
Ce
= 58
-
Nd
= 60
-
Pm
= 61
-
Sm
= 62
-
Eu
= 63
-
Gd
= 64
-
Dy
= 66
-
Er
= 68
-
Yb
= 70
-
Lu
= 71
-
Hf
= 72
-
Ta
= 73
-
W
= 74
-
Re
= 75
-
Os
= 76
-
Ir
= 77
-
Pt
= 78
-
Hg
= 80
-
Tl
= 81
-
Pb
= 82
-
Po
= 84
-
At
= 85
-
Rn
= 86
-
Ra
= 88
-
Th
= 90
-
U
= 92
-
Np
= 93
-
Pu
= 94
-
Am
= 95
-
Cm
= 96
-
Bk
= 97
-
Cf
= 98
-
Md
= 101
-
Be9
= Be
-
F19
= F
-
Na23
= Na
-
Al27
= Al
-
P31
= P
-
Sc45
= Sc
-
Mn55
= Mn
-
Co59
= Co
-
As75
= As
-
Y89
= Y
-
Nb93
= Nb
-
Rh103
= Rh
-
I127
= I
-
Cs133
= Cs
-
Pr141
= Pr
-
Tb159
= Tb
-
Ho165
= Ho
-
Tm169
= Tm
-
Au197
= Au
-
Bi209
= Bi
-
Fr223
= Fr
-
Ac227
= Ac
-
Pa231
= Pa
-
Es252
= Es
-
Fm257
= Fm
-
No259
= No
-
Lr262
= Lr
-
Rf267
= Rf
-
Db268
= Db
-
Sg271
= Sg
-
Bh272
= Bh
-
Hs270
= Hs
-
Mt276
= Mt
-
Ds281
= Ds
-
Rg280
= Rg
-
Cn285
= Cn
-
-
enum
derivOrder
Values:
-
zero
-
one
-
two
-
-
enum
derivativeType
Values:
-
none
-
first
-
second_atomic
-
second_full
-
-
enum
DavidsonDirectType
Values:
-
standard
-
direct
-
-
enum
DavidsonBalancedType
Values:
-
standard
-
balanced
-
-
enum
SpinTransition
Values:
-
singlet
-
triplet
-
-
enum
ZPVEInclusion
In NDDO semiempirical methods, the ZPVE is already included in the electronic energy due to the way they are parametrized.
In the thermochemical calculation it must then not be included again.
Values:
-
alreadyIncluded
-
notIncluded
-
-
enum
scf_mixer_t
Enum class describing the available Scf convergence accelerators (“mixers”).
Values:
-
none
Element representing no accelerator at all.
-
fock_diis
The Fock Direct Inversion of Iterative Subspace convergence accelerator (default).
-
ediis
The Energy DIIS convergence accelerator.
-
ediis_diis
Combination of the previous two.
-
fock_simple
A simple fock extrapolation scheme. Does not work that well.
-
charge_simple
Very simple charge extrapolation scheme. Does not work that well.
-
Functions
-
constexpr unsigned
getPropertyIndex
(Property property)
-
constexpr const char *
propertyTypeName
(Property property)
-
constexpr Property
operator|
(Property v1, Property v2) Returns a Property object that is the superset of the two properties given as argument.
Allow combination of properties.
-
constexpr bool
operator&
(Property v1, Property v2) Returns a Property object that is the subset of the two properties given as argument.
Allow to check if there is a flag overlap.
-
constexpr double
toAngstrom
(Bohr b) Conversion from Bohr to Angstrom.
- Return
constexpr double Returns the length in Angstrom.
- Parameters
b
: Length in/as Bohr.
-
constexpr double
toBohr
(Angstrom a) Conversion from Angstrom to Bohr.
- Return
constexpr double Returns the length in Bohr.
- Parameters
a
: Length in/as Angstrom.
-
constexpr double
toKJPerMol
(Hartree h) Conversion from Hartree to kJ/mol.
- Return
constexpr double Returns the energy in kJ/mol.
- Parameters
h
: Energy in/as Hartree.
-
constexpr double
toHartree
(kJPerMol kjpm) Conversion from kJ/mol to Hartree.
- Return
constexpr double Returns the energy in Hartree.
- Parameters
kjpm
: Energy in/as kJ/mol.
-
constexpr double
toKCalPerMol
(Hartree h) Conversion from Hartree to kcal/mol.
- Return
constexpr double Returns the energy in kcal/mol.
- Parameters
h
: Energy in/as Hartree.
-
constexpr double
toHartree
(kCalPerMol kcpm) Conversion from kcal/mol to Hartree.
- Return
constexpr double Returns the energy in Hartree.
- Parameters
kcpm
: Energy in/as kcal/mol.
-
template<>
MatrixWithDerivatives::Matrix0 &get
<derivOrder::zero>()
-
template<>
MatrixWithDerivatives::Matrix1 &get
<derivOrder::one>()
-
template<>
MatrixWithDerivatives::Matrix2 &get
<derivOrder::two>()
-
template<>
const MatrixWithDerivatives::Matrix0 &get
<derivOrder::zero>() const
-
template<>
const MatrixWithDerivatives::Matrix1 &get
<derivOrder::one>() const
-
template<>
const MatrixWithDerivatives::Matrix2 &get
<derivOrder::two>() const
-
std::string
generateChemicalFormula
(const ElementTypeCollection &elements, const std::string &numberPrefix = "", const std::string &numberPostfix = "") This function returns the elemental composition of a compound based on its ElementTypeCollection.
The convention is the Hill Order System. It starts with C, then H, then all the other elements in alphabetical order. Returns “(empty)” if elements is empty.
- Return
std::string The final string.
- Parameters
elements
: The collection of elements to be transcribed.numberPrefix
: Characters to put before each number for rich text formats (Latex etc).numberPostfix
: Characters to put after each number for rich text formats (Latex etc).
-
std::string
singleElementPartOfFormula
(std::string symbol, int numberOccurrences, const std::string &numberPrefix, const std::string &numberPostfix) This function transcribes a single element into a string.
- Return
std::string The final string.
- Parameters
symbol
: The element symbolnumberOccurrences
: The number of times the element is present in a given structure.numberPrefix
: Characters to put before each number for rich text formats (Latex etc).numberPostfix
: Characters to put after each number for rich text formats (Latex etc).
-
template<class
MatrixType
>
std::pair<int, int>getMatrixDimensions
(const MatrixType &matrix)
-
template<>
std::pair<int, int>getMatrixDimensions
(const Eigen::MatrixXd &matrix)
-
template<>
std::pair<int, int>getMatrixDimensions
(const Eigen::Matrix<double, Eigen::Dynamic, 3, Eigen::RowMajor> &matrix)
-
template<class
MatrixType
>
doublegetElement
(int row, int col, const MatrixType &matrix)
-
template<>
doublegetElement
(int row, int col, const Eigen::MatrixXd &matrix)
-
template<>
doublegetElement
(int row, int col, const Eigen::Matrix<double, Eigen::Dynamic, 3, Eigen::RowMajor> &matrix)
-
template<>
doublegetElement
(int row, int col, const NormalModesContainer &matrix)
-
template<class
MatrixType
>
voidmatrixPrettyPrint
(std::ostream &out, const MatrixType &matrix)
-
void
printElement
(std::ostream &out, const Eigen::SparseMatrix<double>::InnerIterator &it)
-
void
matrixPrettyPrint
(std::ostream &out, const Eigen::SparseMatrix<double> matrix, double threshold)
-
void
matrixPrettyPrint
(std::ostream &out, const NormalModesContainer &container, const ElementTypeCollection &elementTypes)
-
void
prettyPrint
(std::ostream &out, const ThermochemicalComponentsContainer &thermochemicalComponents)
-
template<typename ...
Args
>
std::stringformat
(const std::string &format, Args... args) Generates a std::string from a format expression.
Note that std::string arguments for ‘s’ expressions need to be given as ‘char*’ e.g. ‘foo’ as ‘foo.c_str()’.
- Return
std::string The resulting string.
- Template Parameters
Args
: The variable types to be formatted.
- Parameters
format
: The string containing format identifiers.args
: The variables to be formatted.
-
static void
nodeToSettings
(Utils::Settings &settings, YAML::Node node, bool allowSuperfluous = false) Parses data from a YAML::Node (yaml-cpp) into the value collection of a settings object.
- Parameters
settings
: The settings.node
: The read yaml node.allowSuperfluous
: It true, the function will ignore kys in the node that are not present in the settings object. If false, the function will throw an error if such a case is encountered.
-
Tensor33
tensor
(const Eigen::Vector3d &a, const Eigen::Vector3d &b)
Variables
-
constexpr std::array<Property, std::tuple_size<PropertyTypeTuple>::value> Scine::Utils::allProperties{{Property::Energy, Property::Gradients, Property::Hessian, Property::Dipole, Property::DipoleGradient, Property::DipoleMatrixAO, Property::DipoleMatrixMO, Property::DensityMatrix, Property::OneElectronMatrix, Property::TwoElectronMatrix, Property::OverlapMatrix, Property::CoefficientMatrix, Property::OrbitalEnergies, Property::ElectronicOccupation, Property::Thermochemistry, Property::ExcitedStates, Property::AOtoAtomMapping, Property::AtomicCharges, Property::BondOrderMatrix, Property::Description, Property::SuccessfulCalculation, Property::ProgramName}}
-
constexpr std::array<const char *, std::tuple_size<PropertyTypeTuple>::value>
allPropertyNames
{"energy", , , , , , , , , , , , , , , , , , , , , }
-
class
BondDetector
- #include <BondDetector.h>
Detecting bonds from 3D structures using covalent radii.
The radii are stored in Scine::Utils::BondDetectorRadii .
References:
DOI: 10.1002/jcc.540120716
DOI: 10.1186/1758-2946-4-26
DOI: 10.1002/jcc.24309
-
class
BondDetectorRadii
- #include <BondDetectorRadii.h>
Holds the covalent radii required in BondDetector.
-
class
BondOrderCollection
- #include <BondOrderCollection.h>
Class defining the bond orders between atoms of some molecular system.
-
class
VanDerWaalsBondDetector
- #include <VanDerWaalsBondDetector.h>
Implements the function to find bonds from a set of elements and positions, using the van der Waals radii.
-
class
PropertyList
- #include <PropertyList.h>
This class defines a list of properties that can be calculated in a single-point calculation.
-
class
PropertyNotPresentException
: public exception - #include <Results.h>
Exception thrown if a property is requested and it is not stored.
-
class
Results
- #include <Results.h>
Class for the properties obtained in a single-point calculation.
To obtain the properties:
”get” methods return references to the results (also allows simple copy)
”take” methods move the results (which will not be present in Results afterwards).
Template pattern does not allow for pImpl idiom without defining a specialized template for each Property.
-
class
ResultsAutoCompleter
- #include <ResultsAutoCompleter.h>
Provides functionality to autocomplete the results of a calculation.
-
class
EmptyStatesHandlerContainer
: public exception - #include <StatesHandler.h>
This exception is thrown if an empty states handler is popped.
-
class
NoStateHandableObjectPresent
: public exception - #include <StatesHandler.h>
This exception is thrown if an empty states handler is popped.
-
class
StatesHandler
- #include <StatesHandler.h>
Class responsible for saving, storing and loading object-specific states.
Core::State is an empty class. This base class is then implemented to have some meaningful definition of a state for an application. I could be, for instance, a density matrix for a Core::Calculator, a partially converged Markov Chain Montecarlo, a checkpoint,… . A Core::StateHandableObject interface exposes the functions for getting and loading a single state. The StatesHandler job is that of storing a list of these states and freely switching between them. This class is stand-alone, but can also be specialized to suit certain needs, this is why it exposes a virtual destructor.
-
class
AtomicGtos
- #include <AtomicGtos.h>
Class containing the GTO expansions for one atom.
-
class
AtomsOrbitalsIndexes
- #include <AtomsOrbitalsIndexes.h>
Structure containing the information about AO indexes and their corresponding atom indexes. TODO: separate state from construction (addAtom). In principle nextAtom_ and nextAO_ shouldn’t be members of this class.
-
class
DensityMatrix
- #include <DensityMatrix.h>
Class defining a density matrix for use in electronic structure calculation methods. Is adequate for both restricted and unrestricted formulations. Allows for an easy transfer of density matrices between different instances of a quantum chemical method. There is no overhead if only the restricted formulation is needed.
Accessors to the matrix elements.
Using template functions to allow perfect forwarding to the Eigen functions.
Arithmetic operations
In the case of functions for pairs of density matrices, the precondition is that they both have the same size and are either RHF-RHF or UHF-UHF.
-
class
DensityMatrixIO
- #include <DensityMatrixIO.h>
Class to write density matrices to disk or read them from disk, in binary format. TODO: save space and only write and read triangular matrix (since symmetric)? TODO: Make this class employ EigenMatrixIO? NB: then the memory layout would change
-
class
DipoleMatrix
Class representing dipole matrix integrals with derivatives up to 2nd order.
This class stores the dipole integrals \(\langle mu|r|nu \rangle\) and their derivatives in their three components x, y, z.
The derivatives are accessible through the .derivatives() method of the underlying AutomaticDifferentiation::First3D/Second3D class.
int arbitraryDimension = 10; DipoleMatrix dippoleMatrixZero, dipoleMatrixFirst; // Fill DipoleMatrix with random values and derivatives. using DerivType = Eigen::Matrix<AutomaticDifferentiation::First3D, Eigen::Dynamic, Eigen::Dynamic>; Eigen::MatrixXd XMatrix = Eigen::MatrixXd::Random(arbitraryDimension, arbitraryDimension); Eigen::MatrixXd YMatrix = Eigen::MatrixXd::Random(arbitraryDimension, arbitraryDimension); Eigen::MatrixXd ZMatrix = Eigen::MatrixXd::Random(arbitraryDimension, arbitraryDimension); DerivType Xderivatives, Yderivatives, Zderivatives; Xderivatives.resize(arbitraryDimension, arbitraryDimension); Yderivatives.resize(arbitraryDimension, arbitraryDimension); Zderivatives.resize(arbitraryDimension, arbitraryDimension); for (int i = 0; i < arbitraryDimension; ++i) { for (int j = 0; j < arbitraryDimension; ++j) { Xderivatives(i, j) = {XMatrix(i, j), Eigen::Vector3d::Random()}; Yderivatives(i, j) = {YMatrix(i, j), Eigen::Vector3d::Random()}; Zderivatives(i, j) = {ZMatrix(i, j), Eigen::Vector3d::Random()}; } } // Fill zeroth order dipole matrix dipoleMatrixZero.x().get<derivOrder::zero>(XMatrix); dipoleMatrixZero.y().get<derivOrder::zero>(YMatrix); dipoleMatrixZero.z().get<derivOrder::zero>(ZMatrix); // Fill first order dipole matrix with the first derivative integrals dipoleMatrixFirst.x().get<derivOrder::one>(Xderivatives); dipoleMatrixFirst.y().get<derivOrder::one>(Yderivatives); dipoleMatrixFirst.z().get<derivOrder::one>(Zderivatives); // Get the zeroth and first derivatives of the first element of the first derivative matrix dipoleMatrixZero.x().get<derivOrder::zero>()(0, 0); // Get the zeroth and first derivatives of the first element of the first derivative matrix AutomaticDifferentiation::getValue3DAsDouble(dipoleMatrixFirst.x().get<derivOrder::one>()(0, 0)); // or dipoleMatrixFirst.x().get<derivOrder::one>()(0, 0).value(); dipoleMatrixFirst.x().get<derivOrder::one>()(0, 0).derivatives();
-
class
Gtf
- #include <Gtf.h>
Class that contains one of the gaussian functions of a ,f.i., STO-nG expansion
-
class
GtoExpansion
- #include <GtoExpansion.h>
The class GTOExpansion is the container for the coefficients of a STO-nG expansion.
-
class
MatrixWithDerivatives
Container for a matrix and the derivatives of its elements. This class contains 3 matrices: val: contains the 0th order derivative of the elements. der: contains the 1th order derivative of the elements. It is thus a Eigen::Matrix of AutomaticDifferentiation::First3D elements. hes: contains the 2th order derivative of the elements. It is thus a Eigen::Matrix of AutomaticDifferentiation::Second3D elements.
-
class
MolecularOrbitals
- #include <MolecularOrbitals.h>
Class for the coefficient (molecular orbital) matrix. Contains all the eigenfunctions (molecular orbitals) produced when solving the (generalized) eigenvalue problem. The contained matrices are therefore quadratic; their dimension is the number of basis functions. TODO: Take SingleParticleEnergies inside this class?
-
class
OccupiedMolecularOrbitals
- #include <OccupiedMolecularOrbitals.h>
Class for the occupied part of the coefficient (molecular orbital) matrix. Contains only the occupied eigenfunctions (molecular orbitals). The dimension of the matrices is the number of basis functions (rows) and the number of occupied orbitals (columns) TODO: Take SingleParticleEnergies inside this class?
-
class
OctupoleMatrix
Class representing octupole matrix integrals with derivatives up to 2nd order.
This class stores the octupole integrals \(\langle mu|o_{rr}|nu \rangle\) The class stores only the upper diagonal of the octupole moment tensor: xxx, xxy, xxz, xyy, xyz, xzz, yyy, yyz, yzz, zzz. The derivatives are accessible through the .derivatives() method of the underlying AutomaticDifferentiation::First3D/Second3D class.
int arbitraryDimension = 10; OctupoleMatrix octupoleMatrixZero, octupoleMatrixFirst; // Fill OctupoleMatrix with random values and derivatives. Eigen::MatrixXd XXXMatrix, YYYMatrix, ZZZMatrix, XXYMatrix, XXZMatrix, XYZMatrix, XYYMatrix, XZZMatrix, YYZMatrix, YZZMatrix; Eigen::Matrix<AutomaticDifferentiation::First3D, Eigen::Dynamic, Eigen::Dynamic> XXXderivatives, YYYderivatives, ZZZderivatives, XXYderivatives, XXZderivatives, XYZderivatives, XYYderivatives, XZZderivatives, YYZderivatives, YZZderivatives; XXXMatrix = Eigen::MatrixXd::Random(arbitraryDimension, arbitraryDimension); YYYMatrix = Eigen::MatrixXd::Random(arbitraryDimension, arbitraryDimension); ZZZMatrix = Eigen::MatrixXd::Random(arbitraryDimension, arbitraryDimension); XXYMatrix = Eigen::MatrixXd::Random(arbitraryDimension, arbitraryDimension); XXZMatrix = Eigen::MatrixXd::Random(arbitraryDimension, arbitraryDimension); XYZMatrix = Eigen::MatrixXd::Random(arbitraryDimension, arbitraryDimension); XYYMatrix = Eigen::MatrixXd::Random(arbitraryDimension, arbitraryDimension); XZZMatrix = Eigen::MatrixXd::Random(arbitraryDimension, arbitraryDimension); YYZMatrix = Eigen::MatrixXd::Random(arbitraryDimension, arbitraryDimension); YZZMatrix = Eigen::MatrixXd::Random(arbitraryDimension, arbitraryDimension); XYYderivatives.resize(arbitraryDimension, arbitraryDimension); XZZderivatives.resize(arbitraryDimension, arbitraryDimension); YYZderivatives.resize(arbitraryDimension, arbitraryDimension); YZZderivatives.resize(arbitraryDimension, arbitraryDimension); for (int i = 0; i < arbitraryDimension; ++i) { for (int j = 0; j < arbitraryDimension; ++j) { XXXderivatives(i, j) = {XXXMatrix(i, j), Eigen::Vector3d::Random()}; YYYderivatives(i, j) = {YYYMatrix(i, j), Eigen::Vector3d::Random()}; ZZZderivatives(i, j) = {ZZZMatrix(i, j), Eigen::Vector3d::Random()}; XXYderivatives(i, j) = {XXYMatrix(i, j), Eigen::Vector3d::Random()}; XXZderivatives(i, j) = {XXZMatrix(i, j), Eigen::Vector3d::Random()}; XYZderivatives(i, j) = {XYZMatrix(i, j), Eigen::Vector3d::Random()}; XYYderivatives(i, j) = {XYYMatrix(i, j), Eigen::Vector3d::Random()}; XZZderivatives(i, j) = {XZZMatrix(i, j), Eigen::Vector3d::Random()}; YYZderivatives(i, j) = {YYZMatrix(i, j), Eigen::Vector3d::Random()}; YZZderivatives(i, j) = {YZZMatrix(i, j), Eigen::Vector3d::Random()}; } } // Fill with the zero-th derivative integrals octupoleMatrixZero.xxx().get<derivOrder::zero>(XXXXMatrix); octupoleMatrixZero.yyy().get<derivOrder::zero>(YYYMatrix); octupoleMatrixZero.zzz().get<derivOrder::zero>(ZZZMatrix); octupoleMatrixZero.xxy().get<derivOrder::zero>(XXYMatrix); octupoleMatrixZero.xxz().get<derivOrder::zero>(XXZMatrix); octupoleMatrixZero.xyz().get<derivOrder::zero>(XYZMatrix); octupoleMatrixZero.xyy().get<derivOrder::zero>(XYYMatrix); octupoleMatrixZero.xzz().get<derivOrder::zero>(XZZMatrix); octupoleMatrixZero.yyz().get<derivOrder::zero>(YYZMatrix); octupoleMatrixZero.yzz().get<derivOrder::zero>(YZZMatrix); // Fill with the first derivative integrals octupoleMatrixFirst.xxx().get<derivOrder::one>(XXXderivatives); octupoleMatrixFirst.yyy().get<derivOrder::one>(YYYderivatives); octupoleMatrixFirst.zzz().get<derivOrder::one>(ZZZderivatives); octupoleMatrixFirst.xxy().get<derivOrder::one>(XXYderivatives); octupoleMatrixFirst.xxz().get<derivOrder::one>(XXZderivatives); octupoleMatrixFirst.xyz().get<derivOrder::one>(XYZderivatives); octupoleMatrixFirst.xyy().get<derivOrder::one>(XYYderivatives); octupoleMatrixFirst.xzz().get<derivOrder::one>(XZZderivatives); octupoleMatrixFirst.yyz().get<derivOrder::one>(YYZderivatives); octupoleMatrixFirst.yzz().get<derivOrder::one>(YZZderivatives); // Get the zeroth and first derivatives of the first element of the first derivative matrix octupoleMatrixZero.xxx().get<derivOrder::zero>()(0, 0); // Get the zeroth and first derivatives of the first element of the first derivative matrix octupoleMatrixFirst.xxx().get<derivOrder::one>()(0, 0).value(); // or AutomaticDifferentiation::getValue3DAsDouble(octupoleMatrixFirst.xxx().get<derivOrder::one>()(0, 0)); octupoleMatrixFirst.xxx().get<derivOrder::one>()(0, 0).derivatives();
-
class
QuadrupoleMatrix
Class representing quadrupole matrix integrals with derivatives up to 2nd order.
This class stores the quadrupole integrals \(\langle mu|q_{rr}|nu \rangle\) and their derivatives in their three components x, y, z.
The class stores only the upper diagonal of the quadrupole moment tensor: xx, xy, xz, yy, yz, zz. The derivatives are accessible through the .derivatives() method of the underlying AutomaticDifferentiation::First3D/Second3D class. The templated getters and setters allow for efficient witing of generic code, independent from the desired derivative order. One just has to have specializations for all orders.
int arbitraryDimension = 10; QuadrupoleMatrix quadrupoleMatrixZero, quadrupoleMatrixFirst; // Fill QuadrupoleMatrix with random values and derivatives. DerivType = Eigen::Matrix<AutomaticDifferentiation::First3D, Eigen::Dynamic, Eigen::Dynamic>; Eigen::MatrixXd XXMatrix = Eigen::MatrixXd::Random(arbitraryDimension, arbitraryDimension); Eigen::MatrixXd XYMatrix = Eigen::MatrixXd::Random(arbitraryDimension, arbitraryDimension); Eigen::MatrixXd XZMatrix = Eigen::MatrixXd::Random(arbitraryDimension, arbitraryDimension); Eigen::MatrixXd YYMatrix = Eigen::MatrixXd::Random(arbitraryDimension, arbitraryDimension); Eigen::MatrixXd YZMatrix = Eigen::MatrixXd::Random(arbitraryDimension, arbitraryDimension); Eigen::MatrixXd ZZMatrix = Eigen::MatrixXd::Random(arbitraryDimension, arbitraryDimension); DerivType XXderivatives, XYderivatives, XZderivatives, YYderivatives, YZderivatives, ZZderivatives; XXderivatives.resize(arbitraryDimension, arbitraryDimension); XYderivatives.resize(arbitraryDimension, arbitraryDimension); XZderivatives.resize(arbitraryDimension, arbitraryDimension); YYderivatives.resize(arbitraryDimension, arbitraryDimension); YZderivatives.resize(arbitraryDimension, arbitraryDimension); ZZderivatives.resize(arbitraryDimension, arbitraryDimension); for (int i = 0; i < arbitraryDimension; ++i) { for (int j = 0; j < arbitraryDimension; ++j) { XXderivatives(i, j) = {XXMatrix(i, j), Eigen::Vector3d::Random()}; XYderivatives(i, j) = {XYMatrix(i, j), Eigen::Vector3d::Random()}; XZderivatives(i, j) = {XZMatrix(i, j), Eigen::Vector3d::Random()}; YYderivatives(i, j) = {YYMatrix(i, j), Eigen::Vector3d::Random()}; YZderivatives(i, j) = {YZMatrix(i, j), Eigen::Vector3d::Random()}; ZZderivatives(i, j) = {ZZMatrix(i, j), Eigen::Vector3d::Random()}; } } // Fill with the zero-th derivative integrals quadrupoleMatrixZero.xx().get<derivOrder::zero>(XXMatrix); quadrupoleMatrixZero.xy().get<derivOrder::zero>(XYMatrix); quadrupoleMatrixZero.xz().get<derivOrder::zero>(XZMatrix); quadrupoleMatrixZero.yy().get<derivOrder::zero>(YYMatrix); quadrupoleMatrixZero.yz().get<derivOrder::zero>(YZMatrix); quadrupoleMatrixZero.zz().get<derivOrder::zero>(ZZMatrix); // Fill with the first derivative integrals quadrupoleMatrixFirst.xx().get<derivOrder::one>(XXderivatives); quadrupoleMatrixFirst.xy().get<derivOrder::one>(XYderivatives); quadrupoleMatrixFirst.xz().get<derivOrder::one>(XZderivatives); quadrupoleMatrixFirst.yy().get<derivOrder::one>(YYderivatives); quadrupoleMatrixFirst.yz().get<derivOrder::one>(YZderivatives); quadrupoleMatrixFirst.zz().get<derivOrder::one>(ZZderivatives); // Get the zeroth and first derivatives of the first element of the first derivative matrix quadrupoleMatrixZero.xx().get<derivOrder::zero>()(0, 0); // Get the zeroth and first derivatives of the first element of the first derivative matrix quadrupoleMatrixFirst.xx().get<derivOrder::one>()(0, 0).value(); quadrupoleMatrixFirst.xx().get<derivOrder::one>()(0, 0).derivatives();
-
class
SingleParticleEnergies
- #include <SingleParticleEnergies.h>
Class handling the single-particle energies obtained as eigenvalues of the (generalized) eigenvalue problem. NB: no check is made if the correct (i.e., Restricted / Unrestricted) function variants are called.
-
class
SlaterToGaussian
- #include <SlaterToGaussian.h>
The class STO_nG delivers the coefficients of a STO-nG expansion for a given STO. Expansion coefficients reference: 1s-5g: Robert F. Stewart, Small Gaussian Expansions of Slater‐Type Orbitals, J. Chem. Phys. 52, 431 (1970). >= 6s: Prof. Dr. Jürg Hutter.
-
class
SpinAdaptedMatrix
- #include <SpinAdaptedMatrix.h>
Class defining a matrix and which can be used for both spin-restricted and spin-unrestricted formalisms in electronic structure calculation methods. There is only slight overhead if only the restricted formulation is needed.
Accessors to the matrix elements.
Using template functions to allow perfect forwarding to the Eigen functions.
Setters for the matrix elements.
Using template functions to allow perfect forwarding to the Eigen functions.
-
class
HessianUtilities
- #include <HessianUtilities.h>
A utility class for Hessians allowing easier access to eigenvalues and eigenvectors of transformed versions.
- Parameters
hessian
: Hessian in cartesian coordinates (not mass-weighted, also not if massWeighted is set to true)massWeighted
: If supposed to yield mass-weighted results set to true This results into all getter functions returning mass weighted properties
-
class
NormalMode
- #include <NormalMode.h>
Container for a single normal mode.
-
class
NormalModeAnalyzer
- #include <NormalModeAnalyzer.h>
Class to calculate the normal modes of a molecule from its hessian matrix.
-
class
NormalModesContainer
- #include <NormalModesContainer.h>
Class that holds the and manages the normal modes.
-
class
NumericalHessianCalculator
- #include <NumericalHessianCalculator.h>
This class calculates the Hessian and, optionally, the dipole gradient (semi-)numerically.
Useful if analytic second derivatives are not available.
calculateFromEnergyDifferences uses the following, where D = delta / 2: d^2E/dx^2 = 1 / delta^2 * (E(x-2D) - 2 * E(x) + E(x+2D)) d^2E/dxdy = 1 / delta^2 * (E(x+D,y+D) - E(x+D,y-D) - E(x-D,y+D) + E(x-D,y-D))
calculateFromGradientDifferences uses the following, where D = delta / 2: d^2E/dxdy = 1 / (2*delta) * (g_j(i+D,j) - g_j(i-D,j) + g_i(i,j+D) - g_i(i,j-D))
The second formulation is more stable numerically and is used as default.
In order to calculate the dipole gradient, from each displacement the dipole is calculated. dmu/dx_i = 1 / (2*delta) * (mu_x(x_i + delta) - mu_x(x_i - delta)) Only 3N calculations are needed to fill the 3Nx3 dipole gradient matrix, as the dipole comes as a x,y,z vector at each single point calculation.
-
class
Atom
- #include <Atom.h>
A basic atom in the chemical sense.
Subclassed by Scine::Utils::Dftd3::Dftd3Atom
-
class
AtomCollection
- #include <AtomCollection.h>
A Collection of Atoms.
Has the same functionality as a std::vector<Atom>, but is implemented as a composition of a ElementTypeCollection and a PositionCollection.
-
class
ElementSymbolNotFound
: public runtime_error - #include <ElementInfo.h>
A runtime error specific to an element not being found.
-
class
ElementInfo
- #include <ElementInfo.h>
Provides information about elements, such as mass, van-der-Waals radius, etc.
This class only wraps around the actual data and their handling. For the underlying data see ElementInfoData.h and ElementInfoData.cpp.
-
class
InternalCoordinates
- #include <InternalCoordinates.h>
This class provides the option to convert from Cartesian into internal coordinates.
As default internal redundant coordinates will be used, as a backup a set of internal coordinates generated by only removing translation and rotational degrees of freedom can be chosen.
The redundant internal coordinates are generated using ‘libirc’: https://github.com/RMeli/irc/
-
class
StructuralCompletion
- #include <StructuralCompletion.h>
Contains function to generate positions from other positions.
F.i. to be applied to add hydrogen atoms to a carbon chain.
-
template<class
OptimizerType
>
classAfirOptimizer
: public Scine::Utils::AfirOptimizerBase - #include <AfirOptimizer.h>
A version of the GeometryOptimizer that optimizes the underlying structure while applying an additional artificial force for the induction of reactions.
For more details about AFIR see the base class Utils::AfirOptimizerBase .
- Template Parameters
OptimizerType
: Expects any of the Optimizer classes. Note that some special optimizers may not yet be supported or may need additional specialization.
-
class
AfirOptimizerBase
- #include <AfirOptimizerBase.h>
The base class for all AFIR optimizers.
The main purpose of this base class is to hide the template parameter(s) of the derived class(es).
This optimizer is a version of the GeometryOptimizer that optimizes the underlying structure while applying an additional artificial force for the induction of reactions.
The artificial force induced reaction (AFIR) optimizer is based on the works by Maeda et. al. The implementation was done following this reference: J Comput Chem., 2018, 39, 233 [DOI: 10.1002/jcc.25106] https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5765425/ (accessed 05.04.2019)
The original references are: J. Chem. Phys., 2010, 132, 241102 J. Chem. Theory Comput., 2011, 7, 2335
Subclassed by Scine::Utils::AfirOptimizer< OptimizerType >
-
template<class
OptimizerType
, classConvergenceCheckType
>
classAfirOptimizerSettings
: public Scine::Utils::Settings - #include <AfirOptimizerSettings.h>
Settings for an AfirOptimizer.
Uses template arguments in order to automatically include the settings of underlying objects into the given settings.
- Template Parameters
OptimizerType
: The underlying Optimizer class.ConvergenceCheckType
: The underlying ConvergenceCheck class.
-
class
GeometryOptimizerBase
- #include <GeometryOptimizer.h>
The base class for all Geometry optimizers.
The purpose of the geometry optimizers is to wrap technical details needed for the actual optimization into a class that is easily used and has a small set of data needed in its constructor, is mainly configured via its settings, and then exposes the optimization through a simple function accepting a geometry (AtomCollection)
The main purpose of this base class is to hide the template parameter(s) of the derived class(es).
Subclassed by Scine::Utils::GeometryOptimizer< OptimizerType >
-
template<class
OptimizerType
, classConvergenceCheckType
>
classGeometryOptimizerSettings
: public Scine::Utils::Settings - #include <GeometryOptimizer.h>
Settings for a GeometryOptimizer.
Uses template arguments in order to automatically include the settings of underlying objects into the given settings.
- Template Parameters
OptimizerType
: The underlying Optimizer class.ConvergenceCheckType
: The underlying ConvergenceCheck class.
-
template<class
OptimizerType
>
classGeometryOptimizer
: public Scine::Utils::GeometryOptimizerBase - #include <GeometryOptimizer.h>
Basically just a templated version of the base class GeometryOptimizerBase, where the template defines the actual optimizer used in the geometry optimization.
- Template Parameters
OptimizerType
: Expects any of the Optimizer classes. Note that some special optimizers may not yet be supported or may need additional specialization.
-
class
IrcOptimizerBase
- #include <IrcOptimizer.h>
The base class for all IRC optimizers.
The main purpose of this base class is to hide the template parameter(s) of the derived class(es).
Subclassed by Scine::Utils::IrcOptimizer< OptimizerType >
-
template<class
OptimizerType
, classConvergenceCheckType
>
classIRCOptimizerSettings
: public Scine::Utils::Settings - #include <IrcOptimizer.h>
Settings for an IRCOptimizer.
Uses template arguments in order to automatically include the settings of underlying objects into the given settings.
- Template Parameters
OptimizerType
: The underlying Optimizer class.ConvergenceCheckType
: The underlying ConvergenceCheck class.
-
template<class
OptimizerType
>
classIrcOptimizer
: public Scine::Utils::IrcOptimizerBase - #include <IrcOptimizer.h>
A version of the GeometryOptimizer that optimizes along an internal reaction coordinate (IRC).
This optimizer mass-weights the actual gradient in order to optimize in the mass-weighted coordinate system.
- Template Parameters
OptimizerType
: Expects any of the Optimizer classes. Note that some special optimizers may not yet be supported or may need additional specialization.
-
class
ChemicalFileHandler
- #include <ChemicalFileHandler.h>
Handles the reading and writing of chemical file formats.
Matches suffixes to chemical file formats and then dispatches the calls to appropriate streaming I/O handlers. Catches I/O errors.
-
class
FormattedStreamHandler
- #include <FormattedStreamHandler.h>
The interface for all classes handling formatted streaming IO.
Subclassed by Scine::Utils::MolStreamHandler, Scine::Utils::OpenBabelStreamHandler, Scine::Utils::XyzStreamHandler
-
class
MolStreamHandler
: public Scine::Utils::FormattedStreamHandler - #include <MolStreamHandler.h>
Handler for MOL stream IO.
This class implements the FormattedStreamHandler interface for use with Core’s module management. The core stream IO functions are available as static functions, too.
-
class
OpenBabelStreamHandler
: public Scine::Utils::FormattedStreamHandler - #include <OpenBabelStreamHandler.h>
If obabel is in the PATH, supports IO to range of OpenBabel’s file formats.
- Note
Concerning the GPLv2 OpenBabel license, this StreamHandler very much communicates ‘at arms length’ with OpenBabel (https://www.gnu.org/licenses/old-licenses/gpl-2.0-faq.en.html#TOCGPLInProprietarySystem) by merely calling it via system process-level interaction, if present.
-
class
XyzStreamHandler
: public Scine::Utils::FormattedStreamHandler - #include <XyzStreamHandler.h>
Handler for XYZ stream IO.
This class implements the FormattedStreamHandler interface for use with Core’s module management. The core stream IO functions are available as static functions, too.
- Note
Since the XYZ file format does not include bond information in any part, the read/write pair involving BondOrderCollections just throws in all cases.
-
class
FilesystemHelpers
- #include <FilesystemHelpers.h>
This class contains utility functions for dealing with files and directories.
Hides the use of Boost::filesystem.
-
class
IOException
: public runtime_error - #include <IOExceptions.h>
Base class for exceptions related to input-output.
Subclassed by Scine::Utils::InvalidAtomCountSpecification, Scine::Utils::InvalidAtomSpecification, Scine::Utils::InvalidFile
-
class
InvalidFile
: public Scine::Utils::IOException - #include <IOExceptions.h>
Exception when file cannot be opened.
-
class
InvalidAtomCountSpecification
: public Scine::Utils::IOException - #include <IOExceptions.h>
Exception thrown when the first line of a xyz input does not contain the number of atoms.
-
class
InvalidAtomSpecification
: public Scine::Utils::IOException - #include <IOExceptions.h>
Exception thrown when a line for an atom of a xyz input is invalid.
-
class
Log
- #include <Logger.h>
Static class for logging.
By default, logging is disabled. Logging can be started with startConsoleLogging() or startFileLogging(). It is possible to have several files for logging. The calls to Log are thread-safe.
-
class
MolecularTrajectoryIO
- #include <MolecularTrajectoryIO.h>
Class for input and output of MolecularTrajectory classes.
-
class
NativeFilenames
- #include <NativeFilenames.h>
This class contains utility functions for storing file paths in strings, and cares for cross-platform issues. Hides the use of Boost::filesystem.
-
class
YAMLParsingException
: public runtime_error - #include <Yaml.h>
A custom exception for YAML parsing errors.
-
class
AtomicSecondDerivativeCollection
- #include <AtomicSecondDerivativeCollection.h>
Container class for second derivatives.
Mainly an override of std::vector<SecondDerivative>. Generally used for storing the gradients of a molecular structure.
-
class
VectorDerivatives3D
- #include <VectorDerivatives3D.h>
Class to handle 3D derivatives of 3D vectors.
-
class
FullSecondDerivativeCollection
- #include <FullSecondDerivativeCollection.h>
Container class for full second derivatives (Hessian matrix + first derivatives).
-
template<class
MatrixType
, DavidsonBalancedTypes
= DavidsonBalancedType::standard>
classDavidsonDiagonalizer
Davidson-Liu iterative diagonalizer.
Two specialized variants of the algorithm are implemented:
Classical algorithm as implemented by Davidson
Davidson, E. R., J. Comput. Phys., 1975, 17, 87-94.
Liu, B., The simultaneous expansion method for the iterative solution of large real-symmetric matrices, Numerical Algorithms in Chemistry: Algebraic Methods, Technical Report LBL-8158, pp 49-53.
R. M. Parrish, E. G. Hohenstein, T. J. Martinez, “Balancing” the Block Davidson-Liu Algorithm, J. Chem. Theory Comput., 2016, 12, 3003-3007.
Balanced version as described by Furche et al.:
R. M. Parrish, E. G. Hohenstein, T. J. Martinez, “Balancing” the Block Davidson-Liu Algorithm, J. Chem. Theory Comput., 2016, 12, 3003-3007.
F. Furche, B. T. Kull, B. D. Nguyen, J. Kwon, Accelerating molecular property with nonorthonormal Krylov space methods, J. Chem. Phys, 2016, 144.
While the “vanilla” implementation should work as an allrounder, the balanced specialization is particularly effective if used in combination with some density screening algorithm. For example, in direct CIS calculations the Fock matrix elements to compute are conditioned on a Cauchy-Schwarz screening. The non-normality condition of the balanced algorithm causes the norm of the residuals to steadily decrease as the iterations go. This correspond to a steady increase of the amount of elements of the Fock matrix that can be safely be ignored and the consequent acceleration of the sigma vector construction.
- Template Parameters
MatrixType
: The matrix type to use, can be either Eigen::MatrixXd or Eigen::SparseMatrix<double>.s
: Determines if a standard (default) or balanced implementation is used.
-
class
IndirectPreconditionerEvaluator
: public Scine::Utils::PreconditionerEvaluator This preconditioner evaluator returns the diagonal preconditioner for the Davidson algorithm.
-
template<class
MatrixType
>
classIndirectSigmaVectorEvaluator
: public Scine::Utils::SigmaVectorEvaluator<MatrixType> This sigma vector evaluator calculates the sigma vector as described in Davidson’s iterative method paper.
E. R. Davidson, The iterative calculation of a few of the lowest eigenvalues and corresponding eigenvectors of large real-symmetric matrices, J. Comput. Phys, 1975, 17, 87-94, https://doi.org/10.1016/0021-9991(75)90065-0
-
class
PreconditionerEvaluator
Interface for the preconditioner evaluators in the Davidson iterative diagonalizer.
Subclassed by Scine::Utils::IndirectPreconditionerEvaluator
-
template<class
MatrixType
>
classSigmaVectorEvaluator
Interface for the sigma vector evaluators in the Davidson iterative diagonalizer.
Subclassed by Scine::Utils::IndirectSigmaVectorEvaluator< MatrixType >
-
struct
ElectronicTransitionResult
- #include <SpinAdaptedEigenContainer.h>
Data structure to store the results of an excited states calculation.
-
struct
SpinAdaptedElectronicTransitionResult
- #include <SpinAdaptedEigenContainer.h>
Data structure to store the results of an excited states calculation with closed-shell reference.
-
struct
CouplingMatrix
- #include <SpinAdaptedEigenContainer.h>
Coupling matrix needed by TD-DFTB and TD-DFT.
-
class
QuaternionFit
- #include <QuaternionFit.h>
Compares two sets of positions and calculates translation and rotation to go from one to the other.
References:
https://arxiv.org/pdf/physics/0506177.pdf (arXiv:physics/0506177v3)
-
class
Tensor33
- #include <Tensor33.h>
Simple algebra for a 3x3 tensor.
-
class
GaussianModule
: public Module - #include <GaussianModule.h>
Gaussian module provided by OSUtils.
-
class
OrcaModule
: public Module - #include <OrcaModule.h>
ORCA Module provided by OSUtils.
-
class
EulerMD
: public Scine::Utils::MDIntegrator - #include <EulerMD.h>
Class implementing the Euler algorithm for Molecular Dynamics.
The position is updated with \( r_i(t + \Delta t) = r_i(t) + \Delta t v_i(t) + \frac{\Delta t^2}{2m_i} f_i(t) + O(\Delta t^3) \) and the velocities with \( v_i(t + \Delta t) = v_i(t) + \frac{\Delta t}{m_i} f_i(t) + O(\Delta t^2) \)
-
class
LeapFrogMD
: public Scine::Utils::MDIntegrator - #include <LeapFrogMD.h>
Class implementing the LeapFrog algorithm for Molecular Dynamics.
The velocities are updated with \( v_i(t + \frac{1}{2} \Delta t) = v_i(t - \frac{1}{2} \Delta t) + \frac{\Delta t}{m_i} f_i(t) \) and the positions with \( r_i(t + \Delta t) = r_i(t) + \Delta t v_i(t + \frac{1}{2} \Delta t) \)
-
class
MDIntegrator
Subclassed by Scine::Utils::EulerMD, Scine::Utils::LeapFrogMD, Scine::Utils::VelocityVerletMD
-
class
MolecularDynamicsSettings
: public Scine::Utils::Settings - #include <MolecularDynamicsSettings.h>
Settings for Molecular Dynamics simulations.
-
class
VelocityVerletMD
: public Scine::Utils::MDIntegrator - #include <VelocityVerletMD.h>
Class implementing the Velocity Verlet algorithm for Molecular Dynamics.
The position is updated with \( r_i(t + \Delta t) = r_i(t) + \Delta t v_i(t) + \frac{\Delta t^2}{2m_i} f_i(t) + O(\Delta t^3) \) and the velocities with \( v_i(t + \Delta t) = v_i(t) + \frac{\Delta t}{2 m_i} (f_i(t) + f_i(t + \Delta t)) + O(\Delta t^3) \)
-
class
MolecularTrajectory
- #include <MolecularTrajectory.h>
A container class for Scine::Utils::PositionCollection classes.
Mainly an override of std::vector<PositionCollection>, plus Element Type information. Generally used for storing the positions of several consecutive molecular structures.
-
class
ConvergenceCheck
- #include <ConvergenceCheck.h>
The base class for all convergence checks.
Similar to the actual Optimizer the convergence check is abstracted into a class that shall allow both usage via Settings object and as a ‘raw’ class using the public members to adjust the convergence criteria.
To this end the base class defines and enforces the presence of the functions that parse the
Settings into these members and vice versa.In general, it is adviseable to derive classes that also only require the use of a default constructor, after all the convergence checks are mostly defined by a set of thresholds and any data should be required in the actual optimization cycles and not upon creation of the derived object.
Subclassed by Scine::Utils::GradientBasedCheck
-
class
Bfgs
: public Scine::Utils::Optimizer - #include <Bfgs.h>
An implementation of the BFGS optimization algorithm.
The implementation includes an optional GDIIS.
-
class
Dimer
: public Scine::Utils::Optimizer - #include <Dimer.h>
An implementation of the Dimer optimization algorithm for saddlepoints.
transition state search without hessian by finding minimum curvature by gradient calculations of a dimer on PES dimer is constructed by estimated eigenvector or random vector, then dimer is rotated iteratively until it is aligned with lowest curvature mode, then translation is performed this is repeated until converged
Implemented, as described in: Kaestner J. and Sherwood P., Journal of Chemical Physics, 2008 Shang C. and Liu ZP., Journal of Chemical Theory and Computation, 2010
-
class
Gdiis
- #include <Gdiis.h>
An implementation of the GDIIS optimization acceleration algorithm.
-
class
GradientBasedCheck
: public Scine::Utils::ConvergenceCheck - #include <GradientBasedCheck.h>
A convergence check based on parameter, value and gradient information.
Checks the RMS of the gradient and step, the maximum coefficient of the gradient and step and also the change in value.
For convergence the value and a set number of the other four criteria need to converge.
-
class
Lbfgs
: public Scine::Utils::Optimizer - #include <Lbfgs.h>
An implementation of a limited memory BFGS optimization algorithm.
The implementation includes an optional linesearch using both Wolfe conditions.
-
class
SteepestDescent
: public Scine::Utils::Optimizer - #include <SteepestDescent.h>
An implementation of a steepest descent optimization algorithm.
The steepest descent algorithm is on of the most simple gradient based optimization algorithms. In each step the parameters are adjusted by subtracting the scaled negative gradient. The gradient is usually scaled by a factor that is smaller than 1.0 .
-
class
Bofill
: public Scine::Utils::Optimizer - #include <Bofill.h>
An implementation of the Bofill optimization algorithm for saddlepoints.
Minimizes along all coordinates except one, along which it maximizes.
Implemented, as described in: Phys. Chem. Chem. Phys., 2002, 4, 11–15 The original paper by Bofill is the following: J. Comput. Chem., 1994, 15, 1
-
class
EigenvectorFollowing
: public Scine::Utils::Optimizer - #include <EigenvectorFollowing.h>
An implementation of an Eigenvector following optimization algorithm.
This algorithm is intended to find the maximum along one single eigenvector and the minimum along all other eigenvectors of a given system/Hessian.
-
class
NewtonRaphson
: public Scine::Utils::Optimizer - #include <NewtonRaphson.h>
An implementation of a Newton-Raphson optimization algorithm.
-
class
LevenbergMarquardt
: public Scine::Utils::Optimizer - #include <LevenbergMarquardt.h>
Levenberg-Marquardt (LM) algorithm for a least squares optimization.
-
class
UpdateFunctionManagerBase
- #include <UpdateFunctionManagerBase.h>
This class manages the two different update functions that are neccessary for a least squares optimization using Eigen.
-
class
Optimizer
- #include <Optimizer.h>
The base class for all Optimizers.
Given the fact that optimizers can function in many different ways, this base class is somewhat slim and only unifies the usage of auxiliary functions.
In general the optimizers are intended to be used for internal optimizations where a fixed optimizer and a fixed set of options for that optimizer are used, and also those cases where user settings at runtime shall be used.
To this end, the optimizers should have their options given as public member variables which can alternatively be set using the
Optimizer::applySettings function. In order to then allow the addition of the encoded options into a Settings object a Optimizer::addSettingsDescriptors() function has to be generated in any derived class.Furthermore all optimizers shall track the number of cycles they run and also call the
Optimizer::triggerObservers() function once in each iteration.The specific function handling the optimization is dependent on the particular type of optimizer, however it should have the following properties:
it should return the final cycle count upon completion
it should accept the (in this order):
the initial parameters
a template lambda function for the update of needed variables
an object derived from ConvergenceCheck to signal the end of the optimization
Subclassed by Scine::Utils::Bfgs, Scine::Utils::Bofill, Scine::Utils::Dimer, Scine::Utils::EigenvectorFollowing, Scine::Utils::Lbfgs, Scine::Utils::LevenbergMarquardt, Scine::Utils::NewtonRaphson, Scine::Utils::SteepestDescent
-
struct
ThermochemicalContainer
- #include <ThermochemistryCalculator.h>
Struct containing the single thermochemical properties of interest.
-
struct
ThermochemicalComponentsContainer
- #include <ThermochemistryCalculator.h>
Struct containing the vibrational, rotational, translational and the overall thermochemical components.
-
class
ThermochemistryCalculator
This class calculates and stores the most important thermochemical data.
The class calculates important thermochemical descriptors, as the Zero Point Vibrational Energy, the standard enthalpy of formation, the system entropy, the heat capacity and the Gibbs’ free energy from the results of a vibrational analysis.
By default a temperature of 298.15 K and a molecular symmetry number of one are assumed. They can be adapted via the functions setTemperature() and setMolecularSymmetryNumber(), respectively. Using an incorrect symmetry number results into a wrong rotational entropy.
-
class
ConvergenceAcceleratorFactory
- #include <ConvergenceAcceleratorFactory.h>
The ConvergenceAcceleratorFactory class provides the register of the available convergence accelerators.
This class also creates pointer to the desired Scf convergence accelerators. In the code convergence accelerators are often referred to as “mixers”.
-
class
DiisError
- #include <DiisError.h>
Class to handle the error vectors used in DIIS.
-
class
Ecqpp
- #include <Ecqpp.h>
Equality Constrained Quadratic Programming Problem solver for EDIIS. This class solves the optimization problem for an EDIIS iteration. It minimizes the expression E*c - 0.5 c^T*B*c with the constraint that sum(c_i) = 1. To do so, it solves the above equation for all subsets of c, rejects inadmissible solutions (c_i < 0) and keeps the best one.
-
class
Ediis
- #include <Ediis.h>
Class performing the calculation of a Fock matrix based on the EDIIS algorithm.
-
class
EdiisCoefficientOptimizer
- #include <EdiisCoefficientOptimizer.h>
Calculates optimal coefficients to use in EDIIS. It solves the optimization problem given the B matrix and energies and calculates the coefficients with the Reduced Gradient Method.
-
class
EdiisDiisModifier
: public Scine::Utils::ScfModifier - #include <EdiisDiisModifier.h>
Class to use the EDIIS + DIIS combination as in Gaussian. Garza, Scuseria, J Chem Phys 137 (2012) 054110: “In the default EDIIS + DIIS procedure in Gaussian, EDIIS is used when the largest DIIS error (errMax) is greater than 10^-1 a.u. but DIIS is employed when this error goes below 10^-4 a.u. In between these values, the EDIIS and DIIS coefficients are weighted such that c = 10(errorMax) C(EDIIS) + (1-10(errorMax))c(DIIS); however, if the error of the last cycle is 10% greater than the minimum error, pure EDIIS is used.”
-
class
EdiisModifier
: public Scine::Utils::ScfModifier - #include <EdiisModifier.h>
ScfModifier for the EDIIS algorithm. This class does not perform directly the EDIIS algorithm, it is like an interface between the SCF method and the class for the actual EDIIS algorithm.
-
class
FockDiis
- #include <FockDiis.h>
Class performing the calculation of a Fock matrix based on the direct inversion of the iterative subspace (DIIS) algorithm.
-
class
FockDiisModifier
: public Scine::Utils::ScfModifier - #include <FockDiisModifier.h>
ScfModifier for the DIIS algorithm. This class does not perform directly the DIIS algorithm, it is like an interface between the Scf method and the class for the actual DIIS algorithm.
-
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.
-
class
ConvergenceChecker
- #include <ConvergenceChecker.h>
Class for a density matrix based convergence checker. It looks at the RMS change in density matrix elements.
-
class
DensityMatrixGuessCalculator
- #include <DensityMatrixGuessCalculator.h>
Interface for the calculation of the density matrix guess in SCF calculations.
-
class
ElectronicContributionCalculator
- #include <ElectronicContributionCalculator.h>
Interface for the computation of the Fock matrix.
TODO: Separate for non-SCF and SCF specializations?
-
class
ElectronicEnergyCalculator
- #include <ElectronicEnergyCalculator.h>
Interface for the calculation of the electronic energy.
-
class
LcaoMethod
: public Scine::Utils::SinglePointMethod - #include <LcaoMethod.h>
Base class describing a method based on a LCAO ansatz.
Subclassed by Scine::Utils::ScfMethod
-
class
OverlapCalculator
- #include <OverlapCalculator.h>
Abstract class for the calculation of the overlap matrix.
-
class
RepulsionCalculator
Class representing a repulsion calculator between (classical) nuclei.
-
class
ScfConvergenceAccelerator
- #include <ScfConvergenceAccelerator.h>
This class sets up the convergence acceleration for a SCF method.
-
class
ScfMethod
: public Scine::Utils::LcaoMethod Base class for self-consistent-field methods.
-
class
ScfModifier
- #include <ScfModifier.h>
Base class for SCF modifiers. SCF modifiers allow to act in between the different steps of a SCF calculations. The functions it defines are anchors and are called after the corresponding steps of a SCF calculation.
- See
Subclassed by Scine::Utils::ChargeSimple, Scine::Utils::EdiisDiisModifier, Scine::Utils::EdiisModifier, Scine::Utils::FockDiisModifier, Scine::Utils::FockSimple
-
class
SinglePointMethod
- #include <SinglePointMethod.h>
This class is the base class of any method to be used in Real-time quantum chemistry. It contain declarations for variables methods concerning energy and gradients.
Subclassed by Scine::Utils::LcaoMethod
-
class
StructureDependentInitializer
- #include <StructureDependentInitializer.h>
Interface for method-specific settings which must be updated f.i. when the molecular structure changes.
-
template<class
IntegerType
>
classUniqueRandomNumbersGenerator
- #include <UniqueRandomNumbersGenerator.h>
Class to sample without replacement N numbers from a range bounded by min_ and max_.
The user gives a minimum number and a maximum number as the boundaries of a range of possible numbers. Upon calling the UniqueRandomNumbersGenerator::generate(unsigned N) function, N values are sampled without replacement from the possible values.
-
class
Settings
: public Scine::Utils::UniversalSettings::ValueCollection - #include <Settings.h>
An interface for settings of all sorts.
This interface allows all other interfaces in Scine::Core to have a central place for Settings, while their implementations maintain their specific settings independently.
Implementation Notes:
A derived class of the Settings class has to define a construcor that populates the protected _fields member with a set of possible options and their default/descriptions.
Subclassed by Scine::Utils::AfirOptimizerSettings< OptimizerType, ConvergenceCheckType >, Scine::Utils::ExternalQC::GaussianCalculatorSettings, Scine::Utils::ExternalQC::OrcaCalculatorSettings, Scine::Utils::GeometryOptimizerSettings< OptimizerType, ConvergenceCheckType >, Scine::Utils::IRCOptimizerSettings< OptimizerType, ConvergenceCheckType >, Scine::Utils::MolecularDynamicsSettings
-
template<class
T
>
classAbstract
- #include <CloneInterface.h>
Strong typing for the abstract level class.
To provide template parameter resolution at compile time, a strong type is provided to differentiate the leaf class from the abstract, middle class.
-
template<class
Derived
, class ...Bases
>
classCloneInterface
: public Bases - #include <CloneInterface.h>
Class serving the purpose of a generic clone interface.
This class provides the clone method for any interface in core needing it. It uses the curiously recurrent template pattern (CRTP) to acquire infos at compile time about both the interface and the derived class. This allows for the one-time-only generation of code for the clone method, avoiding unnecessary code duplication. Basically, a derived class must just inherit from the CloneInterface with template parameters Derived = derived class and Base = interface class to have a functioning clone method. See https://www.fluentcpp.com/2017/09/12/how-to-return-a-smart-pointer-and-use-covariance/ for further details.
Note that classes deriving from CloneInterface<Derived, Base> do implicitly derive from Base, hence they do not need an additional ‘public Base’ statement.
-
template<class
Derived
, class ...Bases
>
classCloneInterface
<Abstract<Derived>, Bases...> : public Bases - #include <CloneInterface.h>
Specialization for abstract classes.
This is necessary, because otherwise the inheritance pattern would not work. It would not be necessary if the inheritance would just have 2 level: interface class and derived class. From the moment that there are also abstract classes between interface and derived class, as the Core::Calculator in the Sparrow module is the most notorious example, the cloneImpl() method must be virtualized in the abstract class.
-
class
ScopedLocale
- #include <ScopedLocale.h>
Introduces a scope to change the locale, the original locale will be set back upon destruction.
-
template<typename
T
, typenameParameter
>
classStrongType
- #include <StrongType.h>
From: https://www.fluentcpp.com/2016/12/08/strong-types-for-strong-interfaces/.
- Template Parameters
T
: The underlying type.Parameter
: A “phantom type” serves the purpose of specializing the type.
-
class
UniqueIdentifier
- #include <UniqueIdentifier.h>
Class for a unique identifier (handle).
It can f.i. be used to identify an instance unequivocally. Uses pimpl idiom to hide boost::uuid dependency.
-
class
Displacement
- #include <Typenames.h>
Another name for an Eigen::RowVector3d .
-
class
DisplacementCollection
- #include <Typenames.h>
Another name for a row-major Eigen::MatrixX3d .
-
class
ElementTypeCollection
- #include <Typenames.h>
Another name for an std::vector<ElementType> .
-
class
Gradient
- #include <Typenames.h>
Another name for an Eigen::RowVector3d .
-
class
GradientCollection
- #include <Typenames.h>
Another name for a row-major Eigen::MatrixX3d.
-
class
HessianMatrix
- #include <Typenames.h>
Another name for a Eigen::MatrixXd .
-
class
Dipole
- #include <Typenames.h>
Another name for an Eigen::RowVector3d .
-
class
DipoleGradient
- #include <Typenames.h>
Another name for a row-major Eigen::MatrixX3d.
-
class
Position
- #include <Typenames.h>
Another name for an Eigen::RowVector3d .
-
class
PositionCollection
- #include <Typenames.h>
Another name for a row-major Eigen::MatrixX3d .
-
namespace
AutomaticDifferentiation
Typedefs
-
using
Value1DType
= typename Value1DOrder<o>::ValueType Templated type for a value in 1 dimension.
-
using
Value3DType
= typename Value3DOrder<o>::ValueType Templated type for a value in 3 dimension.
-
using
DerivativeType
= typename Derivative3DImpl<o>::ValueType Templated type for a derivative.
-
using
DerivativeContainerType
= typename DerivativeContainer3DImpl<o>::ValueType Templated type for a derivative container.
Functions
-
derivOrder
getDerivativeOrderEnum
(unsigned order) Get the enum corresponding to the derivative order.
-
int
getDerivativeOrder
(derivOrder order) Get the integer corresponding to the derivative order.
-
template<derivOrder
o
>
Value1DType<o>getFromFull
(double v, double firstDer, double secondDer) Create a value with derivatives in 1 dimension and neglect the unnecessary derivatives.
-
template<derivOrder
o
>
Value1DType<o>constant1D
(double c) Transform a double to a ValueWithDerivative in one dimension, with derivatives equal to zero.
-
template<derivOrder
o
>
Value1DType<o>variableWithUnitDerivative
(double v) Transform v to a ValueWithDerivative in one dimension, with first derivative 1 and second derivative 0.
-
template<derivOrder
o
>
Value3DType<o>constant3D
(double c) Transform a double to a ValueWithDerivative in three dimensions, with derivatives equal to zero.
-
template<derivOrder
o
>
Value3DType<o>toX
(double x) Get X as a value with derivatives in three dimensions.
The only non-zero derivative is the first derivative in x-direction.
-
template<derivOrder
o
>
Value3DType<o>toY
(double y) Get Y as a value with derivatives in three dimensions.
The only non-zero derivative is the first derivative in y-direction.
-
template<derivOrder
o
>
Value3DType<o>toZ
(double z) Get Z as a value with derivatives in three dimensions.
The only non-zero derivative is the first derivative in z-direction.
-
template<derivOrder
o
>
Value3DType<o>toRSquared
(double x, double y, double z) Get R-squared as a value with derivatives in three dimensions.
-
template<derivOrder
o
>
Value3DType<o>get3Dfrom1D
(Value1DType<o> v, const Eigen::Vector3d &R) Get a value with derivatives in 3 dimensions from the value with derivatives in one dimension, given a vector R.
-
template<derivOrder
o
>
Value3DType<o>getValueWithOppositeDerivative
(const Value3DType<o> &v) Get the value with inverted derivatives (useful for pairs of derivatives for two atoms).
The sign of the first derivatives changes.
-
template<derivOrder
o
>
doublegetValue1DAsDouble
(const Value1DType<o> &v) Extract the value with derivatives in 1 dimension as a double.
-
template<derivOrder
o
>
doublegetValue3DAsDouble
(const Value3DType<o> &v) Extract the value with derivatives in 3 dimension as a double.
-
template<>
doubleconstant1D
<derivOrder::zero>(double c)
-
template<>
doublevariableWithUnitDerivative
<derivOrder::zero>(double v)
-
template<>
doublegetFromFull
<derivOrder::zero>(double v, double, double)
-
template<>
doubleconstant3D
<derivOrder::zero>(double c)
-
template<>
doubletoX
<derivOrder::zero>(double x)
-
template<>
doubletoY
<derivOrder::zero>(double y)
-
template<>
doubletoZ
<derivOrder::zero>(double z)
-
template<>
doubletoRSquared
<derivOrder::zero>(double x, double y, double z)
-
template<>
doubleget3Dfrom1D
<derivOrder::zero>(double v, const Eigen::Vector3d&)
-
template<>
doublegetValueWithOppositeDerivative
<derivOrder::zero>(const double &v)
-
template<>
doublegetValue1DAsDouble
<derivOrder::zero>(const double &v)
-
template<>
doublegetValue3DAsDouble
<derivOrder::zero>(const double &v)
-
template<>
First1Dconstant1D
<derivOrder::one>(double c)
-
template<>
First1DvariableWithUnitDerivative
<derivOrder::one>(double v)
-
template<>
First1DgetFromFull
<derivOrder::one>(double v, double firstDer, double)
-
template<>
First3Dconstant3D
<derivOrder::one>(double c)
-
template<>
First3DtoX
<derivOrder::one>(double x)
-
template<>
First3DtoY
<derivOrder::one>(double y)
-
template<>
First3DtoZ
<derivOrder::one>(double z)
-
template<>
First3DtoRSquared
<derivOrder::one>(double x, double y, double z)
-
template<>
First3Dget3Dfrom1D
<derivOrder::one>(First1D v, const Eigen::Vector3d &R)
-
template<>
First3DgetValueWithOppositeDerivative
<derivOrder::one>(const First3D &v)
-
template<>
doublegetValue1DAsDouble
<derivOrder::one>(const First1D &v)
-
template<>
doublegetValue3DAsDouble
<derivOrder::one>(const First3D &v)
-
template<>
Second1Dconstant1D
<derivOrder::two>(double c)
-
template<>
Second1DvariableWithUnitDerivative
<derivOrder::two>(double v)
-
template<>
Second1DgetFromFull
<derivOrder::two>(double v, double firstDer, double secondDer)
-
template<>
Second3Dconstant3D
<derivOrder::two>(double c)
-
template<>
Second3DtoX
<derivOrder::two>(double x)
-
template<>
Second3DtoY
<derivOrder::two>(double y)
-
template<>
Second3DtoZ
<derivOrder::two>(double z)
-
template<>
Second3DtoRSquared
<derivOrder::two>(double x, double y, double z)
-
template<>
Second3Dget3Dfrom1D
<derivOrder::two>(Second1D v, const Eigen::Vector3d &R)
-
template<>
Second3DgetValueWithOppositeDerivative
<derivOrder::two>(const Second3D &v)
-
template<>
doublegetValue1DAsDouble
<derivOrder::two>(const Second1D &v)
-
template<>
doublegetValue3DAsDouble
<derivOrder::two>(const Second3D &v)
-
template<typename
DerivativeT
, typenameCrtp
>
Crtpoperator+
(double v, const FirstBase<DerivativeT, Crtp> &rhs)
-
template<typename
DerivativeT
, typenameCrtp
>
Crtpoperator-
(double v, const FirstBase<DerivativeT, Crtp> &rhs)
-
template<typename
DerivativeT
, typenameCrtp
>
Crtpoperator*
(double f, const FirstBase<DerivativeT, Crtp> &rhs)
-
template<typename
DerivativeT
, typenameCrtp
>
Crtpoperator/
(double f, const FirstBase<DerivativeT, Crtp> &rhs)
-
template<typename
DerivativeT
, typenameCrtp
>
Crtpsquare
(const FirstBase<DerivativeT, Crtp> &value)
-
template<typename
DerivativeT
, typenameCrtp
>
Crtpsqrt
(const FirstBase<DerivativeT, Crtp> &value)
-
template<typename
DerivativeT
, typenameCrtp
>
Crtpexp
(const FirstBase<DerivativeT, Crtp> &value)
-
template<derivativeType
o
>
DerivativeType<o>getOppositeDerivative
(const DerivativeType<o> &v) Get opposed derivatives.
i.e. sign of first derivative changes.
-
template<derivativeType
o
>
DerivativeType<o>getDerivativeFromValueWithDerivatives
(const Value3DType<UnderlyingOrder<o>> &v) Extract the derivatives from a value type with derivatives.
-
template<derivativeType
o
>
voidaddDerivativeToContainer
(DerivativeContainerType<o> &container, int a, int b, const DerivativeType<o> &v) Add derivatives to a derivative container.
- Parameters
v
: Derivative for the pair of indexes a-b. Considering the direction a->b.
-
template<>
DerivativeType<derivativeType::first>getOppositeDerivative
<derivativeType::first>(const DerivativeType<derivativeType::first> &v)
-
template<>
DerivativeType<derivativeType::second_atomic>getOppositeDerivative
<derivativeType::second_atomic>(const DerivativeType<derivativeType::second_atomic> &v)
-
template<>
DerivativeType<derivativeType::second_full>getOppositeDerivative
<derivativeType::second_full>(const DerivativeType<derivativeType::second_full> &v)
-
template<>
DerivativeType<derivativeType::first>getDerivativeFromValueWithDerivatives
<derivativeType::first>(const Value3DType<derivOrder::one> &v)
-
template<>
DerivativeType<derivativeType::second_atomic>getDerivativeFromValueWithDerivatives
<derivativeType::second_atomic>(const Value3DType<derivOrder::two> &v)
-
template<>
DerivativeType<derivativeType::second_full>getDerivativeFromValueWithDerivatives
<derivativeType::second_full>(const Value3DType<derivOrder::two> &v)
-
template<>
voidaddDerivativeToContainer
<derivativeType::first>(DerivativeContainerType<derivativeType::first> &container, int a, int b, const DerivativeType<derivativeType::first> &v)
-
template<>
voidaddDerivativeToContainer
<derivativeType::second_atomic>(DerivativeContainerType<derivativeType::second_atomic> &container, int a, int b, const DerivativeType<derivativeType::second_atomic> &v)
-
template<>
voidaddDerivativeToContainer
<derivativeType::second_full>(DerivativeContainerType<derivativeType::second_full> &container, int a, int b, const DerivativeType<derivativeType::second_full> &v)
Variables
-
constexpr derivOrder
UnderlyingOrder
= UnderlyingOrderImpl<O>::o Template variable for the derivative order corresponding to a derivative type.
-
template<derivOrder
O
>
structValue3DOrder
- #include <AutomaticDifferentiationTypesHelper.h>
Values in 3 dimensions.
-
template<derivOrder
O
>
structValue1DOrder
- #include <AutomaticDifferentiationTypesHelper.h>
Values in 1 dimension.
-
class
First1D
: public Scine::Utils::AutomaticDifferentiation::FirstBase<double, First1D> - #include <First1D.h>
Class representing values in one dimension and allowing for the automatic calculation of first derivatives.
-
class
First3D
: public Scine::Utils::AutomaticDifferentiation::FirstBase<Eigen::Vector3d, First3D> - #include <First3D.h>
Class representing values in one dimensions and allowing for the automatic calculation of first derivatives.
-
template<typename
DerivativeT
, typenameCrtp
>
classFirstBase
- #include <FirstBase.h>
Base class representing values with some derivative type and allowing for the automatic calculation of first derivatives.
This class makes use of CRTP so that the functions will directly have the correct return type for the derived classes.
-
class
FirstND
: public Scine::Utils::AutomaticDifferentiation::FirstBase<Eigen::MatrixXd, FirstND> - #include <FirstND.h>
Class representing values in N dimensions and allowing for the automatic calculation of first derivatives in those N dimensions.
-
class
Second1D
- #include <Second1D.h>
Class representing values in one dimensions and allowing for the automatic calculation of first and second derivatives.
-
class
Second3D
- #include <Second3D.h>
Class representing values in three dimensions and allowing for the automatic calculation of first and second derivatives.
-
using
-
namespace
BSplines
-
class
BSpline
- #include <BSpline.h>
Contains the standard implementation of a basis-spline curve. Evaluation and getter methods are defined so that knot vectors and control points of derivatives are calculated when they are needed.
-
class
BSplineBasis
- #include <BSplineBasis.h>
Evaluate the B-Spline basis functions that are defined by the knot vector
-
class
BSplineTools
- #include <BSplineTools.h>
Contains methods that can be used by several B-spline classes.
-
class
Coefficients
- #include <Coefficients.h>
Class for the B-Spline coefficients N for some given derivativeOrder and u value. Since many of the coefficients are equal to zero, just the non-zero coefficients are saved.
-
class
ControlPolygonGenerator
: public Scine::Utils::BSplines::Generator - #include <ControlPolygonGenerator.h>
Generates a B-spline curve from a set of data points that are used as control points.
-
class
Exception
: public runtime_error - #include <Exceptions.h>
Base class for exceptions related to the BSplines library.
Subclassed by Scine::Utils::BSplines::IncompatibleKnotVectorsForDimensionalMerge, Scine::Utils::BSplines::InvalidSplitDimension, Scine::Utils::BSplines::UnavailableDerivativeException
-
class
FixedEndsPenalizedLeastSquares
- #include <FixedEndsPenalizedLeastSquares.h>
Generate control points for a B-spline fitted from data points at given coordinates for a known knot vector.
- See
FixedEndsPenalizedLeastSquaresGenerator, FixedEndsFixedKnotSplineGenerator
-
class
FixedEndsPenalizedLeastSquaresGenerator
: public Scine::Utils::BSplines::Generator - #include <FixedEndsPenalizedLeastSquaresGenerator.h>
Generates a B-Spline curve with a specified number of control points approximating the data points with fixed ends. „Fixed ends” means that the first and last control points are constrained to coincide with the first and last data point of the set. (see the NURBS book by Piegl 1997) Thus, all but the first and last control points (n-1 in total) are optimized. Still, the resulting B-Splines curve passes through the first and last control point since the first and last basis functions are equal to unity at the ends of the domain (N(u=0)=1, N(u=1)=1, therefore C(u=0)=P_0=R_0 and C(u=1)=P_last=R_last). Penalization can be turned on by specifying a lambda value > 0 and difference orders can be specified by kappa. (see the NURBS book by Piegl 1997)
-
class
Generator
- #include <Generator.h>
Basis class for BSpline generators. NB: We do not take a “const Eigen::MatrixXd&” since this would create a temporary when using it with Eigen::VectorXd.
Subclassed by Scine::Utils::BSplines::ControlPolygonGenerator, Scine::Utils::BSplines::FixedEndsPenalizedLeastSquaresGenerator, Scine::Utils::BSplines::InterpolationGenerator, Scine::Utils::BSplines::LooseEndsPenalizedLeastSquaresGenerator
-
class
InterpolationGenerator
: public Scine::Utils::BSplines::Generator - #include <InterpolationGenerator.h>
Generates a B-spline curve interpolating the data points. (see the NURBS book by Piegl 1997)
-
class
KnotInserter
- #include <KnotInserter.h>
Implementation of the knot insertion algorithm by Böhm. doi: 10.1016/0010-4485(80)90154-2
-
class
LinearInterpolator
- #include <LinearInterpolator.h>
This class generates a bspline interpolating between two given position collections.
-
class
LooseEndsPenalizedLeastSquares
- #include <LooseEndsPenalizedLeastSquares.h>
Generate control points for a B-spline fitted from data points at given coordinates for a known knot vector.
- See
LooseEndsPenalizedLeastSquaresGenerator, LooseEndsFixedKnotSplineGenerator
-
class
LooseEndsPenalizedLeastSquaresGenerator
: public Scine::Utils::BSplines::Generator - #include <LooseEndsPenalizedLeastSquaresGenerator.h>
Generates a B-Spline curve with a specified number of control points approximating the dat a points with loose ends. „Loose ends” means that the first and last control points do not need to coincide with the first and last data point of the set. Thus, all n+1 control points are optimized. Still, the resulting B-Spline curve passes through the first and last control point since the first and last basis functions are equal to unity at the ends of the domain (N(u=0)=1, N(u=1)=1, therefore C(u=0)=P0 and C(u=1)=Plast). Penalization can be turned on by specifying a lambda value > 0 and difference orders can be specified by kappa.
-
class
MolecularSpline
- #include <MolecularSpline.h>
Class for a molecular trajectory saved as a B-spline. In principle, just a struct of a BSpline and a ElementTypeCollection.
-
class
Splitter
- #include <Splitter.h>
Splits a B-spline curve at a give parameter.
-
namespace
ControlPointDerivatives
Calculation of the derivatives of BSpline curves C (or of dC/du, d2C/du2, …) with respect to the control points.
Not only can the derivatives of the curve itself with respect to the control points be calculated, but also of dC/du, d2C/du2, etc. The degree of the curve to derive is given by “curveDerivative” in some functions below.
The functions exist in two variants: one to calculate the derivatives of the curve with respect to one control point, or with respect to all the control points.
Note that the derivative of some control point coordinate i is non-zero only for the coordinate i of the curve.
Functions
-
Eigen::VectorXd
oneDerivative
(const BSpline &spline, double u, int controlPointIndex, int curveDerivative)
-
Eigen::MatrixXd
allDerivatives
(const BSpline &spline, double u, int curveDerivative)
-
Eigen::VectorXd
curveDerivatives
(const BSpline &spline, double u, int controlPointIndex) Get the derivatives of the curve at a given u with respect to some control point coordinates. returns a vector of dCk / dPk for k in [0, nDimensions). NB: all other dCi / dPj are zero.
-
Eigen::MatrixXd
curveDerivatives
(const BSpline &spline, double u) Get the derivatives of the curve at a given u with respect to all control point coordinates. returns a matrix of dCk / dP^A_k for k in [0, nDimensions), and A being a given control point. NB: all other dCi / dPj are zero.
-
Eigen::VectorXd
firstOrderCurveDerivatives
(const BSpline &spline, double u, int controlPointIndex) Get the derivatives of the curve tangent at a given u with respect to some control point coordinates. returns a vector of dC’k / dPk for k in [0, nDimensions). NB: all other dC’i / dPj are zero.
-
Eigen::MatrixXd
firstOrderCurveDerivatives
(const BSpline &spline, double u) Get the derivatives of the curve tangent at a given u with respect to all control point coordinates. returns a matrix of dC’k / dP^A_k for k in [0, nDimensions), and A being a given control point. NB: all other dC’i / dPj are zero.
-
Eigen::VectorXd
secondOrderCurveDerivatives
(const BSpline &spline, double u, int controlPointIndex) Get the derivatives of the curve tangent at a given u with respect to some control point coordinates. returns a vector of dC’k / dPk for k in [0, nDimensions). NB: all other dC’i / dPj are zero.
-
Eigen::MatrixXd
secondOrderCurveDerivatives
(const BSpline &spline, double u) Get the derivatives of the curve tangent at a given u with respect to all control point coordinates. returns a matrix of dC’k / dP^A_k for k in [0, nDimensions), and A being a given control point. NB: all other dC’i / dPj are zero.
-
Eigen::VectorXd
-
namespace
GeneratorUtils
Utility functions for BSpline generation. Includes methods and attributes that can be used by all BSplineGenerators Methods for creating parameters and knotVectors from the NURBS book by Piegl 1997: generateParametersByEquallySpacedMethod() uses eq. (9.3) generateParametersByChordLengthMethod() uses eqs. (9.4)-(9.5) generateKnotVectorByDeBoorMethod() uses the eqs. (9.68-9.69) generateKnotVectorByEquallySpacedMethod() uses eq. (9.7) generateKnotVectorByKnotAveraging() uses eq. (9.8)
- See
Functions
-
Eigen::VectorXd
generateParametersByEquallySpacedMethod
(const Eigen::MatrixXd &dataPoints)
-
Eigen::VectorXd
generateParametersByCentripetalMethod
(const Eigen::MatrixXd &dataPoints)
-
Eigen::VectorXd
generateParametersByChordLengthMethod
(const Eigen::MatrixXd &dataPoints)
-
Eigen::VectorXd
generateKnotVectorByDeBoorsMethod
(int splineDegree, int numberPolynomialSegments, const Eigen::VectorXd &uBar)
-
Eigen::VectorXd
generateKnotVectorByUniformMethod
(int splineDegree, int numberPolynomialSegments)
-
Eigen::VectorXd
generateKnotVectorByKnotAveraging
(int splineDegree, int numberPolynomialSegments, const Eigen::VectorXd &uBar)
-
class
-
namespace
Constants
A namespace for all constant (hardcoded) data.
This namespace does not include fitted parameters for specific methods, only general constant parameters, such as natural constants and atomic data.
Variables
-
constexpr double
elementaryCharge
= 1.6021766208e-19
-
constexpr double
avogadroNumber
= 6.022140857e23
-
constexpr double
bohrRadius
= 0.52917721067e-10
-
constexpr double
pi
= 3.14159265358979323846
-
constexpr double
rad_per_degree
= pi / 180
-
constexpr double
degree_per_rad
= 180 / pi
-
constexpr double
meter_per_bohr
= bohrRadius
-
constexpr double
bohr_per_meter
= 1 / meter_per_bohr
-
constexpr double
angstrom_per_meter
= 1e10
-
constexpr double
meter_per_angstrom
= 1 / angstrom_per_meter
-
constexpr double
angstrom_per_bohr
= angstrom_per_meter * meter_per_bohr
-
constexpr double
bohr_per_angstrom
= 1. / angstrom_per_bohr
-
constexpr double
hartree_per_ev
= 3.674932248e-2
-
constexpr double
ev_per_hartree
= 1 / hartree_per_ev
-
constexpr double
joule_per_hartree
= 4.359744650e-18
-
constexpr double
hartree_per_joule
= 1 / joule_per_hartree
-
constexpr double
joule_per_calorie
= 4.184
-
constexpr double
calorie_per_joule
= 1 / joule_per_calorie
-
constexpr double
kJPerMol_per_hartree
= joule_per_hartree / 1000 * avogadroNumber
-
constexpr double
hartree_per_kJPerMol
= 1 / kJPerMol_per_hartree
-
constexpr double
kCalPerMol_per_hartree
= joule_per_hartree * calorie_per_joule / 1000 * avogadroNumber
-
constexpr double
hartree_per_kCalPerMol
= 1 / kCalPerMol_per_hartree
-
constexpr double
ev_per_invCentimeter
= 8.065540107e3
-
constexpr double
invCentimeter_per_ev
= 1.239842573e-4
-
constexpr double
hartree_per_invCentimeter
= 4.556335281e-6
-
constexpr double
invCentimeter_per_hartree
= 219474.63
-
constexpr double
kJPerMol_per_invCentimeter
= 2.859144166e-3
-
constexpr double
invCentimeter_per_kJPerMol
= 349.7550112241469
-
constexpr double
kCalPerMol_per_invCentimeter
= 1.196265919e-2
-
constexpr double
invCentimeter_per_kCalPerMol
= 8.359345393
-
class
ElementDataSingleton
- #include <ElementData.h>
Provides a mapping of ElementType to ElementData and accessing Elements by a symbol string.
This class is a singleton to avoid multiple instances of the same hardcoded data in memory.
Features:
Fast lookup for subscript operator [ElementType]. Throws std::out_of_range.
Slow lookup for subscript operator [std::string]. Throws ElementData::DataNotAvailable.
-
constexpr double
-
namespace
detail
Functions
-
constexpr unsigned
isotope
(const unsigned Z, const unsigned A)
-
constexpr unsigned
-
namespace
Dftd3
-
class
Dftd3
- #include <Dftd3.h>
A class calculating D3 semi-classical dispersion corrections (with BJ damping) for energies and gradients.
This class uses a default constructor. The calculations are initialized by the initialize function. Simple calculations are done using the calculate function, to which you can pass the required derivative level.
References:
J. Chem. Phys. 132, 154104, (2010) (Description D3)
J. Comput. Chem. 32, 1456, (2011) (Description of BJ damping function)
Developer Info:
The assignment of some functions as public is based on the fact that they are needed for the non-bonded interactions in the molecular mechanics library.
-
class
Dftd3Atom
: public Scine::Utils::Atom - #include <Dftd3Atom.h>
Describes and atom for a D3 semi-classical dispersion correction calculation.
-
class
Dftd3Parameters
- #include <Dftd3Parameters.h>
A class handling the parameters involved in the calculation of D3 energies and gradients.
Most parameters in this method are static constexpr because they stay the same for all D3 methods. The parameters a1, s8 and a2 are specified by the user. One set of parameters, the reference pairs used to calculate the C6 coefficients, are outsourced to the Dftd3ReferencePairs class, because it involves a very large number of values.
-
class
Dftd3ReferencePairs
- #include <Dftd3ReferencePairs.h>
This class holds the large 4-dimensional array of all reference pairs needed for the calculation of the C6 coefficients.
-
class
-
namespace
ExternalQC
-
class
Exception
: public runtime_error - #include <Exceptions.h>
Base exception.
Subclassed by Scine::Utils::ExternalQC::OutputFileParsingError, Scine::Utils::ExternalQC::UnsuccessfulSystemCommand
-
class
UnsuccessfulSystemCommand
: public Scine::Utils::ExternalQC::Exception - #include <Exceptions.h>
Exception thrown when there is an error while executing the command for the external program.
-
class
OutputFileParsingError
: public Scine::Utils::ExternalQC::Exception - #include <Exceptions.h>
Exception thrown for errors during output file parsing.
-
class
ExternalProgram
- #include <ExternalProgram.h>
This class allows for running external programs through SCINE.
This class is used by the ExternalQC calculators.
-
class
GaussianCalculatorSettings
: public Scine::Utils::Settings - #include <GaussianCalculatorSettings.h>
Settings for Gaussian calculations.
-
class
GaussianInputFileCreator
- #include <GaussianInputFileCreator.h>
This class creates Gaussian input files.
-
class
GaussianOutputParser
- #include <GaussianOutputParser.h>
This class parses information out of the Gaussian output file.
-
class
OrcaCalculatorSettings
: public Scine::Utils::Settings - #include <OrcaCalculatorSettings.h>
Settings for ORCA calculations.
-
class
OrcaHessianOutputParser
- #include <OrcaHessianOutputParser.h>
This class parses information out of the ORCA hessian output file.
-
class
OrcaInputFileCreator
- #include <OrcaInputFileCreator.h>
This class creates ORCA input files.
-
class
OrcaMainOutputParser
- #include <OrcaMainOutputParser.h>
This class parses information out of the main ORCA output file.
-
class
EmptyStateException
: public exception - #include <OrcaState.h>
Exception for the case that a state is requested which is empty.
-
class
StateSavingException
: public exception - #include <OrcaState.h>
Exception for a failure to save or load an ORCA state.
-
struct
OrcaState
: public State - #include <OrcaState.h>
Definition of a calculation state for ORCA calculations.
The calculation state is defined as a unique identifier. Only a string state is saved here.
-
namespace
SettingsNames
Variables
-
constexpr const char *
gaussianFilenameBase
= "gaussian_filename_base"
-
constexpr const char *
gaussianNumProcs
= "gaussian_nprocs"
-
constexpr const char *
orcaNumProcs
= "orca_nprocs"
-
constexpr const char *
orcaFilenameBase
= "orca_filename_base"
-
constexpr const char *
baseWorkingDirectory
= "base_working_directory"
-
constexpr const char *
externalQCMemory
= "external_program_memory"
-
constexpr const char *
deleteTemporaryFiles
= "delete_tmp_files"
-
constexpr const char *
-
class
-
namespace
Geometry
Functionalities working with an entire geometry (PositionCollection).
Functions
-
PositionCollection
translatePositions
(const PositionCollection &positions, const Eigen::Ref<Eigen::RowVector3d> &translation) Translates a set of postions by a given displacement.
- Return
PositionCollection Returns the translated positions.
- Parameters
positions
: The original positions.translation
: The displacement to be added.
-
void
translatePositionsInPlace
(PositionCollection &positions, const Eigen::Ref<Eigen::RowVector3d> &translation) Translates a set of positions by a given displacement.
The translation happens in-place.
- Parameters
positions
: The initial positions, will be transformed in-place.translation
: The displacement to be added.
-
int
getIndexOfClosestAtom
(const PositionCollection &positions, const Position &targetPosition, double squaredDistanceConsideredZero = -1.0) Get the index of closest position (atom) to a given position in space.
- Return
int The index of the closest atom to the given target.
- Parameters
positions
: A set of positions to be traversed.targetPosition
: The target position.distanceConsideredZero
: Squared distance between two positions resulting in them being considered equal and therefore skipping this position as it is already present in the given PositionCollection. The default is set to a negative value, so that all positions are considered as possible candidates for the closest one.
-
int
getIndexOfAtomInStructure
(const AtomCollection &structure, const Atom &atom, double squaredDistanceConsideredZero = 1e-4) Get the index of a given atom in a given molecular structure.
- Return
int The index of the given atom in the given molecular structure.
- Parameters
structure
: The structure to be traversed.atom
: The target atom that is tried to be found in the given structure.distanceConsideredZero
: Squared distance between two atoms resulting in them being considered equal.
- Exceptions
std::runtime_error
: Function throws error if the atom is not found in the given structure.
-
Eigen::MatrixXd
positionVectorToMatrix
(const Eigen::VectorXd &v) Transforms a 3N-dimensional vector {x0, y0, z0, x1, y1, z1, …} to a Nx3 matrix.
- Return
Eigen::MatrixXd Returns the final Nx3 matrix.
- Parameters
v
: The positions in vector form.
-
Eigen::VectorXd
positionMatrixToVector
(const Eigen::MatrixXd &m) Transforms a Nx3 matrix to a 3N-dimensional vector {x0, y0, z0, x1, y1, z1, …}.
- Return
Eigen::VectorXd Returns the final vector.
- Parameters
m
: The positions in matrix form.
-
void
alignPositions
(const PositionCollection &reference, PositionCollection &positions) Rotate and translate positions so that it is as close as possible to referencePositions.
- Parameters
reference
: The reference positions.positions
: The positions to be aligned, will be transformed in place.
-
std::vector<double>
getMasses
(const ElementTypeCollection &elements) Get a vector of all masses (in a.u.).
- Return
std::vector<double> Returns the masses listed in a vector.
- Parameters
elements
: A collection of elements.
-
Position
getCenterOfMass
(const PositionCollection &positions, const std::vector<double> &masses) Get the center of mass.
- Return
Position Returns the center of mass (COM).
- Parameters
positions
: The positions.masses
: The masses (sorted according to the positions).
-
Position
getCenterOfMass
(const AtomCollection &structure) Get the center of mass.
- Return
Position Returns the center of mass (COM).
- Parameters
structure
: The structure (positions and masses are relevant).
-
Position
getAveragePosition
(const PositionCollection &positions) Get the average Position.
(The average Position is identical to the center of mass if all masses are identical)
- Return
Position Returns the average position.
- Parameters
positions
: The positions.
-
Eigen::Matrix3d
calculateInertiaTensor
(const PositionCollection &positions, const std::vector<double> &masses, const Position ¢erOfMass) Calculates the inertia tensor.
- Return
Eigen::Matrix3d Returns the inertia tensor.
- Parameters
positions
: The positions.masses
: The masses (sorted according to the positions).centerOfMass
: The center of mass.
-
PrincipalMomentsOfInertia
calculatePrincipalMoments
(const PositionCollection &positions, const std::vector<double> &masses, const Position ¢erOfMass) Calculates the principal moments of inertia.
- Return
PrincipalMomentsOfInertia Returns the principal moments of inertia.
- Parameters
positions
: The positions.masses
: The masses (sorted according to the positions).centerOfMass
: The center of mass.
-
Eigen::MatrixXd
calculateTranslationAndRotationModes
(const PositionCollection &positions, const ElementTypeCollection &elements) Calculated the cartesian modes corresponding to translations and rotations of the entire system.
- Return
Eigen::MatrixXd The rotation and translation modes. Translation modes (x,y,z) first-third column, rotation modes 3-final column (depending on the geometry)
- Parameters
positions
: The positions of all atoms.elements
: The ElemenetTypes of all atoms.
-
Eigen::MatrixXd
calculateRotTransFreeTransformMatrix
(const PositionCollection &positions, const ElementTypeCollection &elements, bool massWeighted = false) Generates the matrix removing rotation and translation modes from the given geometry if applied.
- Return
Eigen::MatrixXd The transformation matrix (applied as X^T*H*X to the Hessian).
- Parameters
positions
: The positions of all atoms.elements
: The ElemenetTypes of all atoms.massWeighted
: True if Hessian to be transformed is mass-weighted
-
class
PrincipalMomentsOfInertia
- #include <Geometry.h>
The principal moments of inertia stored.
-
PositionCollection
-
namespace
LcaoUtils
Functions
-
void
getNumberUnrestrictedElectrons
(int &nAlpha, int &nBeta, int nElectrons, int spinMultiplicity) Calculate the numbers of alpha and beta electrons from the total number of electrons and the spin multiplicity.
-
void
solveOccupiedRestrictedEigenvalueProblem
(const SpinAdaptedMatrix &fockMatrix, MolecularOrbitals &coefficientMatrix, SingleParticleEnergies &singleParticleEnergies, int nElectrons)
-
void
solveOccupiedRestrictedGeneralizedEigenvalueProblem
(const SpinAdaptedMatrix &fockMatrix, const Eigen::MatrixXd &overlapMatrix, MolecularOrbitals &coefficientMatrix, SingleParticleEnergies &singleParticleEnergies, int nElectrons)
-
void
solveOccupiedUnrestrictedEigenvalueProblem
(const SpinAdaptedMatrix &fockMatrix, MolecularOrbitals &coefficientMatrix, SingleParticleEnergies &singleParticleEnergies, int nAlphaElectrons, int nBetaElectrons)
-
void
solveOccupiedUnrestrictedGeneralizedEigenvalueProblem
(const SpinAdaptedMatrix &fockMatrix, const Eigen::MatrixXd &overlapMatrix, MolecularOrbitals &coefficientMatrix, SingleParticleEnergies &singleParticleEnergies, int nAlphaElectrons, int nBetaElectrons)
-
void
solveRestrictedEigenvalueProblem
(const SpinAdaptedMatrix &fockMatrix, MolecularOrbitals &coefficientMatrix, SingleParticleEnergies &singleParticleEnergies)
-
void
solveRestrictedGeneralizedEigenvalueProblem
(const SpinAdaptedMatrix &fockMatrix, const Eigen::MatrixXd &overlapMatrix, MolecularOrbitals &coefficientMatrix, SingleParticleEnergies &singleParticleEnergies)
-
void
solveUnrestrictedEigenvalueProblem
(const SpinAdaptedMatrix &fockMatrix, MolecularOrbitals &coefficientMatrix, SingleParticleEnergies &singleParticleEnergies)
-
void
solveUnrestrictedGeneralizedEigenvalueProblem
(const SpinAdaptedMatrix &fockMatrix, const Eigen::MatrixXd &overlapMatrix, MolecularOrbitals &coefficientMatrix, SingleParticleEnergies &singleParticleEnergies)
-
void
calculateRestrictedDensityMatrix
(DensityMatrix &densityMatrix, const MolecularOrbitals &coefficientMatrix, int nElectrons)
-
void
calculateUnrestrictedDensityMatrices
(DensityMatrix &densityMatrix, const MolecularOrbitals &coefficientMatrix, int nElectrons, int spinMultiplicity)
-
void
calculateRestrictedEnergyWeightedDensityMatrix
(Eigen::MatrixXd &energyWeightedDensityMatrix, const MolecularOrbitals &coefficientMatrix, const SingleParticleEnergies &singleParticleEnergies, int nElectrons)
-
void
calculateUnrestrictedEnergyWeightedDensityMatrix
(Eigen::MatrixXd &energyWeightedDensityMatrix, const MolecularOrbitals &coefficientMatrix, const SingleParticleEnergies &singleParticleEnergies, int nElectrons, int spinMultiplicity)
-
void
calculateBondOrderMatrix
(Utils::BondOrderCollection &bondOrderMatrix, const DensityMatrix &densityMatrix, const Eigen::MatrixXd &overlapMatrix, const AtomsOrbitalsIndexes &aoIndexes) Computes the lower-triangular bond-order matrix for an non-orthogonal basis.
-
void
calculateOrthonormalBondOrderMatrix
(Utils::BondOrderCollection &bondOrderMatrix, const DensityMatrix &densityMatrix, const AtomsOrbitalsIndexes &aoIndexes) Computes the lower-triangular bond-order matrix for an orthogonal basis.
-
void
calculateOrthonormalAtomicCharges
(std::vector<double> &mullikenCharges, const std::vector<double> &coreCharges, const DensityMatrix &densityMatrix, const AtomsOrbitalsIndexes &aoIndexes)
-
void
calculateMullikenAtomicCharges
(std::vector<double> &mullikenCharges, const std::vector<double> &coreCharges, const DensityMatrix &densityMatrix, const Eigen::MatrixXd &overlapMatrix, const AtomsOrbitalsIndexes &aoIndexes)
-
class
DensityMatrixBuilder
- #include <DensityMatrixBuilder.h>
Class to generate density matrices from coefficient matrices. Different possibilities to do so:
Specify the number of electrons
Specify which orbitals to consider
Specify the number of electrons and some number of swaps TODO: Use the class MolecularOrbitalsManipulation instead of reimplementing the mixes and swaps
-
class
DensityMatrixGenerator
- #include <DensityMatrixGenerator.h>
Class to convert an electronic occupation and the corresponding molecular orbitals to a density matrix.
-
class
ElectronicOccupation
- #include <ElectronicOccupation.h>
Class to hold information about which molecular orbitals are occupied. TODO: Implement fractional occupation ?
-
class
ElectronicOccupationGenerator
- #include <ElectronicOccupationGenerator.h>
This interface generates an ElectronicOccupation instance, from which the density matrix can be generated (in combination with the molecular orbitals).
Subclassed by Scine::Utils::LcaoUtils::AufbauPrincipleOccupationGenerator
-
class
EnergyWeightedDensityMatrixBuilder
- #include <EnergyWeightedDensityMatrixBuilder.h>
Class to generate energy-weighted density matrices for given occupations
-
class
HFWaveFunctionOverlap
- #include <HFWaveFunctionOverlap.h>
Class to calculate the overlap between two HartreeFock-like wave functions.
-
class
HomoLumoGapCalculator
- #include <HomoLumoGapCalculator.h>
This class calculates a Homo-Lumo gap, given the single-particle energies and the electronic occupation. In the unrestricted case, puts returns energy difference between the orbitals irrespectively of whether they are alpha- or beta-polarized.
-
class
MolecularOrbitalsManipulation
- #include <MolecularOrbitalsManipulation.h>
Class for transformations on molecular orbitals.
-
void
-
namespace
Methods
-
class
InitializationException
: public runtime_error Subclassed by Scine::Utils::Methods::ParameterFileCannotBeOpenedException, Scine::Utils::Methods::ParameterFileIsInvalidException, Scine::Utils::Methods::ParametersDoNotExistForElementException, Scine::Utils::Methods::ParametersDoNotExistForElementPairException
-
class
-
namespace
OptionNames
Variables
-
constexpr const char *
leapFrogOption
= "leap_frog"
-
constexpr const char *
eulerOption
= "euler"
-
constexpr const char *
velocityVerletOption
= "velocity_verlet"
-
constexpr const char *
-
namespace
OrbitalPerturbation
-
class
RandomOrbitalMixer
- #include <RandomOrbitalMixer.h>
Class to randomly mix randomly chosen molecular orbitals. In the restricted case, the alphaHomo_ and betaHomo_ are both holding the value for restrictedHomo_.
-
class
-
namespace
Regex
Helpers for std::regex.
The functions deliver regular expression building blocks to be used when composing regular expressions. Functions starting with “capturing” add a parenthesis to capture the value.
Functions
-
std::string
lineBegin
() Regex code for the beginning of a line.
- Return
std::string Returns Regex code for the beginning of a line.
-
std::string
lineEnd
() Regex code for the end of a line.
- Return
std::string Returns Regex code for the end of a line.
-
std::string
floatingPointNumber
() Regex code for a floating point number.
- Return
std::string Returns Regex code for a floating point number.
-
std::string
capturingFloatingPointNumber
() Regex code for a floating point number including capture.
- Return
std::string Returns Regex code for a floating point number including capture.
-
std::string
integerNumber
() Regex code for an integer number.
- Return
std::string Returns Regex code for an integer number.
-
std::string
capturingIntegerNumber
() Regex code for an integer number including capture.
- Return
std::string Returns Regex code for an integer number including capture.
-
std::string
addCaptureParenthesis
(const std::string &s) Adds capture paranteses to any string.
- Return
std::string Returns the string s with capture parenthesis added.
- Parameters
s
: The Regex string describing the type to be captured.
-
std::string
-
namespace
SettingsNames
Variables
-
constexpr const char *
timeStepInFemtoseconds
= "MD_time_step"
-
constexpr const char *
integrationAlgorithm
= "MD_integration_scheme"
-
constexpr const char *
temperatureBath
= "temperature_bath"
-
constexpr const char *
targetTemperature
= "target_temperature"
-
constexpr const char *
relaxationTimeFactor
= "relaxation_time_factor"
-
constexpr const char *
numberOfMDSteps
= "number_MD_steps"
-
constexpr const char *
recordFrequency
= "record_frequency"
-
constexpr const char *
linearMomentumRemovalFrequency
= "linear_momentum_removal_frequency"
-
constexpr const char *
angularMomentumRemovalFrequency
= "angular_momentum_removal_frequency"
-
constexpr const char *
saveVelocities
= "save_velocities"
-
constexpr const char *
molecularCharge
= "molecular_charge" SettingsNames provides a consistent list of settings names throughout the whole module.
-
constexpr const char *
spinMultiplicity
= "spin_multiplicity"
-
constexpr const char *
unrestrictedCalculation
= "unrestricted_calculation"
-
constexpr const char *
selfConsistanceCriterion
= "self_consistence_criterion"
-
constexpr const char *
maxIterations
= "max_scf_iterations"
-
constexpr const char *
mixer
= "scf_mixer"
-
constexpr const char *
loggerVerbosity
= "log"
-
constexpr const char *
temperature
= "temperature"
-
constexpr const char *
davidsonForGroundState
= "davidson_for_ground_state"
-
constexpr const char *
NDDODipoleApproximation
= "nddo_dipole"
-
constexpr const char *
parameterFile
= "parameter_file"
-
constexpr const char *
parameterRootDirectory
= "parameter_root"
-
constexpr const char *
method
= "method"
-
constexpr const char *
basisSet
= "basis_set"
-
constexpr const char *
numberOfEigenstates
= "number_eigenstates" @brief Settings for linear response time dependent methods.
-
constexpr const char *
initialSubspaceDimension
= "initial_subspace_dimension"
-
constexpr const char *
useSparseImplementation
= "LRTD_sparse_implementation"
-
constexpr const char *
spinBlock
= "spin_block"
-
constexpr const char *
directness
= "directness"
-
struct
ScfMixers
- #include <SettingsNames.h>
Struct to contain the name of the mixers available.
-
struct
LogLevels
- #include <SettingsNames.h>
Struct to contain the name of the level of verbosity for the logger.
-
constexpr const char *
-
namespace
UniversalSettings
Functions
-
ValueCollection
createDefaultValueCollection
(const DescriptorCollection &descriptors)
-
class
BoolDescriptor
: public Scine::Utils::UniversalSettings::SettingDescriptor - #include <BoolDescriptor.h>
Setting descriptor-derived boolean value.
SettingDescriptor for a bool value. This is a class that contains a string that explains what the setting is for and also a default value.
-
class
CollectionListDescriptor
: public Scine::Utils::UniversalSettings::SettingDescriptor - #include <CollectionListDescriptor.h>
SettingDescriptor for multiple SettingsDescriptors.
-
class
DescriptorCollection
: public Scine::Utils::UniversalSettings::SettingDescriptor - #include <DescriptorCollection.h>
Setting that wraps a vector<pair<str, GenericDescriptor>>.
A setting (string descriptor, generic value pair) whose value is a list of string, GenericDescriptor pairs, which altogether define a nested list of descriptors.
Information
Checks whether a particular descriptor field exists in the configuration
-
class
DirectoryDescriptor
: public Scine::Utils::UniversalSettings::SettingDescriptor - #include <DirectoryDescriptor.h>
SettingDescriptor for a directory path.
-
class
DoubleDescriptor
: public Scine::Utils::UniversalSettings::SettingDescriptor - #include <DoubleDescriptor.h>
SettingDescriptor for a floating-point value.
Can set boundaries on valid values and a default value for this kind of setting.
-
class
Exception
: public runtime_error - #include <Exceptions.h>
Base class for UniversalSettings exceptions.
Subclassed by Scine::Utils::UniversalSettings::AlreadyExistingDescriptorException, Scine::Utils::UniversalSettings::AlreadyExistingValueException, Scine::Utils::UniversalSettings::EmptyOptionListException, Scine::Utils::UniversalSettings::InexistingDescriptorException, Scine::Utils::UniversalSettings::InexistingValueException, Scine::Utils::UniversalSettings::InvalidDescriptorConversionException, Scine::Utils::UniversalSettings::InvalidValueConversionException, Scine::Utils::UniversalSettings::OptionAlreadyExistsException, Scine::Utils::UniversalSettings::OptionDoesNotExistException, Scine::Utils::UniversalSettings::ValueHasDifferentTypeException
-
class
FileDescriptor
: public Scine::Utils::UniversalSettings::SettingDescriptor - #include <FileDescriptor.h>
SettingDescriptor for a file path.
-
class
GenericDescriptor
- #include <GenericDescriptor.h>
Wrapper around SettingDescriptor that hides the setting type.
Makes it possible to handle setting descriptors as objects (but is in principle similar to a pointer to the base class SettingDescriptor).
-
template<typename
BaseT
>
classGenericInstanceEditor
- #include <GenericInstanceEditor.h>
Same as GenericInstanceEditor, defined below, without create function for the case that the constructor needs more parameters, which can then be specified in the derived class.
-
template<typename
Base
>
classGenericInstanceEditorWithDefaultConstructor
: public Scine::Utils::UniversalSettings::GenericInstanceEditor<Base> - #include <GenericInstanceEditor.h>
Template for a class being able to create and modify instances of some polymorphic type from settings specified in the UniversalSettings syntax.
-
template<typename
BaseEditor
, typenameT
>
classGenericInstanceEditorImpl
: public BaseEditor - #include <GenericInstanceEditor.h>
Specification of GenericInstanceEditorWithoutCreateFunction with the type T, to generate automatically some of the virtual functions.
- Template Parameters
BaseEditor
: must be some GenericInstanceEditorT
: class to instantiate, must be a * derived class of the template parameter of BaseEditor.
Subclassed by Scine::Utils::UniversalSettings::GenericInstanceEditorWithDefaultConstructorImpl< BaseEditor, T >
-
template<typename
BaseEditor
, typenameT
>
classGenericInstanceEditorWithDefaultConstructorImpl
: public Scine::Utils::UniversalSettings::GenericInstanceEditorImpl<BaseEditor, T> - #include <GenericInstanceEditor.h>
Specification of GenericInstanceEditor with the type T, to generate automatically some of the virtual functions.
- Template Parameters
BaseEditor
: must be some GenericInstanceEditorWithDefaultConstructorT
: class to instantiate, must be a derived class of the template parameter of BaseEditor.
-
class
GenericValue
- #include <GenericValue.h>
Class that uniformly stores multiple types of values.
Wrapper around some parameter value that hides the actual value. Makes it possible to handle different types as one object.
-
class
InformationOutput
- #include <InformationOutput.h>
This class prints information about setting descriptors in a human-readable format.
-
class
IntDescriptor
: public Scine::Utils::UniversalSettings::SettingDescriptor - #include <IntDescriptor.h>
SettingDescriptor for an integer value.
-
class
IntListDescriptor
: public Scine::Utils::UniversalSettings::SettingDescriptor - #include <IntListDescriptor.h>
SettingDescriptor for a list of integer values.
-
class
OptionListDescriptor
: public Scine::Utils::UniversalSettings::SettingDescriptor - #include <OptionListDescriptor.h>
SettingDescriptor for a list of options, of which one must be chosen.
-
class
ParametrizedOptionListDescriptor
: public Scine::Utils::UniversalSettings::SettingDescriptor - #include <ParametrizedOptionListDescriptor.h>
SettingDescriptor for a list of options, of which one must be chosen, with corresponding settings (that depend on the exact option).
This is for example useful if one of several algorithms must be chosen for some task and each algorithm has specific settings.
-
struct
ParametrizedOptionValue
- #include <ParametrizedOptionValue.h>
Value struct for a ParametrizedOptionList NB: settingsKey is relevant for the generation of input files, as the option and the settings would be saved in different nodes in YAML, for instance. The key for the selectedOption is not registered, it is taken to be the one saved in SettingValueCollection.
-
class
SettingDescriptor
- #include <SettingDescriptor.h>
Class to restrict a particular setting’s type and values.
Contains a string explaining what the setting is for, possibly a default value and a function that checks if the contained value is valid for the setting described.
This is an abstract base class for type-specific descriptor implementations. Other classes derive from it not because of the need for polymorphism, but to collect common functionality (i.e. property description).
Subclassed by Scine::Utils::UniversalSettings::BoolDescriptor, Scine::Utils::UniversalSettings::CollectionListDescriptor, Scine::Utils::UniversalSettings::DescriptorCollection, Scine::Utils::UniversalSettings::DirectoryDescriptor, Scine::Utils::UniversalSettings::DoubleDescriptor, Scine::Utils::UniversalSettings::FileDescriptor, Scine::Utils::UniversalSettings::IntDescriptor, Scine::Utils::UniversalSettings::IntListDescriptor, Scine::Utils::UniversalSettings::OptionListDescriptor, Scine::Utils::UniversalSettings::ParametrizedOptionListDescriptor, Scine::Utils::UniversalSettings::StringDescriptor, Scine::Utils::UniversalSettings::StringListDescriptor
-
class
SettingPopulator
- #include <SettingPopulator.h>
This class populates the common settings of many calculators.
These settings include molecular charge, spin multiplicity, restricted/unrestricted formalism, and Scf options. It populates a Utils::UniversalSettings::DescriptorCollection with default values.
-
class
StringDescriptor
: public Scine::Utils::UniversalSettings::SettingDescriptor - #include <StringDescriptor.h>
SettingDescriptor for a string value.
-
class
StringListDescriptor
: public Scine::Utils::UniversalSettings::SettingDescriptor - #include <StringListDescriptor.h>
SettingDescriptor for a list of strings.
-
class
ValueCollection
- #include <ValueCollection.h>
Wrapper around vector<pair<string, GenericValue>>
Class holding values corresponding to some SettingDescriptorCollection. The functions addXXX() throw a AlreadyExistingValueException if the given name already exists. The functions getXXX() throw a InexistingValueException if the given value does not exist, and a InvalidValueConversionException if the incorrect type is requested. The functions modifyXXX() assume the key is already existing and throw a InexistingValueException if not, and a InvalidValueConversionException if the type is not the same.
Subclassed by Scine::Utils::Settings
-
ValueCollection
-
using
-
namespace