votca 2026-dev
Loading...
Searching...
No Matches
vxc_potential.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2020 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_VXC_POTENTIAL_H
22#define VOTCA_XTP_VXC_POTENTIAL_H
23
24#include <xc.h>
25
26#include "grid_containers.h"
27#include "gridbox.h"
28
29#undef LOG
30
31namespace votca {
32namespace xtp {
33
34template <class Grid>
36 public:
37 struct SpinResult {
38 double energy = 0.0;
39 Eigen::MatrixXd vxc_alpha;
40 Eigen::MatrixXd vxc_beta;
41 };
42
43 explicit Vxc_Potential(const Grid& grid) : grid_(grid) {};
45
46 static double getExactExchange(const std::string& functional);
47 void setXCfunctional(const std::string& functional);
48
49 Mat_p_Energy IntegrateVXC(const Eigen::MatrixXd& density_matrix) const;
50 SpinResult IntegrateVXCSpin(const Eigen::MatrixXd& dmat_alpha,
51 const Eigen::MatrixXd& dmat_beta) const;
52
53 private:
54 struct XC_entry {
55 double f_xc = 0;
56 double df_drho = 0;
57 double df_dsigma = 0;
58 };
59
61 double f_xc = 0;
62 double vrho_a = 0;
63 double vrho_b = 0;
64 double vsigma_aa = 0;
65 double vsigma_ab = 0;
66 double vsigma_bb = 0;
67 };
68
69 XC_entry EvaluateXC(double rho, double sigma) const;
70 XC_entry_spin EvaluateXCSpin(double rho_a, double rho_b, double sigma_aa,
71 double sigma_ab, double sigma_bb) const;
72
73 const Grid grid_;
75 bool setXC_ = false;
78 xc_func_type xfunc;
79 xc_func_type cfunc;
80};
81
82} // namespace xtp
83} // namespace votca
84#endif // VOTCA_XTP_VXC_POTENTIAL_H
XC_entry_spin EvaluateXCSpin(double rho_a, double rho_b, double sigma_aa, double sigma_ab, double sigma_bb) const
XC_entry EvaluateXC(double rho, double sigma) const
Mat_p_Energy IntegrateVXC(const Eigen::MatrixXd &density_matrix) const
void setXCfunctional(const std::string &functional)
Vxc_Potential(const Grid &grid)
static double getExactExchange(const std::string &functional)
SpinResult IntegrateVXCSpin(const Eigen::MatrixXd &dmat_alpha, const Eigen::MatrixXd &dmat_beta) const
Provides a means for comparing floating point numbers.
Definition basebead.h:33
double vsigma_ab
double vrho_b
double vrho_a
double vsigma_aa
double vsigma_bb
double f_xc
double f_xc
double df_dsigma
double df_drho