votca 2026-dev
Loading...
Searching...
No Matches
exact_pole_sums.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2026 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_EXACT_POLE_SUMS_H
22#define VOTCA_XTP_EXACT_POLE_SUMS_H
23
24// Local VOTCA includes
25#include "eigen.h"
26
27namespace votca {
28namespace xtp {
29
41struct ExactPoles {
42 const Eigen::VectorXd& energies; // e_m, size B
44 const Eigen::VectorXd& omegas; // Omega_s, size S
45 double eta;
46
47 Index nlevels() const { return energies.size(); }
48 Index nmodes() const { return omegas.size(); }
49 Index npoles() const { return nlevels() * nmodes(); }
50};
51
52namespace exact_pole_sums {
53
55double Value(const ExactPoles& poles, const double* residues, double w);
56
58double Derivative(const ExactPoles& poles, const double* residues, double w);
59
66Eigen::VectorXd Values(const ExactPoles& poles, const double* residues,
67 const Eigen::VectorXd& w);
68
72Eigen::VectorXd Values(const ExactPoles& poles, const double* residues,
73 const Eigen::VectorXd& w, const double* mode_factors);
74
76Eigen::VectorXd ValuesDirect(const ExactPoles& poles, const double* residues,
77 const Eigen::VectorXd& w);
78Eigen::VectorXd ValuesDirect(const ExactPoles& poles, const double* residues,
79 const Eigen::VectorXd& w,
80 const double* mode_factors);
81
83Eigen::VectorXd ValuesDirectWeighted(const ExactPoles& poles,
84 const double* weights,
85 const Eigen::VectorXd& w);
86
91Eigen::MatrixXd OffDiagonal(const ExactPoles& poles,
92 const Eigen::MatrixXd& residues_all,
93 const Eigen::VectorXd& w);
94
95} // namespace exact_pole_sums
96} // namespace xtp
97} // namespace votca
98
99#endif // VOTCA_XTP_EXACT_POLE_SUMS_H
double Value(const ExactPoles &poles, const double *residues, double w)
S_n(w) at one frequency.
double Derivative(const ExactPoles &poles, const double *residues, double w)
dS_n/dw at one frequency
Eigen::VectorXd ValuesDirect(const ExactPoles &poles, const double *residues, const Eigen::VectorXd &w)
The same sum term by term at every frequency (reference for tests).
Eigen::MatrixXd OffDiagonal(const ExactPoles &poles, const Eigen::MatrixXd &residues_all, const Eigen::VectorXd &w)
Eigen::VectorXd Values(const ExactPoles &poles, const double *residues, const Eigen::VectorXd &w)
Eigen::VectorXd ValuesDirectWeighted(const ExactPoles &poles, const double *weights, const Eigen::VectorXd &w)
sum_p a_p f(w - z_p) with given weights a_p (e.g. r_n1 r_n2)
Provides a means for comparing floating point numbers.
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26
Pole sums of the exact (RPA spectral) correlation self-energy.
const Eigen::VectorXd & energies
const Eigen::VectorXd & omegas