votca 2026-dev
Loading...
Searching...
No Matches
aomatrix.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2021 The VOTCA Development Team
3 * (http://www.votca.org)
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License")
6 *
7 * You may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
19
20#pragma once
21#ifndef VOTCA_XTP_AOMATRIX_H
22#define VOTCA_XTP_AOMATRIX_H
23
24// Local VOTCA includes
25#include "aobasis.h"
26
27namespace votca {
28namespace xtp {
29
30class AOMatrix {
31 public:
32 virtual void Fill(const AOBasis& aobasis) = 0;
33 virtual Index Dimension() = 0;
34};
35
36// derived class for kinetic energy
37class AOKinetic : public AOMatrix {
38 public:
39 void Fill(const AOBasis& aobasis) final;
40 Index Dimension() final { return aomatrix_.rows(); }
41 const Eigen::MatrixXd& Matrix() const { return aomatrix_; }
42
43 private:
44 Eigen::MatrixXd aomatrix_;
45};
46
47// derived class for atomic orbital overlap
48class AOOverlap : public AOMatrix {
49 public:
50 void Fill(const AOBasis& aobasis) final;
51 Index Dimension() final { return aomatrix_.rows(); }
52 const Eigen::MatrixXd& Matrix() const { return aomatrix_; }
53
54 Eigen::MatrixXd singleShellOverlap(const AOShell& shell) const;
56 double SmallestEigenValue() const { return smallestEigenvalue; }
57
58 Eigen::MatrixXd Pseudo_InvSqrt(double etol);
59 Eigen::MatrixXd Sqrt();
60
61 private:
64 Eigen::MatrixXd aomatrix_;
65};
66
67// overlap <chi_m|chi_k> between the functions of two bases (e.g. the same
68// basis at two geometries), rows from row, columns from col
69Eigen::MatrixXd ComputeMixedOverlap(const AOBasis& row, const AOBasis& col);
70
71// derived class for atomic orbital Coulomb interaction
72class AOCoulomb : public AOMatrix {
73 public:
74 void Fill(const AOBasis& aobasis) final;
75 Index Dimension() final { return aomatrix_.rows(); }
76 const Eigen::MatrixXd& Matrix() const { return aomatrix_; }
77
78 Eigen::MatrixXd Pseudo_InvSqrt_GWBSE(const AOOverlap& auxoverlap,
79 double etol);
80 Eigen::MatrixXd Pseudo_InvSqrt(double etol);
82
83 private:
84 void computeCoulombIntegrals(const AOBasis& aobasis);
86 Eigen::MatrixXd aomatrix_;
87};
88
89/* derived class for atomic orbital electrical dipole matrices, required for
90 * electrical transition dipoles
91 */
92class AODipole : public AOMatrix {
93 public:
94 void Fill(const AOBasis& aobasis) final;
95 Index Dimension() final { return aomatrix_[0].rows(); }
96 const std::array<Eigen::MatrixXd, 3>& Matrix() const { return aomatrix_; }
97
98 void setCenter(const Eigen::Vector3d& r) {
99 for (Index i = 0; i < 3; i++) {
100 r_[i] = r[i];
101 }
102 } // definition of a center around which the moment should be calculated
103
104 private:
105 std::array<Eigen::MatrixXd, 3> aomatrix_;
106 std::array<libint2::Shell::real_t, 3> r_ = {0, 0, 0};
107};
108} // namespace xtp
109} // namespace votca
110
111#endif // VOTCA_XTP_AOMATRIX_H
Container to hold Basisfunctions for all atoms.
Definition aobasis.h:42
Index Dimension() final
Definition aomatrix.h:75
void Fill(const AOBasis &aobasis) final
Eigen::MatrixXd aomatrix_
Definition aomatrix.h:86
const Eigen::MatrixXd & Matrix() const
Definition aomatrix.h:76
void computeCoulombIntegrals(const AOBasis &aobasis)
Eigen::MatrixXd Pseudo_InvSqrt(double etol)
Definition aomatrix.cc:88
Index Removedfunctions() const
Definition aomatrix.h:81
Eigen::MatrixXd Pseudo_InvSqrt_GWBSE(const AOOverlap &auxoverlap, double etol)
Definition aomatrix.cc:54
Index Dimension() final
Definition aomatrix.h:95
void setCenter(const Eigen::Vector3d &r)
Definition aomatrix.h:98
std::array< Eigen::MatrixXd, 3 > aomatrix_
Definition aomatrix.h:105
std::array< libint2::Shell::real_t, 3 > r_
Definition aomatrix.h:106
const std::array< Eigen::MatrixXd, 3 > & Matrix() const
Definition aomatrix.h:96
void Fill(const AOBasis &aobasis) final
void Fill(const AOBasis &aobasis) final
Index Dimension() final
Definition aomatrix.h:40
const Eigen::MatrixXd & Matrix() const
Definition aomatrix.h:41
Eigen::MatrixXd aomatrix_
Definition aomatrix.h:44
virtual void Fill(const AOBasis &aobasis)=0
virtual Index Dimension()=0
void Fill(const AOBasis &aobasis) final
Eigen::MatrixXd Pseudo_InvSqrt(double etol)
Definition aomatrix.cc:29
const Eigen::MatrixXd & Matrix() const
Definition aomatrix.h:52
double SmallestEigenValue() const
Definition aomatrix.h:56
Index Removedfunctions() const
Definition aomatrix.h:55
Eigen::MatrixXd singleShellOverlap(const AOShell &shell) const
Index Dimension() final
Definition aomatrix.h:51
double smallestEigenvalue
Definition aomatrix.h:63
Eigen::MatrixXd Sqrt()
Definition aomatrix.cc:45
Eigen::MatrixXd aomatrix_
Definition aomatrix.h:64
Eigen::MatrixXd ComputeMixedOverlap(const AOBasis &row, const AOBasis &col)
Provides a means for comparing floating point numbers.
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26