Psi4
LibXCfunctional.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2018 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This file is part of Psi4.
12  *
13  * Psi4 is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License as published by
15  * the Free Software Foundation, version 3.
16  *
17  * Psi4 is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License along
23  * with Psi4; if not, write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  *
26  * @END LICENSE
27  */
28 
29 #ifndef LibXC_FUNCTIONAL_H
30 #define LibXC_FUNCTIONAL_H
31 
33 #include "psi4/libmints/typedefs.h"
34 
35 #include <map>
36 
37 struct xc_func_type;
38 
42 namespace psi {
43 
44 class LibXCFunctional : public Functional {
45 // Wrapper to the LibXC library
46 
47 private:
48  std::string xc_func_name_;
49  std::unique_ptr<xc_func_type> xc_functional_;
50  int func_id_;
52  bool exc_;
53  bool vxc_;
54  bool fxc_;
55 
56  // **ONLY** Used to pass information up the chain.
57  // Exchange
58  double global_exch_;
59  double lr_exch_;
60 
61  // Needs vv10
63  double vv10_b_;
64  double vv10_c_;
65 
66  // User defined tweakers
67  std::vector<double> user_tweakers_;
68 
69 public:
70 
71  LibXCFunctional(std::string xc_name, bool unpolarized);
72  virtual ~LibXCFunctional();
73 
74  virtual void compute_functional(const std::map<std::string, SharedVector>& in,
75  const std::map<std::string, SharedVector>& out, int npoints,
76  int deriv);
77 
78  // Clones a *worker* for the functional. This is not a complete functional
79  virtual std::shared_ptr<Functional> build_worker();
80 
81  // Setters and getters
82  void set_omega(double omega);
83  void set_tweak(std::vector<double> values);
84  std::vector<std::tuple<std::string, int, double>> get_mix_data();
85 
86  // Make queries to libxc
87  std::map<std::string, double> query_libxc(const std::string& functional);
88 
89  // Only used to pass information up the chain
90  double global_exchange() { return global_exch_; }
91  double lr_exchange() { return lr_exch_; }
92  double needs_vv10() { return needs_vv10_; }
93  double vv10_b() { return vv10_b_; }
94  double vv10_c() { return vv10_c_; }
95 
96 };
97 
98 }
99 
100 #endif
bool fxc_
Definition: LibXCfunctional.h:54
std::string xc_func_name_
Definition: LibXCfunctional.h:48
virtual ~LibXCFunctional()
Definition: LibXCfunctional.cc:174
std::vector< std::tuple< std::string, int, double > > get_mix_data()
Definition: LibXCfunctional.cc:355
Definition: LibXCfunctional.h:44
std::vector< double > user_tweakers_
Definition: LibXCfunctional.h:67
double vv10_c_
Definition: LibXCfunctional.h:64
int func_id_
Definition: LibXCfunctional.h:50
std::unique_ptr< xc_func_type > xc_functional_
Definition: LibXCfunctional.h:49
Definition: functional.h:49
double vv10_b_
Definition: LibXCfunctional.h:63
double needs_vv10()
Definition: LibXCfunctional.h:92
double vv10_c()
Definition: LibXCfunctional.h:94
void set_tweak(std::vector< double > values)
Definition: LibXCfunctional.cc:254
double lr_exch_
Definition: LibXCfunctional.h:59
bool user_omega_
Definition: LibXCfunctional.h:51
void set_omega(double omega)
Definition: LibXCfunctional.cc:200
LibXCFunctional(std::string xc_name, bool unpolarized)
Definition: LibXCfunctional.cc:51
virtual void compute_functional(const std::map< std::string, SharedVector > &in, const std::map< std::string, SharedVector > &out, int npoints, int deriv)
Definition: LibXCfunctional.cc:375
bool vxc_
Definition: LibXCfunctional.h:53
bool exc_
Definition: LibXCfunctional.h:52
double global_exchange()
Definition: LibXCfunctional.h:90
bool needs_vv10_
Definition: LibXCfunctional.h:62
double omega() const
Definition: functional.h:139
std::map< std::string, double > query_libxc(const std::string &functional)
Definition: LibXCfunctional.cc:224
double vv10_b()
Definition: LibXCfunctional.h:93
virtual std::shared_ptr< Functional > build_worker()
Definition: LibXCfunctional.cc:175
double lr_exchange()
Definition: LibXCfunctional.h:91
double global_exch_
Definition: LibXCfunctional.h:58