1 //////////////////////////////////////////////////////////////////////////////// 2 // 3 // Copyright (c) 2008 The Regents of the University of California 4 // 5 // This file is part of Qbox 6 // 7 // Qbox is distributed under the terms of the GNU General Public License 8 // as published by the Free Software Foundation, either version 2 of 9 // the License, or (at your option) any later version. 10 // See the file COPYING in the root directory of this distribution 11 // or <http://www.gnu.org/licenses/>. 12 // 13 //////////////////////////////////////////////////////////////////////////////// 14 // 15 // RSHFunctional.h 16 // 17 //////////////////////////////////////////////////////////////////////////////// 18 // 19 // Range-separated hybrid functional (RSH) 20 // J.H.Skone et al. Phys. Rev. B93, 235106 (2016) 21 // RSH is defined by alpha_RSH, beta_RSH, mu_RSH 22 // sigma = alpha_RSH * rho(r,r') * erf(r-r')/(r-r') + 23 // beta_RSH * rho(r,r') * erfc(r-r')/(r-r') + 24 // (1 - alpha_RSH) * Vx_LR(r,mu_RSH) + 25 // (1 - beta_RSH) * Vx_SR(r,mu_RSH) 26 // The HSE functional is obtained using alpha_RSH=0, beta_RSH=0.25, mu_RSH=0.11 27 // Heyd et al., J. Chem. Phys. 118, 8207 (2003) 28 // Heyd et al., J. Chem. Phys. 120, 7274 (2004) 29 // Krukau et al., J. Chem. Phys. 125, 224106 (2006) 30 // 31 //////////////////////////////////////////////////////////////////////////////// 32 33 #ifndef RSHFUNCTIONAL_H 34 #define RSHFUNCTIONAL_H 35 36 #include "XCFunctional.h" 37 #include <vector> 38 39 class RSHFunctional : public XCFunctional 40 { 41 const double x_coeff_, c_coeff_; 42 const double alpha_RSH_, beta_RSH_, mu_RSH_; 43 const double omega; // == mu_RSH 44 45 // vectors common to all GGA exchange functionals 46 std::vector<double> _exc, _exc_up, _exc_dn; 47 std::vector<double> _vxc1, _vxc1_up, _vxc1_dn, _vxc2, _vxc2_upup, _vxc2_updn, 48 _vxc2_dnup, _vxc2_dndn; 49 std::vector<double> _grad_rho[3], _grad_rho_up[3], _grad_rho_dn[3]; 50 51 void RSH_exchange(const double rho, const double grad, 52 const double a_ex, const double w, double *ex, double *vx1, double *vx2); 53 54 void gcor2(double a, double a1, double b1, double b2, 55 double b3, double b4, double rtrs, double *gg, double *ggrs); 56 57 void PBE_correlation(const double rho, const double grad, 58 double *ec, double *vc1, double *vc2); 59 60 void PBE_correlation_sp(const double rho_up, const double rho_dn, 61 const double grad_up, const double grad_dn, const double grad, double *ec, 62 double *vc1_up, double *vc1_dn, double *vc2); 63 64 void approximateIntegral(const double omega_kF, const double Hs2, 65 const double D_term, const double dHs2_ds, double *appInt, 66 double *dAppInt_ds, double *dAppInt_dkF); 67 68 void RSH_enhance(const double s_inp, const double kF, 69 const double w, double *fx, double *dfx_ds, double* dfx_dkf); 70 71 public: 72 73 // constructor 74 RSHFunctional(const std::vector<std::vector<double> > &rhoe, 75 double alpha_RSH, double beta_RSH, double mu_RSH); 76 isGGA()77 bool isGGA() const { return true; } 78 79 // return the name of the functional name()80 std::string name() const { return "RSH"; } 81 82 void setxc(void); 83 }; 84 85 #endif 86