SIRIUS 7.5.0
Electronic structure library and applications
xc_functional_base.hpp
1// Copyright (c) 2013-2016 Anton Kozhevnikov, Thomas Schulthess
2// All rights reserved.
3//
4// Redistribution and use in source and binary forms, with or without modification, are permitted provided that
5// the following conditions are met:
6//
7// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
8// following disclaimer.
9// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions
10// and the following disclaimer in the documentation and/or other materials provided with the distribution.
11//
12// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
13// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
14// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
15// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
16// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
17// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
18// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19
20/** \file xc_functional.hpp
21 *
22 * \brief Contains implementation of sirius::XC_functional_base class.
23 */
24
25#ifndef __XC_FUNCTIONAL_BASE_HPP__
26#define __XC_FUNCTIONAL_BASE_HPP__
27
28#include <xc.h>
29#include <string.h>
30#include <memory>
31#include <map>
32#include <stdexcept>
33#include <iostream>
34#include "core/rte/rte.hpp"
36
37namespace sirius {
38
39const std::map<std::string, int> libxc_functionals = {
40#if defined(XC_LDA_X)
41 {"XC_LDA_X", XC_LDA_X}, /*Exchange */
42#endif
43#if defined(XC_LDA_C_WIGNER)
44 {"XC_LDA_C_WIGNER", XC_LDA_C_WIGNER}, /*Wigner parametrization */
45#endif
46#if defined(XC_LDA_C_RPA)
47 {"XC_LDA_C_RPA", XC_LDA_C_RPA}, /*Random Phase Approximation */
48#endif
49#if defined(XC_LDA_C_HL)
50 {"XC_LDA_C_HL", XC_LDA_C_HL}, /*Hedin & Lundqvist */
51#endif
52#if defined(XC_LDA_C_GL)
53 {"XC_LDA_C_GL", XC_LDA_C_GL}, /* Gunnarson & Lundqvist */
54#endif
55#if defined(XC_LDA_C_XALPHA)
56 {"XC_LDA_C_XALPHA", XC_LDA_C_XALPHA}, /* Slater Xalpha */
57#endif
58#if defined(XC_LDA_C_VWN)
59 {"XC_LDA_C_VWN", XC_LDA_C_VWN}, /*Vosko, Wilk, & Nusair (5) */
60#endif
61#if defined(XC_LDA_C_VWN_RPA)
62 {"XC_LDA_C_VWN_RPA", XC_LDA_C_VWN_RPA}, /*Vosko, Wilk, & Nusair (RPA) */
63#endif
64#if defined(XC_LDA_C_PZ)
65 {"XC_LDA_C_PZ", XC_LDA_C_PZ}, /*Perdew & Zunger */
66#endif
67#if defined(XC_LDA_C_PZ_MOD)
68 {"XC_LDA_C_PZ_MOD", XC_LDA_C_PZ_MOD}, /* Perdew & Zunger (Modified) */
69#endif
70#if defined(XC_LDA_C_OB_PZ)
71 {"XC_LDA_C_OB_PZ", XC_LDA_C_OB_PZ}, /* Ortiz & Ballone (PZ) */
72#endif
73#if defined(XC_LDA_C_PW)
74 {"XC_LDA_C_PW", XC_LDA_C_PW}, /*Perdew & Wang */
75#endif
76#if defined(XC_LDA_C_PW_MOD)
77 {"XC_LDA_C_PW_MOD", XC_LDA_C_PW_MOD}, /* Perdew & Wang (Modified) */
78#endif
79#if defined(XC_LDA_C_OB_PW)
80 {"XC_LDA_C_OB_PW", XC_LDA_C_OB_PW}, /* Ortiz & Ballone (PW) */
81#endif
82#if defined(XC_LDA_C_2D_AMGB)
83 {"XC_LDA_C_2D_AMGB", XC_LDA_C_2D_AMGB}, /*Attaccalite et al */
84#endif
85#if defined(XC_LDA_C_2D_PRM)
86 {"XC_LDA_C_2D_PRM", XC_LDA_C_2D_PRM}, /*Pittalis, Rasanen & Marques correlation in 2D */
87#endif
88#if defined(XC_LDA_C_vBH)
89 {"XC_LDA_C_vBH", XC_LDA_C_vBH}, /* von Barth & Hedin */
90#endif
91#if defined(XC_LDA_C_1D_CSC)
92 {"XC_LDA_C_1D_CSC", XC_LDA_C_1D_CSC}, /*Casula, Sorella, and Senatore 1D correlation */
93#endif
94#if defined(XC_LDA_X_2D)
95 {"XC_LDA_X_2D", XC_LDA_X_2D}, /*Exchange in 2D */
96#endif
97#if defined(XC_LDA_XC_TETER93)
98 {"XC_LDA_XC_TETER93", XC_LDA_XC_TETER93}, /*Teter 93 parametrization */
99#endif
100#if defined(XC_LDA_X_1D)
101 {"XC_LDA_X_1D", XC_LDA_X_1D}, /*Exchange in 1D */
102#endif
103#if defined(XC_LDA_C_ML1)
104 {"XC_LDA_C_ML1", XC_LDA_C_ML1}, /*Modified LSD (version 1) of Proynov and Salahub */
105#endif
106#if defined(XC_LDA_C_ML2)
107 {"XC_LDA_C_ML2", XC_LDA_C_ML2}, /* Modified LSD (version 2) of Proynov and Salahub */
108#endif
109#if defined(XC_LDA_C_GOMBAS)
110 {"XC_LDA_C_GOMBAS", XC_LDA_C_GOMBAS}, /*Gombas parametrization */
111#endif
112#if defined(XC_LDA_C_PW_RPA)
113 {"XC_LDA_C_PW_RPA", XC_LDA_C_PW_RPA}, /* Perdew & Wang fit of the RPA */
114#endif
115#if defined(XC_LDA_C_1D_LOOS)
116 {"XC_LDA_C_1D_LOOS", XC_LDA_C_1D_LOOS}, /*P-F Loos correlation LDA */
117#endif
118#if defined(XC_LDA_C_RC04)
119 {"XC_LDA_C_RC04", XC_LDA_C_RC04}, /*Ragot-Cortona */
120#endif
121#if defined(XC_LDA_C_VWN_1)
122 {"XC_LDA_C_VWN_1", XC_LDA_C_VWN_1}, /*Vosko, Wilk, & Nusair (1) */
123#endif
124#if defined(XC_LDA_C_VWN_2)
125 {"XC_LDA_C_VWN_2", XC_LDA_C_VWN_2}, /*Vosko, Wilk, & Nusair (2) */
126#endif
127#if defined(XC_LDA_C_VWN_3)
128 {"XC_LDA_C_VWN_3", XC_LDA_C_VWN_3}, /*Vosko, Wilk, & Nusair (3) */
129#endif
130#if defined(XC_LDA_C_VWN_4)
131 {"XC_LDA_C_VWN_4", XC_LDA_C_VWN_4}, /*Vosko, Wilk, & Nusair (4) */
132#endif
133#if defined(XC_LDA_XC_ZLP)
134 {"XC_LDA_XC_ZLP", XC_LDA_XC_ZLP}, /*Zhao, Levy & Parr, Eq. (20) */
135#endif
136#if defined(XC_LDA_K_TF)
137 {"XC_LDA_K_TF", XC_LDA_K_TF}, /*Thomas-Fermi kinetic energy functional */
138#endif
139#if defined(XC_LDA_K_LP)
140 {"XC_LDA_K_LP", XC_LDA_K_LP}, /* Lee and Parr Gaussian ansatz */
141#endif
142#if defined(XC_LDA_XC_KSDT)
143 {"XC_LDA_XC_KSDT", XC_LDA_XC_KSDT}, /*Karasiev et al. parametrization */
144#endif
145#if defined(XC_LDA_C_CHACHIYO)
146 {"XC_LDA_C_CHACHIYO", XC_LDA_C_CHACHIYO}, /*Chachiyo simple 2 parameter correlation */
147#endif
148#if defined(XC_LDA_C_LP96)
149 {"XC_LDA_C_LP96", XC_LDA_C_LP96}, /*Liu-Parr correlation */
150#endif
151#if defined(XC_LDA_X_REL)
152 {"XC_LDA_X_REL", XC_LDA_X_REL}, /*Relativistic exchange */
153#endif
154#if defined(XC_LDA_XC_1D_EHWLRG_1)
155 {"XC_LDA_XC_1D_EHWLRG_1", XC_LDA_XC_1D_EHWLRG_1}, /*LDA constructed from slab-like systems of 1 electron */
156#endif
157#if defined(XC_LDA_XC_1D_EHWLRG_2)
158 {"XC_LDA_XC_1D_EHWLRG_2", XC_LDA_XC_1D_EHWLRG_2}, /* LDA constructed from slab-like systems of 2 electrons */
159#endif
160#if defined(XC_LDA_XC_1D_EHWLRG_3)
161 {"XC_LDA_XC_1D_EHWLRG_3", XC_LDA_XC_1D_EHWLRG_3}, /* LDA constructed from slab-like systems of 3 electrons */
162#endif
163#if defined(XC_LDA_X_ERF)
164 {"XC_LDA_X_ERF", XC_LDA_X_ERF}, /*Attenuated exchange LDA (erf) */
165#endif
166#if defined(XC_LDA_XC_LP_A)
167 {"XC_LDA_XC_LP_A", XC_LDA_XC_LP_A}, /* Lee-Parr reparametrization B */
168#endif
169#if defined(XC_LDA_XC_LP_B)
170 {"XC_LDA_XC_LP_B", XC_LDA_XC_LP_B}, /* Lee-Parr reparametrization B */
171#endif
172#if defined(XC_LDA_X_RAE)
173 {"XC_LDA_X_RAE", XC_LDA_X_RAE}, /* Rae self-energy corrected exchange */
174#endif
175#if defined(XC_LDA_K_ZLP)
176 {"XC_LDA_K_ZLP", XC_LDA_K_ZLP}, /*kinetic energy version of ZLP */
177#endif
178#if defined(XC_LDA_C_MCWEENY)
179 {"XC_LDA_C_MCWEENY", XC_LDA_C_MCWEENY}, /* McWeeny 76 */
180#endif
181#if defined(XC_LDA_C_BR78)
182 {"XC_LDA_C_BR78", XC_LDA_C_BR78}, /* Brual & Rothstein 78 */
183#endif
184#if defined(XC_LDA_C_PK09)
185 {"XC_LDA_C_PK09", XC_LDA_C_PK09}, /*Proynov and Kong 2009 */
186#endif
187#if defined(XC_LDA_C_OW_LYP)
188 {"XC_LDA_C_OW_LYP", XC_LDA_C_OW_LYP}, /* Wigner with corresponding LYP parameters */
189#endif
190#if defined(XC_LDA_C_OW)
191 {"XC_LDA_C_OW", XC_LDA_C_OW}, /* Optimized Wigner */
192#endif
193#if defined(XC_LDA_XC_GDSMFB)
194 {"XC_LDA_XC_GDSMFB", XC_LDA_XC_GDSMFB}, /* Groth et al. parametrization */
195#endif
196#if defined(XC_LDA_C_GK72)
197 {"XC_LDA_C_GK72", XC_LDA_C_GK72}, /*Gordon and Kim 1972 */
198#endif
199#if defined(XC_LDA_C_KARASIEV)
200 {"XC_LDA_C_KARASIEV", XC_LDA_C_KARASIEV}, /* Karasiev reparameterization of Chachiyo */
201#endif
202#if defined(XC_LDA_K_LP96)
203 {"XC_LDA_K_LP96", XC_LDA_K_LP96}, /* Liu-Parr kinetic */
204#endif
205#if defined(XC_GGA_X_GAM)
206 {"XC_GGA_X_GAM", XC_GGA_X_GAM}, /* GAM functional from Minnesota */
207#endif
208#if defined(XC_GGA_C_GAM)
209 {"XC_GGA_C_GAM", XC_GGA_C_GAM}, /* GAM functional from Minnesota */
210#endif
211#if defined(XC_GGA_X_HCTH_A)
212 {"XC_GGA_X_HCTH_A", XC_GGA_X_HCTH_A}, /*HCTH-A */
213#endif
214#if defined(XC_GGA_X_EV93)
215 {"XC_GGA_X_EV93", XC_GGA_X_EV93}, /*Engel and Vosko */
216#endif
217#if defined(XC_GGA_X_BCGP)
218 {"XC_GGA_X_BCGP", XC_GGA_X_BCGP}, /* Burke, Cancio, Gould, and Pittalis */
219#endif
220#if defined(XC_GGA_C_BCGP)
221 {"XC_GGA_C_BCGP", XC_GGA_C_BCGP}, /*Burke, Cancio, Gould, and Pittalis */
222#endif
223#if defined(XC_GGA_X_LAMBDA_OC2_N)
224 {"XC_GGA_X_LAMBDA_OC2_N", XC_GGA_X_LAMBDA_OC2_N}, /* lambda_OC2(N) version of PBE */
225#endif
226#if defined(XC_GGA_X_B86_R)
227 {"XC_GGA_X_B86_R", XC_GGA_X_B86_R}, /* Revised Becke 86 Xalpha,beta,gamma (with mod. grad. correction) */
228#endif
229#if defined(XC_GGA_X_LAMBDA_CH_N)
230 {"XC_GGA_X_LAMBDA_CH_N", XC_GGA_X_LAMBDA_CH_N}, /* lambda_CH(N) version of PBE */
231#endif
232#if defined(XC_GGA_X_LAMBDA_LO_N)
233 {"XC_GGA_X_LAMBDA_LO_N", XC_GGA_X_LAMBDA_LO_N}, /* lambda_LO(N) version of PBE */
234#endif
235#if defined(XC_GGA_X_HJS_B88_V2)
236 {"XC_GGA_X_HJS_B88_V2", XC_GGA_X_HJS_B88_V2}, /*HJS screened exchange corrected B88 version */
237#endif
238#if defined(XC_GGA_C_Q2D)
239 {"XC_GGA_C_Q2D", XC_GGA_C_Q2D}, /*Chiodo et al */
240#endif
241#if defined(XC_GGA_X_Q2D)
242 {"XC_GGA_X_Q2D", XC_GGA_X_Q2D}, /*Chiodo et al */
243#endif
244#if defined(XC_GGA_X_PBE_MOL)
245 {"XC_GGA_X_PBE_MOL", XC_GGA_X_PBE_MOL}, /* Del Campo, Gazquez, Trickey and Vela (PBE-like) */
246#endif
247#if defined(XC_GGA_K_TFVW)
248 {"XC_GGA_K_TFVW", XC_GGA_K_TFVW}, /*Thomas-Fermi plus von Weiszaecker correction */
249#endif
250#if defined(XC_GGA_K_REVAPBEINT)
251 {"XC_GGA_K_REVAPBEINT", XC_GGA_K_REVAPBEINT}, /* interpolated version of REVAPBE */
252#endif
253#if defined(XC_GGA_K_APBEINT)
254 {"XC_GGA_K_APBEINT", XC_GGA_K_APBEINT}, /* interpolated version of APBE */
255#endif
256#if defined(XC_GGA_K_REVAPBE)
257 {"XC_GGA_K_REVAPBE", XC_GGA_K_REVAPBE}, /* revised APBE */
258#endif
259#if defined(XC_GGA_X_AK13)
260 {"XC_GGA_X_AK13", XC_GGA_X_AK13}, /*Armiento & Kuemmel 2013 */
261#endif
262#if defined(XC_GGA_K_MEYER)
263 {"XC_GGA_K_MEYER", XC_GGA_K_MEYER}, /*Meyer, Wang, and Young */
264#endif
265#if defined(XC_GGA_X_LV_RPW86)
266 {"XC_GGA_X_LV_RPW86", XC_GGA_X_LV_RPW86}, /*Berland and Hyldgaard */
267#endif
268#if defined(XC_GGA_X_PBE_TCA)
269 {"XC_GGA_X_PBE_TCA", XC_GGA_X_PBE_TCA}, /* PBE revised by Tognetti et al */
270#endif
271#if defined(XC_GGA_X_PBEINT)
272 {"XC_GGA_X_PBEINT", XC_GGA_X_PBEINT}, /*PBE for hybrid interfaces */
273#endif
274#if defined(XC_GGA_C_ZPBEINT)
275 {"XC_GGA_C_ZPBEINT", XC_GGA_C_ZPBEINT}, /*spin-dependent gradient correction to PBEint */
276#endif
277#if defined(XC_GGA_C_PBEINT)
278 {"XC_GGA_C_PBEINT", XC_GGA_C_PBEINT}, /* PBE for hybrid interfaces */
279#endif
280#if defined(XC_GGA_C_ZPBESOL)
281 {"XC_GGA_C_ZPBESOL", XC_GGA_C_ZPBESOL}, /* spin-dependent gradient correction to PBEsol */
282#endif
283#if defined(XC_GGA_XC_OPBE_D)
284 {"XC_GGA_XC_OPBE_D", XC_GGA_XC_OPBE_D}, /* oPBE_D functional of Goerigk and Grimme */
285#endif
286#if defined(XC_GGA_XC_OPWLYP_D)
287 {"XC_GGA_XC_OPWLYP_D", XC_GGA_XC_OPWLYP_D}, /* oPWLYP-D functional of Goerigk and Grimme */
288#endif
289#if defined(XC_GGA_XC_OBLYP_D)
290 {"XC_GGA_XC_OBLYP_D", XC_GGA_XC_OBLYP_D}, /*oBLYP-D functional of Goerigk and Grimme */
291#endif
292#if defined(XC_GGA_X_VMT84_GE)
293 {"XC_GGA_X_VMT84_GE", XC_GGA_X_VMT84_GE}, /* VMT{8,4} with constraint satisfaction with mu = mu_GE */
294#endif
295#if defined(XC_GGA_X_VMT84_PBE)
296 {"XC_GGA_X_VMT84_PBE", XC_GGA_X_VMT84_PBE}, /*VMT{8,4} with constraint satisfaction with mu = mu_PBE */
297#endif
298#if defined(XC_GGA_X_VMT_GE)
299 {"XC_GGA_X_VMT_GE", XC_GGA_X_VMT_GE}, /* Vela, Medel, and Trickey with mu = mu_GE */
300#endif
301#if defined(XC_GGA_X_VMT_PBE)
302 {"XC_GGA_X_VMT_PBE", XC_GGA_X_VMT_PBE}, /*Vela, Medel, and Trickey with mu = mu_PBE */
303#endif
304#if defined(XC_GGA_C_N12_SX)
305 {"XC_GGA_C_N12_SX", XC_GGA_C_N12_SX}, /* N12-SX functional from Minnesota */
306#endif
307#if defined(XC_GGA_C_N12)
308 {"XC_GGA_C_N12", XC_GGA_C_N12}, /*N12 functional from Minnesota */
309#endif
310#if defined(XC_GGA_X_N12)
311 {"XC_GGA_X_N12", XC_GGA_X_N12}, /*N12 functional from Minnesota */
312#endif
313#if defined(XC_GGA_C_REGTPSS)
314 {"XC_GGA_C_REGTPSS", XC_GGA_C_REGTPSS}, /*Regularized TPSS correlation (ex-VPBE) */
315#endif
316#if defined(XC_GGA_C_OP_XALPHA)
317 {"XC_GGA_C_OP_XALPHA", XC_GGA_C_OP_XALPHA}, /*one-parameter progressive functional (XALPHA version) */
318#endif
319#if defined(XC_GGA_C_OP_G96)
320 {"XC_GGA_C_OP_G96", XC_GGA_C_OP_G96}, /*one-parameter progressive functional (G96 version) */
321#endif
322#if defined(XC_GGA_C_OP_PBE)
323 {"XC_GGA_C_OP_PBE", XC_GGA_C_OP_PBE}, /*one-parameter progressive functional (PBE version) */
324#endif
325#if defined(XC_GGA_C_OP_B88)
326 {"XC_GGA_C_OP_B88", XC_GGA_C_OP_B88}, /*one-parameter progressive functional (B88 version) */
327#endif
328#if defined(XC_GGA_C_FT97)
329 {"XC_GGA_C_FT97", XC_GGA_C_FT97}, /*Filatov & Thiel correlation */
330#endif
331#if defined(XC_GGA_C_SPBE)
332 {"XC_GGA_C_SPBE", XC_GGA_C_SPBE}, /* PBE correlation to be used with the SSB exchange */
333#endif
334#if defined(XC_GGA_X_SSB_SW)
335 {"XC_GGA_X_SSB_SW", XC_GGA_X_SSB_SW}, /*Swart, Sola and Bickelhaupt correction to PBE */
336#endif
337#if defined(XC_GGA_X_SSB)
338 {"XC_GGA_X_SSB", XC_GGA_X_SSB}, /* Swart, Sola and Bickelhaupt */
339#endif
340#if defined(XC_GGA_X_SSB_D)
341 {"XC_GGA_X_SSB_D", XC_GGA_X_SSB_D}, /* Swart, Sola and Bickelhaupt dispersion */
342#endif
343#if defined(XC_GGA_XC_HCTH_407P)
344 {"XC_GGA_XC_HCTH_407P", XC_GGA_XC_HCTH_407P}, /* HCTH/407+ */
345#endif
346#if defined(XC_GGA_XC_HCTH_P76)
347 {"XC_GGA_XC_HCTH_P76", XC_GGA_XC_HCTH_P76}, /* HCTH p=7/6 */
348#endif
349#if defined(XC_GGA_XC_HCTH_P14)
350 {"XC_GGA_XC_HCTH_P14", XC_GGA_XC_HCTH_P14}, /* HCTH p=1/4 */
351#endif
352#if defined(XC_GGA_XC_B97_GGA1)
353 {"XC_GGA_XC_B97_GGA1", XC_GGA_XC_B97_GGA1}, /* Becke 97 GGA-1 */
354#endif
355#if defined(XC_GGA_C_HCTH_A)
356 {"XC_GGA_C_HCTH_A", XC_GGA_C_HCTH_A}, /*HCTH-A */
357#endif
358#if defined(XC_GGA_X_BPCCAC)
359 {"XC_GGA_X_BPCCAC", XC_GGA_X_BPCCAC}, /*BPCCAC (GRAC for the energy) */
360#endif
361#if defined(XC_GGA_C_REVTCA)
362 {"XC_GGA_C_REVTCA", XC_GGA_C_REVTCA}, /*Tognetti, Cortona, Adamo (revised) */
363#endif
364#if defined(XC_GGA_C_TCA)
365 {"XC_GGA_C_TCA", XC_GGA_C_TCA}, /*Tognetti, Cortona, Adamo */
366#endif
367#if defined(XC_GGA_X_PBE)
368 {"XC_GGA_X_PBE", XC_GGA_X_PBE}, /*Perdew, Burke & Ernzerhof exchange */
369#endif
370#if defined(XC_GGA_X_PBE_R)
371 {"XC_GGA_X_PBE_R", XC_GGA_X_PBE_R}, /* Perdew, Burke & Ernzerhof exchange (revised) */
372#endif
373#if defined(XC_GGA_X_B86)
374 {"XC_GGA_X_B86", XC_GGA_X_B86}, /*Becke 86 Xalpha,beta,gamma */
375#endif
376#if defined(XC_GGA_X_HERMAN)
377 {"XC_GGA_X_HERMAN", XC_GGA_X_HERMAN}, /*Herman et al original GGA */
378#endif
379#if defined(XC_GGA_X_B86_MGC)
380 {"XC_GGA_X_B86_MGC", XC_GGA_X_B86_MGC}, /* Becke 86 Xalpha,beta,gamma (with mod. grad. correction) */
381#endif
382#if defined(XC_GGA_X_B88)
383 {"XC_GGA_X_B88", XC_GGA_X_B88}, /*Becke 88 */
384#endif
385#if defined(XC_GGA_X_G96)
386 {"XC_GGA_X_G96", XC_GGA_X_G96}, /*Gill 96 */
387#endif
388#if defined(XC_GGA_X_PW86)
389 {"XC_GGA_X_PW86", XC_GGA_X_PW86}, /*Perdew & Wang 86 */
390#endif
391#if defined(XC_GGA_X_PW91)
392 {"XC_GGA_X_PW91", XC_GGA_X_PW91}, /*Perdew & Wang 91 */
393#endif
394#if defined(XC_GGA_X_OPTX)
395 {"XC_GGA_X_OPTX", XC_GGA_X_OPTX}, /*Handy & Cohen OPTX 01 */
396#endif
397#if defined(XC_GGA_X_DK87_R1)
398 {"XC_GGA_X_DK87_R1", XC_GGA_X_DK87_R1}, /*dePristo & Kress 87 (version R1) */
399#endif
400#if defined(XC_GGA_X_DK87_R2)
401 {"XC_GGA_X_DK87_R2", XC_GGA_X_DK87_R2}, /* dePristo & Kress 87 (version R2) */
402#endif
403#if defined(XC_GGA_X_LG93)
404 {"XC_GGA_X_LG93", XC_GGA_X_LG93}, /*Lacks & Gordon 93 */
405#endif
406#if defined(XC_GGA_X_FT97_A)
407 {"XC_GGA_X_FT97_A", XC_GGA_X_FT97_A}, /*Filatov & Thiel 97 (version A) */
408#endif
409#if defined(XC_GGA_X_FT97_B)
410 {"XC_GGA_X_FT97_B", XC_GGA_X_FT97_B}, /* Filatov & Thiel 97 (version B) */
411#endif
412#if defined(XC_GGA_X_PBE_SOL)
413 {"XC_GGA_X_PBE_SOL", XC_GGA_X_PBE_SOL}, /* Perdew, Burke & Ernzerhof exchange (solids) */
414#endif
415#if defined(XC_GGA_X_RPBE)
416 {"XC_GGA_X_RPBE", XC_GGA_X_RPBE}, /*Hammer, Hansen & Norskov (PBE-like) */
417#endif
418#if defined(XC_GGA_X_WC)
419 {"XC_GGA_X_WC", XC_GGA_X_WC}, /*Wu & Cohen */
420#endif
421#if defined(XC_GGA_X_MPW91)
422 {"XC_GGA_X_MPW91", XC_GGA_X_MPW91}, /* Modified form of PW91 by Adamo & Barone */
423#endif
424#if defined(XC_GGA_X_AM05)
425 {"XC_GGA_X_AM05", XC_GGA_X_AM05}, /*Armiento & Mattsson 05 exchange */
426#endif
427#if defined(XC_GGA_X_PBEA)
428 {"XC_GGA_X_PBEA", XC_GGA_X_PBEA}, /*Madsen (PBE-like) */
429#endif
430#if defined(XC_GGA_X_MPBE)
431 {"XC_GGA_X_MPBE", XC_GGA_X_MPBE}, /*Adamo & Barone modification to PBE */
432#endif
433#if defined(XC_GGA_X_XPBE)
434 {"XC_GGA_X_XPBE", XC_GGA_X_XPBE}, /* xPBE reparametrization by Xu & Goddard */
435#endif
436#if defined(XC_GGA_X_2D_B86_MGC)
437 {"XC_GGA_X_2D_B86_MGC", XC_GGA_X_2D_B86_MGC}, /*Becke 86 MGC for 2D systems */
438#endif
439#if defined(XC_GGA_X_BAYESIAN)
440 {"XC_GGA_X_BAYESIAN", XC_GGA_X_BAYESIAN}, /*Bayesian best fit for the enhancement factor */
441#endif
442#if defined(XC_GGA_X_PBE_JSJR)
443 {"XC_GGA_X_PBE_JSJR", XC_GGA_X_PBE_JSJR}, /* JSJR reparametrization by Pedroza, Silva & Capelle */
444#endif
445#if defined(XC_GGA_X_2D_B88)
446 {"XC_GGA_X_2D_B88", XC_GGA_X_2D_B88}, /*Becke 88 in 2D */
447#endif
448#if defined(XC_GGA_X_2D_B86)
449 {"XC_GGA_X_2D_B86", XC_GGA_X_2D_B86}, /*Becke 86 Xalpha,beta,gamma */
450#endif
451#if defined(XC_GGA_X_2D_PBE)
452 {"XC_GGA_X_2D_PBE", XC_GGA_X_2D_PBE}, /*Perdew, Burke & Ernzerhof exchange in 2D */
453#endif
454#if defined(XC_GGA_C_PBE)
455 {"XC_GGA_C_PBE", XC_GGA_C_PBE}, /*Perdew, Burke & Ernzerhof correlation */
456#endif
457#if defined(XC_GGA_C_LYP)
458 {"XC_GGA_C_LYP", XC_GGA_C_LYP}, /*Lee, Yang & Parr */
459#endif
460#if defined(XC_GGA_C_P86)
461 {"XC_GGA_C_P86", XC_GGA_C_P86}, /*Perdew 86 */
462#endif
463#if defined(XC_GGA_C_PBE_SOL)
464 {"XC_GGA_C_PBE_SOL", XC_GGA_C_PBE_SOL}, /* Perdew, Burke & Ernzerhof correlation SOL */
465#endif
466#if defined(XC_GGA_C_PW91)
467 {"XC_GGA_C_PW91", XC_GGA_C_PW91}, /*Perdew & Wang 91 */
468#endif
469#if defined(XC_GGA_C_AM05)
470 {"XC_GGA_C_AM05", XC_GGA_C_AM05}, /*Armiento & Mattsson 05 correlation */
471#endif
472#if defined(XC_GGA_C_XPBE)
473 {"XC_GGA_C_XPBE", XC_GGA_C_XPBE}, /* xPBE reparametrization by Xu & Goddard */
474#endif
475#if defined(XC_GGA_C_LM)
476 {"XC_GGA_C_LM", XC_GGA_C_LM}, /*Langreth and Mehl correlation */
477#endif
478#if defined(XC_GGA_C_PBE_JRGX)
479 {"XC_GGA_C_PBE_JRGX", XC_GGA_C_PBE_JRGX}, /* JRGX reparametrization by Pedroza, Silva & Capelle */
480#endif
481#if defined(XC_GGA_X_OPTB88_VDW)
482 {"XC_GGA_X_OPTB88_VDW",
483 XC_GGA_X_OPTB88_VDW}, /* Becke 88 reoptimized to be used with vdW functional of Dion et al */
484#endif
485#if defined(XC_GGA_X_PBEK1_VDW)
486 {"XC_GGA_X_PBEK1_VDW", XC_GGA_X_PBEK1_VDW}, /* PBE reparametrization for vdW */
487#endif
488#if defined(XC_GGA_X_OPTPBE_VDW)
489 {"XC_GGA_X_OPTPBE_VDW", XC_GGA_X_OPTPBE_VDW}, /* PBE reparametrization for vdW */
490#endif
491#if defined(XC_GGA_X_RGE2)
492 {"XC_GGA_X_RGE2", XC_GGA_X_RGE2}, /*Regularized PBE */
493#endif
494#if defined(XC_GGA_C_RGE2)
495 {"XC_GGA_C_RGE2", XC_GGA_C_RGE2}, /* Regularized PBE */
496#endif
497#if defined(XC_GGA_X_RPW86)
498 {"XC_GGA_X_RPW86", XC_GGA_X_RPW86}, /* refitted Perdew & Wang 86 */
499#endif
500#if defined(XC_GGA_X_KT1)
501 {"XC_GGA_X_KT1", XC_GGA_X_KT1}, /*Exchange part of Keal and Tozer version 1 */
502#endif
503#if defined(XC_GGA_XC_KT2)
504 {"XC_GGA_XC_KT2", XC_GGA_XC_KT2}, /* Keal and Tozer version 2 */
505#endif
506#if defined(XC_GGA_C_WL)
507 {"XC_GGA_C_WL", XC_GGA_C_WL}, /*Wilson & Levy */
508#endif
509#if defined(XC_GGA_C_WI)
510 {"XC_GGA_C_WI", XC_GGA_C_WI}, /* Wilson & Ivanov */
511#endif
512#if defined(XC_GGA_X_MB88)
513 {"XC_GGA_X_MB88", XC_GGA_X_MB88}, /* Modified Becke 88 for proton transfer */
514#endif
515#if defined(XC_GGA_X_SOGGA)
516 {"XC_GGA_X_SOGGA", XC_GGA_X_SOGGA}, /* Second-order generalized gradient approximation */
517#endif
518#if defined(XC_GGA_X_SOGGA11)
519 {"XC_GGA_X_SOGGA11", XC_GGA_X_SOGGA11}, /*Second-order generalized gradient approximation 2011 */
520#endif
521#if defined(XC_GGA_C_SOGGA11)
522 {"XC_GGA_C_SOGGA11", XC_GGA_C_SOGGA11}, /*Second-order generalized gradient approximation 2011 */
523#endif
524#if defined(XC_GGA_C_WI0)
525 {"XC_GGA_C_WI0", XC_GGA_C_WI0}, /*Wilson & Ivanov initial version */
526#endif
527#if defined(XC_GGA_XC_TH1)
528 {"XC_GGA_XC_TH1", XC_GGA_XC_TH1}, /* Tozer and Handy v. 1 */
529#endif
530#if defined(XC_GGA_XC_TH2)
531 {"XC_GGA_XC_TH2", XC_GGA_XC_TH2}, /*Tozer and Handy v. 2 */
532#endif
533#if defined(XC_GGA_XC_TH3)
534 {"XC_GGA_XC_TH3", XC_GGA_XC_TH3}, /*Tozer and Handy v. 3 */
535#endif
536#if defined(XC_GGA_XC_TH4)
537 {"XC_GGA_XC_TH4", XC_GGA_XC_TH4}, /* Tozer and Handy v. 4 */
538#endif
539#if defined(XC_GGA_X_C09X)
540 {"XC_GGA_X_C09X", XC_GGA_X_C09X}, /*C09x to be used with the VdW of Rutgers-Chalmers */
541#endif
542#if defined(XC_GGA_C_SOGGA11_X)
543 {"XC_GGA_C_SOGGA11_X", XC_GGA_C_SOGGA11_X}, /* To be used with HYB_GGA_X_SOGGA11_X */
544#endif
545#if defined(XC_GGA_X_LB)
546 {"XC_GGA_X_LB", XC_GGA_X_LB}, /*van Leeuwen & Baerends */
547#endif
548#if defined(XC_GGA_XC_HCTH_93)
549 {"XC_GGA_XC_HCTH_93", XC_GGA_XC_HCTH_93}, /* HCTH functional fitted to 93 molecules */
550#endif
551#if defined(XC_GGA_XC_HCTH_120)
552 {"XC_GGA_XC_HCTH_120", XC_GGA_XC_HCTH_120}, /* HCTH functional fitted to 120 molecules */
553#endif
554#if defined(XC_GGA_XC_HCTH_147)
555 {"XC_GGA_XC_HCTH_147", XC_GGA_XC_HCTH_147}, /* HCTH functional fitted to 147 molecules */
556#endif
557#if defined(XC_GGA_XC_HCTH_407)
558 {"XC_GGA_XC_HCTH_407", XC_GGA_XC_HCTH_407}, /* HCTH functional fitted to 407 molecules */
559#endif
560#if defined(XC_GGA_XC_EDF1)
561 {"XC_GGA_XC_EDF1", XC_GGA_XC_EDF1}, /*Empirical functionals from Adamson, Gill, and Pople */
562#endif
563#if defined(XC_GGA_XC_XLYP)
564 {"XC_GGA_XC_XLYP", XC_GGA_XC_XLYP}, /*XLYP functional */
565#endif
566#if defined(XC_GGA_XC_KT1)
567 {"XC_GGA_XC_KT1", XC_GGA_XC_KT1}, /* Keal and Tozer version 1 */
568#endif
569#if defined(XC_GGA_XC_B97_D)
570 {"XC_GGA_XC_B97_D", XC_GGA_XC_B97_D}, /*Grimme functional to be used with C6 vdW term */
571#endif
572#if defined(XC_GGA_XC_PBE1W)
573 {"XC_GGA_XC_PBE1W", XC_GGA_XC_PBE1W}, /* Functionals fitted for water */
574#endif
575#if defined(XC_GGA_XC_MPWLYP1W)
576 {"XC_GGA_XC_MPWLYP1W", XC_GGA_XC_MPWLYP1W}, /* Functionals fitted for water */
577#endif
578#if defined(XC_GGA_XC_PBELYP1W)
579 {"XC_GGA_XC_PBELYP1W", XC_GGA_XC_PBELYP1W}, /* Functionals fitted for water */
580#endif
581#if defined(XC_GGA_X_LBM)
582 {"XC_GGA_X_LBM", XC_GGA_X_LBM}, /* van Leeuwen & Baerends modified */
583#endif
584#if defined(XC_GGA_X_OL2)
585 {"XC_GGA_X_OL2", XC_GGA_X_OL2}, /*Exchange form based on Ou-Yang and Levy v.2 */
586#endif
587#if defined(XC_GGA_X_APBE)
588 {"XC_GGA_X_APBE", XC_GGA_X_APBE}, /* mu fixed from the semiclassical neutral atom */
589#endif
590#if defined(XC_GGA_K_APBE)
591 {"XC_GGA_K_APBE", XC_GGA_K_APBE}, /* mu fixed from the semiclassical neutral atom */
592#endif
593#if defined(XC_GGA_C_APBE)
594 {"XC_GGA_C_APBE", XC_GGA_C_APBE}, /* mu fixed from the semiclassical neutral atom */
595#endif
596#if defined(XC_GGA_K_TW1)
597 {"XC_GGA_K_TW1", XC_GGA_K_TW1}, /* Tran and Wesolowski set 1 (Table II) */
598#endif
599#if defined(XC_GGA_K_TW2)
600 {"XC_GGA_K_TW2", XC_GGA_K_TW2}, /* Tran and Wesolowski set 2 (Table II) */
601#endif
602#if defined(XC_GGA_K_TW3)
603 {"XC_GGA_K_TW3", XC_GGA_K_TW3}, /* Tran and Wesolowski set 3 (Table II) */
604#endif
605#if defined(XC_GGA_K_TW4)
606 {"XC_GGA_K_TW4", XC_GGA_K_TW4}, /* Tran and Wesolowski set 4 (Table II) */
607#endif
608#if defined(XC_GGA_X_HTBS)
609 {"XC_GGA_X_HTBS", XC_GGA_X_HTBS}, /*Haas, Tran, Blaha, and Schwarz */
610#endif
611#if defined(XC_GGA_X_AIRY)
612 {"XC_GGA_X_AIRY", XC_GGA_X_AIRY}, /*Constantin et al based on the Airy gas */
613#endif
614#if defined(XC_GGA_X_LAG)
615 {"XC_GGA_X_LAG", XC_GGA_X_LAG}, /*Local Airy Gas */
616#endif
617#if defined(XC_GGA_XC_MOHLYP)
618 {"XC_GGA_XC_MOHLYP", XC_GGA_XC_MOHLYP}, /* Functional for organometallic chemistry */
619#endif
620#if defined(XC_GGA_XC_MOHLYP2)
621 {"XC_GGA_XC_MOHLYP2", XC_GGA_XC_MOHLYP2}, /* Functional for barrier heights */
622#endif
623#if defined(XC_GGA_XC_TH_FL)
624 {"XC_GGA_XC_TH_FL", XC_GGA_XC_TH_FL}, /*Tozer and Handy v. FL */
625#endif
626#if defined(XC_GGA_XC_TH_FC)
627 {"XC_GGA_XC_TH_FC", XC_GGA_XC_TH_FC}, /* Tozer and Handy v. FC */
628#endif
629#if defined(XC_GGA_XC_TH_FCFO)
630 {"XC_GGA_XC_TH_FCFO", XC_GGA_XC_TH_FCFO}, /* Tozer and Handy v. FCFO */
631#endif
632#if defined(XC_GGA_XC_TH_FCO)
633 {"XC_GGA_XC_TH_FCO", XC_GGA_XC_TH_FCO}, /* Tozer and Handy v. FCO */
634#endif
635#if defined(XC_GGA_C_OPTC)
636 {"XC_GGA_C_OPTC", XC_GGA_C_OPTC}, /*Optimized correlation functional of Cohen and Handy */
637#endif
638#if defined(XC_GGA_C_PBELOC)
639 {"XC_GGA_C_PBELOC", XC_GGA_C_PBELOC}, /*Semilocal dynamical correlation */
640#endif
641#if defined(XC_GGA_XC_VV10)
642 {"XC_GGA_XC_VV10", XC_GGA_XC_VV10}, /*Vydrov and Van Voorhis */
643#endif
644#if defined(XC_GGA_C_PBEFE)
645 {"XC_GGA_C_PBEFE", XC_GGA_C_PBEFE}, /* PBE for formation energies */
646#endif
647#if defined(XC_GGA_C_OP_PW91)
648 {"XC_GGA_C_OP_PW91", XC_GGA_C_OP_PW91}, /*one-parameter progressive functional (PW91 version) */
649#endif
650#if defined(XC_GGA_X_PBEFE)
651 {"XC_GGA_X_PBEFE", XC_GGA_X_PBEFE}, /* PBE for formation energies */
652#endif
653#if defined(XC_GGA_X_CAP)
654 {"XC_GGA_X_CAP", XC_GGA_X_CAP}, /*Correct Asymptotic Potential */
655#endif
656#if defined(XC_GGA_X_EB88)
657 {"XC_GGA_X_EB88", XC_GGA_X_EB88}, /* Non-empirical (excogitated) B88 functional of Becke and Elliott */
658#endif
659#if defined(XC_GGA_C_PBE_MOL)
660 {"XC_GGA_C_PBE_MOL", XC_GGA_C_PBE_MOL}, /* Del Campo, Gazquez, Trickey and Vela (PBE-like) */
661#endif
662#if defined(XC_GGA_K_ABSP3)
663 {"XC_GGA_K_ABSP3", XC_GGA_K_ABSP3}, /* gamma-TFvW form by Acharya et al [g = 1 - 1.513/N^0.35] */
664#endif
665#if defined(XC_GGA_K_ABSP4)
666 {"XC_GGA_K_ABSP4", XC_GGA_K_ABSP4}, /* gamma-TFvW form by Acharya et al [g = l = 1/(1 + 1.332/N^(1/3))] */
667#endif
668#if defined(XC_GGA_C_BMK)
669 {"XC_GGA_C_BMK", XC_GGA_C_BMK}, /* Boese-Martin for kinetics */
670#endif
671#if defined(XC_GGA_C_TAU_HCTH)
672 {"XC_GGA_C_TAU_HCTH", XC_GGA_C_TAU_HCTH}, /* correlation part of tau-hcth */
673#endif
674#if defined(XC_GGA_C_HYB_TAU_HCTH)
675 {"XC_GGA_C_HYB_TAU_HCTH", XC_GGA_C_HYB_TAU_HCTH}, /* correlation part of hyb_tau-hcth */
676#endif
677#if defined(XC_GGA_X_BEEFVDW)
678 {"XC_GGA_X_BEEFVDW", XC_GGA_X_BEEFVDW}, /*BEEF-vdW exchange */
679#endif
680#if defined(XC_GGA_XC_BEEFVDW)
681 {"XC_GGA_XC_BEEFVDW", XC_GGA_XC_BEEFVDW}, /* BEEF-vdW exchange-correlation */
682#endif
683#if defined(XC_GGA_X_PBETRANS)
684 {"XC_GGA_X_PBETRANS", XC_GGA_X_PBETRANS}, /*Gradient-based interpolation between PBE and revPBE */
685#endif
686#if defined(XC_GGA_X_CHACHIYO)
687 {"XC_GGA_X_CHACHIYO", XC_GGA_X_CHACHIYO}, /*Chachiyo exchange */
688#endif
689#if defined(XC_GGA_K_VW)
690 {"XC_GGA_K_VW", XC_GGA_K_VW}, /* von Weiszaecker functional */
691#endif
692#if defined(XC_GGA_K_GE2)
693 {"XC_GGA_K_GE2", XC_GGA_K_GE2}, /* Second-order gradient expansion (l = 1/9) */
694#endif
695#if defined(XC_GGA_K_GOLDEN)
696 {"XC_GGA_K_GOLDEN", XC_GGA_K_GOLDEN}, /* TF-lambda-vW form by Golden (l = 13/45) */
697#endif
698#if defined(XC_GGA_K_YT65)
699 {"XC_GGA_K_YT65", XC_GGA_K_YT65}, /* TF-lambda-vW form by Yonei and Tomishima (l = 1/5) */
700#endif
701#if defined(XC_GGA_K_BALTIN)
702 {"XC_GGA_K_BALTIN", XC_GGA_K_BALTIN}, /* TF-lambda-vW form by Baltin (l = 5/9) */
703#endif
704#if defined(XC_GGA_K_LIEB)
705 {"XC_GGA_K_LIEB", XC_GGA_K_LIEB}, /* TF-lambda-vW form by Lieb (l = 0.185909191) */
706#endif
707#if defined(XC_GGA_K_ABSP1)
708 {"XC_GGA_K_ABSP1", XC_GGA_K_ABSP1}, /* gamma-TFvW form by Acharya et al [g = 1 - 1.412/N^(1/3)] */
709#endif
710#if defined(XC_GGA_K_ABSP2)
711 {"XC_GGA_K_ABSP2", XC_GGA_K_ABSP2}, /* gamma-TFvW form by Acharya et al [g = 1 - 1.332/N^(1/3)] */
712#endif
713#if defined(XC_GGA_K_GR)
714 {"XC_GGA_K_GR", XC_GGA_K_GR}, /* gamma-TFvW form by Gazquez and Robles */
715#endif
716#if defined(XC_GGA_K_LUDENA)
717 {"XC_GGA_K_LUDENA", XC_GGA_K_LUDENA}, /* gamma-TFvW form by Ludena */
718#endif
719#if defined(XC_GGA_K_GP85)
720 {"XC_GGA_K_GP85", XC_GGA_K_GP85}, /* gamma-TFvW form by Ghosh and Parr */
721#endif
722#if defined(XC_GGA_K_PEARSON)
723 {"XC_GGA_K_PEARSON", XC_GGA_K_PEARSON}, /*Pearson */
724#endif
725#if defined(XC_GGA_K_OL1)
726 {"XC_GGA_K_OL1", XC_GGA_K_OL1}, /*Ou-Yang and Levy v.1 */
727#endif
728#if defined(XC_GGA_K_OL2)
729 {"XC_GGA_K_OL2", XC_GGA_K_OL2}, /* Ou-Yang and Levy v.2 */
730#endif
731#if defined(XC_GGA_K_FR_B88)
732 {"XC_GGA_K_FR_B88", XC_GGA_K_FR_B88}, /* Fuentealba & Reyes (B88 version) */
733#endif
734#if defined(XC_GGA_K_FR_PW86)
735 {"XC_GGA_K_FR_PW86", XC_GGA_K_FR_PW86}, /* Fuentealba & Reyes (PW86 version) */
736#endif
737#if defined(XC_GGA_K_DK)
738 {"XC_GGA_K_DK", XC_GGA_K_DK}, /*DePristo and Kress */
739#endif
740#if defined(XC_GGA_K_PERDEW)
741 {"XC_GGA_K_PERDEW", XC_GGA_K_PERDEW}, /* Perdew */
742#endif
743#if defined(XC_GGA_K_VSK)
744 {"XC_GGA_K_VSK", XC_GGA_K_VSK}, /* Vitos, Skriver, and Kollar */
745#endif
746#if defined(XC_GGA_K_VJKS)
747 {"XC_GGA_K_VJKS", XC_GGA_K_VJKS}, /* Vitos, Johansson, Kollar, and Skriver */
748#endif
749#if defined(XC_GGA_K_ERNZERHOF)
750 {"XC_GGA_K_ERNZERHOF", XC_GGA_K_ERNZERHOF}, /* Ernzerhof */
751#endif
752#if defined(XC_GGA_K_LC94)
753 {"XC_GGA_K_LC94", XC_GGA_K_LC94}, /* Lembarki & Chermette */
754#endif
755#if defined(XC_GGA_K_LLP)
756 {"XC_GGA_K_LLP", XC_GGA_K_LLP}, /* Lee, Lee & Parr */
757#endif
758#if defined(XC_GGA_K_THAKKAR)
759 {"XC_GGA_K_THAKKAR", XC_GGA_K_THAKKAR}, /*Thakkar 1992 */
760#endif
761#if defined(XC_GGA_X_WPBEH)
762 {"XC_GGA_X_WPBEH", XC_GGA_X_WPBEH}, /*short-range version of the PBE */
763#endif
764#if defined(XC_GGA_X_HJS_PBE)
765 {"XC_GGA_X_HJS_PBE", XC_GGA_X_HJS_PBE}, /*HJS screened exchange PBE version */
766#endif
767#if defined(XC_GGA_X_HJS_PBE_SOL)
768 {"XC_GGA_X_HJS_PBE_SOL", XC_GGA_X_HJS_PBE_SOL}, /* HJS screened exchange PBE_SOL version */
769#endif
770#if defined(XC_GGA_X_HJS_B88)
771 {"XC_GGA_X_HJS_B88", XC_GGA_X_HJS_B88}, /* HJS screened exchange B88 version */
772#endif
773#if defined(XC_GGA_X_HJS_B97X)
774 {"XC_GGA_X_HJS_B97X", XC_GGA_X_HJS_B97X}, /* HJS screened exchange B97x version */
775#endif
776#if defined(XC_GGA_X_ITYH)
777 {"XC_GGA_X_ITYH", XC_GGA_X_ITYH}, /*short-range recipe for exchange GGA functionals */
778#endif
779#if defined(XC_GGA_X_SFAT)
780 {"XC_GGA_X_SFAT", XC_GGA_X_SFAT}, /*short-range recipe for exchange GGA functionals */
781#endif
782#if defined(XC_GGA_X_SG4)
783 {"XC_GGA_X_SG4", XC_GGA_X_SG4}, /*Semiclassical GGA at fourth order */
784#endif
785#if defined(XC_GGA_C_SG4)
786 {"XC_GGA_C_SG4", XC_GGA_C_SG4}, /*Semiclassical GGA at fourth order */
787#endif
788#if defined(XC_GGA_X_GG99)
789 {"XC_GGA_X_GG99", XC_GGA_X_GG99}, /*Gilbert and Gill 1999 */
790#endif
791#if defined(XC_GGA_X_PBEpow)
792 {"XC_GGA_X_PBEpow", XC_GGA_X_PBEpow}, /*PBE power */
793#endif
794#if defined(XC_GGA_X_KGG99)
795 {"XC_GGA_X_KGG99", XC_GGA_X_KGG99}, /* Gilbert and Gill 1999 (mixed) */
796#endif
797#if defined(XC_GGA_XC_HLE16)
798 {"XC_GGA_XC_HLE16", XC_GGA_XC_HLE16}, /* high local exchange 2016 */
799#endif
800#if defined(XC_GGA_C_SCAN_E0)
801 {"XC_GGA_C_SCAN_E0", XC_GGA_C_SCAN_E0}, /*GGA component of SCAN */
802#endif
803#if defined(XC_GGA_C_GAPC)
804 {"XC_GGA_C_GAPC", XC_GGA_C_GAPC}, /*GapC */
805#endif
806#if defined(XC_GGA_C_GAPLOC)
807 {"XC_GGA_C_GAPLOC", XC_GGA_C_GAPLOC}, /*Gaploc */
808#endif
809#if defined(XC_GGA_C_ZVPBEINT)
810 {"XC_GGA_C_ZVPBEINT", XC_GGA_C_ZVPBEINT}, /*another spin-dependent correction to PBEint */
811#endif
812#if defined(XC_GGA_C_ZVPBESOL)
813 {"XC_GGA_C_ZVPBESOL", XC_GGA_C_ZVPBESOL}, /* another spin-dependent correction to PBEsol */
814#endif
815#if defined(XC_GGA_C_TM_LYP)
816 {"XC_GGA_C_TM_LYP", XC_GGA_C_TM_LYP}, /* Takkar and McCarthy reparametrization */
817#endif
818#if defined(XC_GGA_C_TM_PBE)
819 {"XC_GGA_C_TM_PBE", XC_GGA_C_TM_PBE}, /* Thakkar and McCarthy reparametrization */
820#endif
821#if defined(XC_GGA_C_W94)
822 {"XC_GGA_C_W94", XC_GGA_C_W94}, /*Wilson 94 (Eq. 25) */
823#endif
824#if defined(XC_GGA_C_CS1)
825 {"XC_GGA_C_CS1", XC_GGA_C_CS1}, /*A dynamical correlation functional */
826#endif
827#if defined(XC_GGA_X_B88M)
828 {"XC_GGA_X_B88M", XC_GGA_X_B88M}, /* Becke 88 reoptimized to be used with mgga_c_tau1 */
829#endif
830#if defined(XC_GGA_K_PBE3)
831 {"XC_GGA_K_PBE3", XC_GGA_K_PBE3}, /* Three parameter PBE-like expansion */
832#endif
833#if defined(XC_GGA_K_PBE4)
834 {"XC_GGA_K_PBE4", XC_GGA_K_PBE4}, /* Four parameter PBE-like expansion */
835#endif
836#if defined(XC_GGA_K_EXP4)
837 {"XC_GGA_K_EXP4", XC_GGA_K_EXP4}, /*Intermediate form between PBE3 and PBE4 */
838#endif
839#if defined(XC_HYB_GGA_X_N12_SX)
840 {"XC_HYB_GGA_X_N12_SX", XC_HYB_GGA_X_N12_SX}, /*N12-SX functional from Minnesota */
841#endif
842#if defined(XC_HYB_GGA_XC_B97_1p)
843 {"XC_HYB_GGA_XC_B97_1p", XC_HYB_GGA_XC_B97_1p}, /* version of B97 by Cohen and Handy */
844#endif
845#if defined(XC_HYB_GGA_XC_PBE_MOL0)
846 {"XC_HYB_GGA_XC_PBE_MOL0", XC_HYB_GGA_XC_PBE_MOL0}, /* PBEmol0 */
847#endif
848#if defined(XC_HYB_GGA_XC_PBE_SOL0)
849 {"XC_HYB_GGA_XC_PBE_SOL0", XC_HYB_GGA_XC_PBE_SOL0}, /* PBEsol0 */
850#endif
851#if defined(XC_HYB_GGA_XC_PBEB0)
852 {"XC_HYB_GGA_XC_PBEB0", XC_HYB_GGA_XC_PBEB0}, /* PBEbeta0 */
853#endif
854#if defined(XC_HYB_GGA_XC_PBE_MOLB0)
855 {"XC_HYB_GGA_XC_PBE_MOLB0", XC_HYB_GGA_XC_PBE_MOLB0}, /* PBEmolbeta0 */
856#endif
857#if defined(XC_HYB_GGA_XC_PBE50)
858 {"XC_HYB_GGA_XC_PBE50", XC_HYB_GGA_XC_PBE50}, /* PBE0 with 50% exx */
859#endif
860#if defined(XC_HYB_GGA_XC_B3PW91)
861 {"XC_HYB_GGA_XC_B3PW91", XC_HYB_GGA_XC_B3PW91}, /*The original (ACM) hybrid of Becke */
862#endif
863#if defined(XC_HYB_GGA_XC_B3LYP)
864 {"XC_HYB_GGA_XC_B3LYP", XC_HYB_GGA_XC_B3LYP}, /* The (in)famous B3LYP */
865#endif
866#if defined(XC_HYB_GGA_XC_B3P86)
867 {"XC_HYB_GGA_XC_B3P86", XC_HYB_GGA_XC_B3P86}, /* Perdew 86 hybrid similar to B3PW91 */
868#endif
869#if defined(XC_HYB_GGA_XC_O3LYP)
870 {"XC_HYB_GGA_XC_O3LYP", XC_HYB_GGA_XC_O3LYP}, /*hybrid using the optx functional */
871#endif
872#if defined(XC_HYB_GGA_XC_MPW1K)
873 {"XC_HYB_GGA_XC_MPW1K", XC_HYB_GGA_XC_MPW1K}, /* mixture of mPW91 and PW91 optimized for kinetics */
874#endif
875#if defined(XC_HYB_GGA_XC_PBEH)
876 {"XC_HYB_GGA_XC_PBEH", XC_HYB_GGA_XC_PBEH}, /*aka PBE0 or PBE1PBE */
877#endif
878#if defined(XC_HYB_GGA_XC_B97)
879 {"XC_HYB_GGA_XC_B97", XC_HYB_GGA_XC_B97}, /*Becke 97 */
880#endif
881#if defined(XC_HYB_GGA_XC_B97_1)
882 {"XC_HYB_GGA_XC_B97_1", XC_HYB_GGA_XC_B97_1}, /* Becke 97-1 */
883#endif
884#if defined(XC_HYB_GGA_XC_B97_2)
885 {"XC_HYB_GGA_XC_B97_2", XC_HYB_GGA_XC_B97_2}, /* Becke 97-2 */
886#endif
887#if defined(XC_HYB_GGA_XC_X3LYP)
888 {"XC_HYB_GGA_XC_X3LYP", XC_HYB_GGA_XC_X3LYP}, /* hybrid by Xu and Goddard */
889#endif
890#if defined(XC_HYB_GGA_XC_B1WC)
891 {"XC_HYB_GGA_XC_B1WC", XC_HYB_GGA_XC_B1WC}, /*Becke 1-parameter mixture of WC and PBE */
892#endif
893#if defined(XC_HYB_GGA_XC_B97_K)
894 {"XC_HYB_GGA_XC_B97_K", XC_HYB_GGA_XC_B97_K}, /* Boese-Martin for Kinetics */
895#endif
896#if defined(XC_HYB_GGA_XC_B97_3)
897 {"XC_HYB_GGA_XC_B97_3", XC_HYB_GGA_XC_B97_3}, /* Becke 97-3 */
898#endif
899#if defined(XC_HYB_GGA_XC_MPW3PW)
900 {"XC_HYB_GGA_XC_MPW3PW", XC_HYB_GGA_XC_MPW3PW}, /* mixture with the mPW functional */
901#endif
902#if defined(XC_HYB_GGA_XC_B1LYP)
903 {"XC_HYB_GGA_XC_B1LYP", XC_HYB_GGA_XC_B1LYP}, /* Becke 1-parameter mixture of B88 and LYP */
904#endif
905#if defined(XC_HYB_GGA_XC_B1PW91)
906 {"XC_HYB_GGA_XC_B1PW91", XC_HYB_GGA_XC_B1PW91}, /* Becke 1-parameter mixture of B88 and PW91 */
907#endif
908#if defined(XC_HYB_GGA_XC_MPW1PW)
909 {"XC_HYB_GGA_XC_MPW1PW", XC_HYB_GGA_XC_MPW1PW}, /* Becke 1-parameter mixture of mPW91 and PW91 */
910#endif
911#if defined(XC_HYB_GGA_XC_MPW3LYP)
912 {"XC_HYB_GGA_XC_MPW3LYP", XC_HYB_GGA_XC_MPW3LYP}, /* mixture of mPW and LYP */
913#endif
914#if defined(XC_HYB_GGA_XC_SB98_1a)
915 {"XC_HYB_GGA_XC_SB98_1a", XC_HYB_GGA_XC_SB98_1a}, /* Schmider-Becke 98 parameterization 1a */
916#endif
917#if defined(XC_HYB_GGA_XC_SB98_1b)
918 {"XC_HYB_GGA_XC_SB98_1b", XC_HYB_GGA_XC_SB98_1b}, /* Schmider-Becke 98 parameterization 1b */
919#endif
920#if defined(XC_HYB_GGA_XC_SB98_1c)
921 {"XC_HYB_GGA_XC_SB98_1c", XC_HYB_GGA_XC_SB98_1c}, /* Schmider-Becke 98 parameterization 1c */
922#endif
923#if defined(XC_HYB_GGA_XC_SB98_2a)
924 {"XC_HYB_GGA_XC_SB98_2a", XC_HYB_GGA_XC_SB98_2a}, /* Schmider-Becke 98 parameterization 2a */
925#endif
926#if defined(XC_HYB_GGA_XC_SB98_2b)
927 {"XC_HYB_GGA_XC_SB98_2b", XC_HYB_GGA_XC_SB98_2b}, /* Schmider-Becke 98 parameterization 2b */
928#endif
929#if defined(XC_HYB_GGA_XC_SB98_2c)
930 {"XC_HYB_GGA_XC_SB98_2c", XC_HYB_GGA_XC_SB98_2c}, /* Schmider-Becke 98 parameterization 2c */
931#endif
932#if defined(XC_HYB_GGA_X_SOGGA11_X)
933 {"XC_HYB_GGA_X_SOGGA11_X", XC_HYB_GGA_X_SOGGA11_X}, /*Hybrid based on SOGGA11 form */
934#endif
935#if defined(XC_HYB_GGA_XC_HSE03)
936 {"XC_HYB_GGA_XC_HSE03", XC_HYB_GGA_XC_HSE03}, /*the 2003 version of the screened hybrid HSE */
937#endif
938#if defined(XC_HYB_GGA_XC_HSE06)
939 {"XC_HYB_GGA_XC_HSE06", XC_HYB_GGA_XC_HSE06}, /* the 2006 version of the screened hybrid HSE */
940#endif
941#if defined(XC_HYB_GGA_XC_HJS_PBE)
942 {"XC_HYB_GGA_XC_HJS_PBE", XC_HYB_GGA_XC_HJS_PBE}, /* HJS hybrid screened exchange PBE version */
943#endif
944#if defined(XC_HYB_GGA_XC_HJS_PBE_SOL)
945 {"XC_HYB_GGA_XC_HJS_PBE_SOL", XC_HYB_GGA_XC_HJS_PBE_SOL}, /* HJS hybrid screened exchange PBE_SOL version */
946#endif
947#if defined(XC_HYB_GGA_XC_HJS_B88)
948 {"XC_HYB_GGA_XC_HJS_B88", XC_HYB_GGA_XC_HJS_B88}, /* HJS hybrid screened exchange B88 version */
949#endif
950#if defined(XC_HYB_GGA_XC_HJS_B97X)
951 {"XC_HYB_GGA_XC_HJS_B97X", XC_HYB_GGA_XC_HJS_B97X}, /* HJS hybrid screened exchange B97x version */
952#endif
953#if defined(XC_HYB_GGA_XC_CAM_B3LYP)
954 {"XC_HYB_GGA_XC_CAM_B3LYP", XC_HYB_GGA_XC_CAM_B3LYP}, /*CAM version of B3LYP */
955#endif
956#if defined(XC_HYB_GGA_XC_TUNED_CAM_B3LYP)
957 {"XC_HYB_GGA_XC_TUNED_CAM_B3LYP", XC_HYB_GGA_XC_TUNED_CAM_B3LYP}, /* CAM version of B3LYP tuned for excitations */
958#endif
959#if defined(XC_HYB_GGA_XC_BHANDH)
960 {"XC_HYB_GGA_XC_BHANDH", XC_HYB_GGA_XC_BHANDH}, /* Becke half-and-half */
961#endif
962#if defined(XC_HYB_GGA_XC_BHANDHLYP)
963 {"XC_HYB_GGA_XC_BHANDHLYP", XC_HYB_GGA_XC_BHANDHLYP}, /* Becke half-and-half with B88 exchange */
964#endif
965#if defined(XC_HYB_GGA_XC_MB3LYP_RC04)
966 {"XC_HYB_GGA_XC_MB3LYP_RC04", XC_HYB_GGA_XC_MB3LYP_RC04}, /* B3LYP with RC04 LDA */
967#endif
968#if defined(XC_HYB_GGA_XC_MPWLYP1M)
969 {"XC_HYB_GGA_XC_MPWLYP1M", XC_HYB_GGA_XC_MPWLYP1M}, /* MPW with 1 par. for metals/LYP */
970#endif
971#if defined(XC_HYB_GGA_XC_REVB3LYP)
972 {"XC_HYB_GGA_XC_REVB3LYP", XC_HYB_GGA_XC_REVB3LYP}, /* Revised B3LYP */
973#endif
974#if defined(XC_HYB_GGA_XC_CAMY_BLYP)
975 {"XC_HYB_GGA_XC_CAMY_BLYP", XC_HYB_GGA_XC_CAMY_BLYP}, /*BLYP with yukawa screening */
976#endif
977#if defined(XC_HYB_GGA_XC_PBE0_13)
978 {"XC_HYB_GGA_XC_PBE0_13", XC_HYB_GGA_XC_PBE0_13}, /* PBE0-1/3 */
979#endif
980#if defined(XC_HYB_GGA_XC_B3LYPs)
981 {"XC_HYB_GGA_XC_B3LYPs", XC_HYB_GGA_XC_B3LYPs}, /* B3LYP* functional */
982#endif
983#if defined(XC_HYB_GGA_XC_WB97)
984 {"XC_HYB_GGA_XC_WB97", XC_HYB_GGA_XC_WB97}, /*Chai and Head-Gordon */
985#endif
986#if defined(XC_HYB_GGA_XC_WB97X)
987 {"XC_HYB_GGA_XC_WB97X", XC_HYB_GGA_XC_WB97X}, /* Chai and Head-Gordon */
988#endif
989#if defined(XC_HYB_GGA_XC_LRC_WPBEH)
990 {"XC_HYB_GGA_XC_LRC_WPBEH", XC_HYB_GGA_XC_LRC_WPBEH}, /* Long-range corrected functional by Rorhdanz et al */
991#endif
992#if defined(XC_HYB_GGA_XC_WB97X_V)
993 {"XC_HYB_GGA_XC_WB97X_V", XC_HYB_GGA_XC_WB97X_V}, /* Mardirossian and Head-Gordon */
994#endif
995#if defined(XC_HYB_GGA_XC_LCY_PBE)
996 {"XC_HYB_GGA_XC_LCY_PBE", XC_HYB_GGA_XC_LCY_PBE}, /*PBE with yukawa screening */
997#endif
998#if defined(XC_HYB_GGA_XC_LCY_BLYP)
999 {"XC_HYB_GGA_XC_LCY_BLYP", XC_HYB_GGA_XC_LCY_BLYP}, /*BLYP with yukawa screening */
1000#endif
1001#if defined(XC_HYB_GGA_XC_LC_VV10)
1002 {"XC_HYB_GGA_XC_LC_VV10", XC_HYB_GGA_XC_LC_VV10}, /*Vydrov and Van Voorhis */
1003#endif
1004#if defined(XC_HYB_GGA_XC_CAMY_B3LYP)
1005 {"XC_HYB_GGA_XC_CAMY_B3LYP", XC_HYB_GGA_XC_CAMY_B3LYP}, /*B3LYP with Yukawa screening */
1006#endif
1007#if defined(XC_HYB_GGA_XC_WB97X_D)
1008 {"XC_HYB_GGA_XC_WB97X_D", XC_HYB_GGA_XC_WB97X_D}, /* Chai and Head-Gordon */
1009#endif
1010#if defined(XC_HYB_GGA_XC_HPBEINT)
1011 {"XC_HYB_GGA_XC_HPBEINT", XC_HYB_GGA_XC_HPBEINT}, /* hPBEint */
1012#endif
1013#if defined(XC_HYB_GGA_XC_LRC_WPBE)
1014 {"XC_HYB_GGA_XC_LRC_WPBE", XC_HYB_GGA_XC_LRC_WPBE}, /* Long-range corrected functional by Rorhdanz et al */
1015#endif
1016#if defined(XC_HYB_GGA_XC_B3LYP5)
1017 {"XC_HYB_GGA_XC_B3LYP5", XC_HYB_GGA_XC_B3LYP5}, /* B3LYP with VWN functional 5 instead of RPA */
1018#endif
1019#if defined(XC_HYB_GGA_XC_EDF2)
1020 {"XC_HYB_GGA_XC_EDF2", XC_HYB_GGA_XC_EDF2}, /*Empirical functional from Lin, George and Gill */
1021#endif
1022#if defined(XC_HYB_GGA_XC_CAP0)
1023 {"XC_HYB_GGA_XC_CAP0", XC_HYB_GGA_XC_CAP0}, /*Correct Asymptotic Potential hybrid */
1024#endif
1025#if defined(XC_HYB_GGA_XC_LC_WPBE)
1026 {"XC_HYB_GGA_XC_LC_WPBE", XC_HYB_GGA_XC_LC_WPBE}, /* Long-range corrected functional by Vydrov and Scuseria */
1027#endif
1028#if defined(XC_HYB_GGA_XC_HSE12)
1029 {"XC_HYB_GGA_XC_HSE12", XC_HYB_GGA_XC_HSE12}, /* HSE12 by Moussa, Schultz and Chelikowsky */
1030#endif
1031#if defined(XC_HYB_GGA_XC_HSE12S)
1032 {"XC_HYB_GGA_XC_HSE12S", XC_HYB_GGA_XC_HSE12S}, /* Short-range HSE12 by Moussa, Schultz, and Chelikowsky */
1033#endif
1034#if defined(XC_HYB_GGA_XC_HSE_SOL)
1035 {"XC_HYB_GGA_XC_HSE_SOL", XC_HYB_GGA_XC_HSE_SOL}, /* HSEsol functional by Schimka, Harl, and Kresse */
1036#endif
1037#if defined(XC_HYB_GGA_XC_CAM_QTP_01)
1038 {"XC_HYB_GGA_XC_CAM_QTP_01",
1039 XC_HYB_GGA_XC_CAM_QTP_01}, /* CAM-QTP(01): CAM-B3LYP retuned using ionization potentials of water */
1040#endif
1041#if defined(XC_HYB_GGA_XC_MPW1LYP)
1042 {"XC_HYB_GGA_XC_MPW1LYP", XC_HYB_GGA_XC_MPW1LYP}, /* Becke 1-parameter mixture of mPW91 and LYP */
1043#endif
1044#if defined(XC_HYB_GGA_XC_MPW1PBE)
1045 {"XC_HYB_GGA_XC_MPW1PBE", XC_HYB_GGA_XC_MPW1PBE}, /* Becke 1-parameter mixture of mPW91 and PBE */
1046#endif
1047#if defined(XC_HYB_GGA_XC_KMLYP)
1048 {"XC_HYB_GGA_XC_KMLYP", XC_HYB_GGA_XC_KMLYP}, /* Kang-Musgrave hybrid */
1049#endif
1050#if defined(XC_HYB_GGA_XC_B5050LYP)
1051 {"XC_HYB_GGA_XC_B5050LYP", XC_HYB_GGA_XC_B5050LYP}, /* Like B3LYP but more exact exchange */
1052#endif
1053#if defined(XC_MGGA_C_DLDF)
1054 {"XC_MGGA_C_DLDF", XC_MGGA_C_DLDF}, /* Dispersionless Density Functional */
1055#endif
1056#if defined(XC_MGGA_XC_ZLP)
1057 {"XC_MGGA_XC_ZLP", XC_MGGA_XC_ZLP}, /*Zhao, Levy & Parr, Eq. (21) */
1058#endif
1059#if defined(XC_MGGA_XC_OTPSS_D)
1060 {"XC_MGGA_XC_OTPSS_D", XC_MGGA_XC_OTPSS_D}, /*oTPSS_D functional of Goerigk and Grimme */
1061#endif
1062#if defined(XC_MGGA_C_CS)
1063 {"XC_MGGA_C_CS", XC_MGGA_C_CS}, /*Colle and Salvetti */
1064#endif
1065#if defined(XC_MGGA_C_MN12_SX)
1066 {"XC_MGGA_C_MN12_SX", XC_MGGA_C_MN12_SX}, /* MN12-SX correlation functional from Minnesota */
1067#endif
1068#if defined(XC_MGGA_C_MN12_L)
1069 {"XC_MGGA_C_MN12_L", XC_MGGA_C_MN12_L}, /* MN12-L correlation functional from Minnesota */
1070#endif
1071#if defined(XC_MGGA_C_M11_L)
1072 {"XC_MGGA_C_M11_L", XC_MGGA_C_M11_L}, /* M11-L correlation functional from Minnesota */
1073#endif
1074#if defined(XC_MGGA_C_M11)
1075 {"XC_MGGA_C_M11", XC_MGGA_C_M11}, /* M11 correlation functional from Minnesota */
1076#endif
1077#if defined(XC_MGGA_C_M08_SO)
1078 {"XC_MGGA_C_M08_SO", XC_MGGA_C_M08_SO}, /* M08-SO correlation functional from Minnesota */
1079#endif
1080#if defined(XC_MGGA_C_M08_HX)
1081 {"XC_MGGA_C_M08_HX", XC_MGGA_C_M08_HX}, /*M08-HX correlation functional from Minnesota */
1082#endif
1083#if defined(XC_MGGA_X_LTA)
1084 {"XC_MGGA_X_LTA", XC_MGGA_X_LTA}, /*Local tau approximation of Ernzerhof & Scuseria */
1085#endif
1086#if defined(XC_MGGA_X_TPSS)
1087 {"XC_MGGA_X_TPSS", XC_MGGA_X_TPSS}, /*Tao, Perdew, Staroverov & Scuseria exchange */
1088#endif
1089#if defined(XC_MGGA_X_M06_L)
1090 {"XC_MGGA_X_M06_L", XC_MGGA_X_M06_L}, /*M06-L exchange functional from Minnesota */
1091#endif
1092#if defined(XC_MGGA_X_GVT4)
1093 {"XC_MGGA_X_GVT4", XC_MGGA_X_GVT4}, /*GVT4 from Van Voorhis and Scuseria */
1094#endif
1095#if defined(XC_MGGA_X_TAU_HCTH)
1096 {"XC_MGGA_X_TAU_HCTH", XC_MGGA_X_TAU_HCTH}, /*tau-HCTH from Boese and Handy */
1097#endif
1098#if defined(XC_MGGA_X_BR89)
1099 {"XC_MGGA_X_BR89", XC_MGGA_X_BR89}, /*Becke-Roussel 89 */
1100#endif
1101#if defined(XC_MGGA_X_BJ06)
1102 {"XC_MGGA_X_BJ06", XC_MGGA_X_BJ06}, /* Becke & Johnson correction to Becke-Roussel 89 */
1103#endif
1104#if defined(XC_MGGA_X_TB09)
1105 {"XC_MGGA_X_TB09", XC_MGGA_X_TB09}, /* Tran & Blaha correction to Becke & Johnson */
1106#endif
1107#if defined(XC_MGGA_X_RPP09)
1108 {"XC_MGGA_X_RPP09", XC_MGGA_X_RPP09}, /* Rasanen, Pittalis, and Proetto correction to Becke & Johnson */
1109#endif
1110#if defined(XC_MGGA_X_2D_PRHG07)
1111 {"XC_MGGA_X_2D_PRHG07", XC_MGGA_X_2D_PRHG07}, /*Pittalis, Rasanen, Helbig, Gross Exchange Functional */
1112#endif
1113#if defined(XC_MGGA_X_2D_PRHG07_PRP10)
1114 {"XC_MGGA_X_2D_PRHG07_PRP10", XC_MGGA_X_2D_PRHG07_PRP10}, /* PRGH07 with PRP10 correction */
1115#endif
1116#if defined(XC_MGGA_X_REVTPSS)
1117 {"XC_MGGA_X_REVTPSS", XC_MGGA_X_REVTPSS}, /* revised Tao, Perdew, Staroverov & Scuseria exchange */
1118#endif
1119#if defined(XC_MGGA_X_PKZB)
1120 {"XC_MGGA_X_PKZB", XC_MGGA_X_PKZB}, /*Perdew, Kurth, Zupan, and Blaha */
1121#endif
1122#if defined(XC_MGGA_X_MS0)
1123 {"XC_MGGA_X_MS0", XC_MGGA_X_MS0}, /*MS exchange of Sun, Xiao, and Ruzsinszky */
1124#endif
1125#if defined(XC_MGGA_X_MS1)
1126 {"XC_MGGA_X_MS1", XC_MGGA_X_MS1}, /* MS1 exchange of Sun, et al */
1127#endif
1128#if defined(XC_MGGA_X_MS2)
1129 {"XC_MGGA_X_MS2", XC_MGGA_X_MS2}, /* MS2 exchange of Sun, et al */
1130#endif
1131#if defined(XC_MGGA_X_M11_L)
1132 {"XC_MGGA_X_M11_L", XC_MGGA_X_M11_L}, /*M11-L exchange functional from Minnesota */
1133#endif
1134#if defined(XC_MGGA_X_MN12_L)
1135 {"XC_MGGA_X_MN12_L", XC_MGGA_X_MN12_L}, /*MN12-L exchange functional from Minnesota */
1136#endif
1137#if defined(XC_MGGA_XC_CC06)
1138 {"XC_MGGA_XC_CC06", XC_MGGA_XC_CC06}, /*Cancio and Chou 2006 */
1139#endif
1140#if defined(XC_MGGA_X_MK00)
1141 {"XC_MGGA_X_MK00", XC_MGGA_X_MK00}, /*Exchange for accurate virtual orbital energies */
1142#endif
1143#if defined(XC_MGGA_C_TPSS)
1144 {"XC_MGGA_C_TPSS", XC_MGGA_C_TPSS}, /*Tao, Perdew, Staroverov & Scuseria correlation */
1145#endif
1146#if defined(XC_MGGA_C_VSXC)
1147 {"XC_MGGA_C_VSXC", XC_MGGA_C_VSXC}, /*VSxc from Van Voorhis and Scuseria (correlation part) */
1148#endif
1149#if defined(XC_MGGA_C_M06_L)
1150 {"XC_MGGA_C_M06_L", XC_MGGA_C_M06_L}, /*M06-L correlation functional from Minnesota */
1151#endif
1152#if defined(XC_MGGA_C_M06_HF)
1153 {"XC_MGGA_C_M06_HF", XC_MGGA_C_M06_HF}, /* M06-HF correlation functional from Minnesota */
1154#endif
1155#if defined(XC_MGGA_C_M06)
1156 {"XC_MGGA_C_M06", XC_MGGA_C_M06}, /* M06 correlation functional from Minnesota */
1157#endif
1158#if defined(XC_MGGA_C_M06_2X)
1159 {"XC_MGGA_C_M06_2X", XC_MGGA_C_M06_2X}, /* M06-2X correlation functional from Minnesota */
1160#endif
1161#if defined(XC_MGGA_C_M05)
1162 {"XC_MGGA_C_M05", XC_MGGA_C_M05}, /*M05 correlation functional from Minnesota */
1163#endif
1164#if defined(XC_MGGA_C_M05_2X)
1165 {"XC_MGGA_C_M05_2X", XC_MGGA_C_M05_2X}, /* M05-2X correlation functional from Minnesota */
1166#endif
1167#if defined(XC_MGGA_C_PKZB)
1168 {"XC_MGGA_C_PKZB", XC_MGGA_C_PKZB}, /*Perdew, Kurth, Zupan, and Blaha */
1169#endif
1170#if defined(XC_MGGA_C_BC95)
1171 {"XC_MGGA_C_BC95", XC_MGGA_C_BC95}, /*Becke correlation 95 */
1172#endif
1173#if defined(XC_MGGA_C_REVTPSS)
1174 {"XC_MGGA_C_REVTPSS", XC_MGGA_C_REVTPSS}, /*revised TPSS correlation */
1175#endif
1176#if defined(XC_MGGA_XC_TPSSLYP1W)
1177 {"XC_MGGA_XC_TPSSLYP1W", XC_MGGA_XC_TPSSLYP1W}, /*Functionals fitted for water */
1178#endif
1179#if defined(XC_MGGA_X_MK00B)
1180 {"XC_MGGA_X_MK00B", XC_MGGA_X_MK00B}, /* Exchange for accurate virtual orbital energies (v. B) */
1181#endif
1182#if defined(XC_MGGA_X_BLOC)
1183 {"XC_MGGA_X_BLOC", XC_MGGA_X_BLOC}, /* functional with balanced localization */
1184#endif
1185#if defined(XC_MGGA_X_MODTPSS)
1186 {"XC_MGGA_X_MODTPSS", XC_MGGA_X_MODTPSS}, /* Modified Tao, Perdew, Staroverov & Scuseria exchange */
1187#endif
1188#if defined(XC_MGGA_C_TPSSLOC)
1189 {"XC_MGGA_C_TPSSLOC", XC_MGGA_C_TPSSLOC}, /*Semilocal dynamical correlation */
1190#endif
1191#if defined(XC_MGGA_X_MBEEF)
1192 {"XC_MGGA_X_MBEEF", XC_MGGA_X_MBEEF}, /*mBEEF exchange */
1193#endif
1194#if defined(XC_MGGA_X_MBEEFVDW)
1195 {"XC_MGGA_X_MBEEFVDW", XC_MGGA_X_MBEEFVDW}, /*mBEEF-vdW exchange */
1196#endif
1197#if defined(XC_MGGA_XC_B97M_V)
1198 {"XC_MGGA_XC_B97M_V", XC_MGGA_XC_B97M_V}, /*Mardirossian and Head-Gordon */
1199#endif
1200#if defined(XC_MGGA_X_MVS)
1201 {"XC_MGGA_X_MVS", XC_MGGA_X_MVS}, /*MVS exchange of Sun, Perdew, and Ruzsinszky */
1202#endif
1203#if defined(XC_MGGA_X_MN15_L)
1204 {"XC_MGGA_X_MN15_L", XC_MGGA_X_MN15_L}, /* MN15-L exhange functional from Minnesota */
1205#endif
1206#if defined(XC_MGGA_C_MN15_L)
1207 {"XC_MGGA_C_MN15_L", XC_MGGA_C_MN15_L}, /* MN15-L correlation functional from Minnesota */
1208#endif
1209#if defined(XC_MGGA_X_SCAN)
1210 {"XC_MGGA_X_SCAN", XC_MGGA_X_SCAN}, /*SCAN exchange of Sun, Ruzsinszky, and Perdew */
1211#endif
1212#if defined(XC_MGGA_C_SCAN)
1213 {"XC_MGGA_C_SCAN", XC_MGGA_C_SCAN}, /*SCAN correlation */
1214#endif
1215#if defined(XC_MGGA_C_MN15)
1216 {"XC_MGGA_C_MN15", XC_MGGA_C_MN15}, /* MN15 correlation functional from Minnesota */
1217#endif
1218#if defined(XC_MGGA_X_B00)
1219 {"XC_MGGA_X_B00", XC_MGGA_X_B00}, /* Becke 2000 */
1220#endif
1221#if defined(XC_MGGA_XC_HLE17)
1222 {"XC_MGGA_XC_HLE17", XC_MGGA_XC_HLE17}, /*high local exchange 2017 */
1223#endif
1224#if defined(XC_MGGA_C_SCAN_RVV10)
1225 {"XC_MGGA_C_SCAN_RVV10", XC_MGGA_C_SCAN_RVV10}, /* SCAN correlation + rVV10 correlation */
1226#endif
1227#if defined(XC_MGGA_X_REVM06_L)
1228 {"XC_MGGA_X_REVM06_L", XC_MGGA_X_REVM06_L}, /* revised M06-L exchange functional from Minnesota */
1229#endif
1230#if defined(XC_MGGA_C_REVM06_L)
1231 {"XC_MGGA_C_REVM06_L", XC_MGGA_C_REVM06_L}, /* Revised M06-L correlation functional from Minnesota */
1232#endif
1233#if defined(XC_MGGA_X_TM)
1234 {"XC_MGGA_X_TM", XC_MGGA_X_TM}, /*Tao and Mo 2016 */
1235#endif
1236#if defined(XC_MGGA_X_VT84)
1237 {"XC_MGGA_X_VT84", XC_MGGA_X_VT84}, /*meta-GGA version of VT{8,4} GGA */
1238#endif
1239#if defined(XC_MGGA_X_SA_TPSS)
1240 {"XC_MGGA_X_SA_TPSS", XC_MGGA_X_SA_TPSS}, /*TPSS with correct surface asymptotics */
1241#endif
1242#if defined(XC_MGGA_K_PC07)
1243 {"XC_MGGA_K_PC07", XC_MGGA_K_PC07}, /*Perdew and Constantin 2007 */
1244#endif
1245#if defined(XC_MGGA_C_KCIS)
1246 {"XC_MGGA_C_KCIS", XC_MGGA_C_KCIS}, /*Krieger, Chen, Iafrate, and Savin */
1247#endif
1248#if defined(XC_MGGA_XC_LP90)
1249 {"XC_MGGA_XC_LP90", XC_MGGA_XC_LP90}, /*Lee & Parr, Eq. (56) */
1250#endif
1251#if defined(XC_MGGA_C_B88)
1252 {"XC_MGGA_C_B88", XC_MGGA_C_B88}, /*Meta-GGA correlation by Becke */
1253#endif
1254#if defined(XC_MGGA_X_GX)
1255 {"XC_MGGA_X_GX", XC_MGGA_X_GX}, /*GX functional of Loos */
1256#endif
1257#if defined(XC_MGGA_X_PBE_GX)
1258 {"XC_MGGA_X_PBE_GX", XC_MGGA_X_PBE_GX}, /*PBE-GX functional of Loos */
1259#endif
1260#if defined(XC_MGGA_X_REVSCAN)
1261 {"XC_MGGA_X_REVSCAN", XC_MGGA_X_REVSCAN}, /* revised SCAN */
1262#endif
1263#if defined(XC_MGGA_C_REVSCAN)
1264 {"XC_MGGA_C_REVSCAN", XC_MGGA_C_REVSCAN}, /*revised SCAN correlation */
1265#endif
1266#if defined(XC_MGGA_C_SCAN_VV10)
1267 {"XC_MGGA_C_SCAN_VV10", XC_MGGA_C_SCAN_VV10}, /* SCAN correlation + VV10 correlation */
1268#endif
1269#if defined(XC_MGGA_C_REVSCAN_VV10)
1270 {"XC_MGGA_C_REVSCAN_VV10", XC_MGGA_C_REVSCAN_VV10}, /* revised SCAN correlation */
1271#endif
1272#if defined(XC_MGGA_X_BR89_EXPLICIT)
1273 {"XC_MGGA_X_BR89_EXPLICIT", XC_MGGA_X_BR89_EXPLICIT}, /*Becke-Roussel 89 with an explicit inversion of x(y) */
1274#endif
1275#if defined(XC_HYB_MGGA_X_DLDF)
1276 {"XC_HYB_MGGA_X_DLDF", XC_HYB_MGGA_X_DLDF}, /*Dispersionless Density Functional */
1277#endif
1278#if defined(XC_HYB_MGGA_X_MS2H)
1279 {"XC_HYB_MGGA_X_MS2H", XC_HYB_MGGA_X_MS2H}, /*MS2 hybrid exchange of Sun, et al */
1280#endif
1281#if defined(XC_HYB_MGGA_X_MN12_SX)
1282 {"XC_HYB_MGGA_X_MN12_SX", XC_HYB_MGGA_X_MN12_SX}, /*MN12-SX hybrid exchange functional from Minnesota */
1283#endif
1284#if defined(XC_HYB_MGGA_X_SCAN0)
1285 {"XC_HYB_MGGA_X_SCAN0", XC_HYB_MGGA_X_SCAN0}, /*SCAN hybrid exchange */
1286#endif
1287#if defined(XC_HYB_MGGA_X_MN15)
1288 {"XC_HYB_MGGA_X_MN15", XC_HYB_MGGA_X_MN15}, /* MN15 hybrid exchange functional from Minnesota */
1289#endif
1290#if defined(XC_HYB_MGGA_X_BMK)
1291 {"XC_HYB_MGGA_X_BMK", XC_HYB_MGGA_X_BMK}, /*Boese-Martin for kinetics */
1292#endif
1293#if defined(XC_HYB_MGGA_X_TAU_HCTH)
1294 {"XC_HYB_MGGA_X_TAU_HCTH", XC_HYB_MGGA_X_TAU_HCTH}, /* Hybrid version of tau-HCTH */
1295#endif
1296#if defined(XC_HYB_MGGA_X_M08_HX)
1297 {"XC_HYB_MGGA_X_M08_HX", XC_HYB_MGGA_X_M08_HX}, /*M08-HX exchange functional from Minnesota */
1298#endif
1299#if defined(XC_HYB_MGGA_X_M08_SO)
1300 {"XC_HYB_MGGA_X_M08_SO", XC_HYB_MGGA_X_M08_SO}, /* M08-SO exchange functional from Minnesota */
1301#endif
1302#if defined(XC_HYB_MGGA_X_M11)
1303 {"XC_HYB_MGGA_X_M11", XC_HYB_MGGA_X_M11}, /*M11 hybrid exchange functional from Minnesota */
1304#endif
1305#if defined(XC_HYB_MGGA_X_M05)
1306 {"XC_HYB_MGGA_X_M05", XC_HYB_MGGA_X_M05}, /*M05 hybrid exchange functional from Minnesota */
1307#endif
1308#if defined(XC_HYB_MGGA_X_M05_2X)
1309 {"XC_HYB_MGGA_X_M05_2X", XC_HYB_MGGA_X_M05_2X}, /* M05-2X hybrid exchange functional from Minnesota */
1310#endif
1311#if defined(XC_HYB_MGGA_XC_B88B95)
1312 {"XC_HYB_MGGA_XC_B88B95", XC_HYB_MGGA_XC_B88B95}, /*Mixture of B88 with BC95 (B1B95) */
1313#endif
1314#if defined(XC_HYB_MGGA_XC_B86B95)
1315 {"XC_HYB_MGGA_XC_B86B95", XC_HYB_MGGA_XC_B86B95}, /* Mixture of B86 with BC95 */
1316#endif
1317#if defined(XC_HYB_MGGA_XC_PW86B95)
1318 {"XC_HYB_MGGA_XC_PW86B95", XC_HYB_MGGA_XC_PW86B95}, /* Mixture of PW86 with BC95 */
1319#endif
1320#if defined(XC_HYB_MGGA_XC_BB1K)
1321 {"XC_HYB_MGGA_XC_BB1K", XC_HYB_MGGA_XC_BB1K}, /* Mixture of B88 with BC95 from Zhao and Truhlar */
1322#endif
1323#if defined(XC_HYB_MGGA_X_M06_HF)
1324 {"XC_HYB_MGGA_X_M06_HF", XC_HYB_MGGA_X_M06_HF}, /*M06-HF hybrid exchange functional from Minnesota */
1325#endif
1326#if defined(XC_HYB_MGGA_XC_MPW1B95)
1327 {"XC_HYB_MGGA_XC_MPW1B95", XC_HYB_MGGA_XC_MPW1B95}, /* Mixture of mPW91 with BC95 from Zhao and Truhlar */
1328#endif
1329#if defined(XC_HYB_MGGA_XC_MPWB1K)
1330 {"XC_HYB_MGGA_XC_MPWB1K", XC_HYB_MGGA_XC_MPWB1K}, /* Mixture of mPW91 with BC95 for kinetics */
1331#endif
1332#if defined(XC_HYB_MGGA_XC_X1B95)
1333 {"XC_HYB_MGGA_XC_X1B95", XC_HYB_MGGA_XC_X1B95}, /* Mixture of X with BC95 */
1334#endif
1335#if defined(XC_HYB_MGGA_XC_XB1K)
1336 {"XC_HYB_MGGA_XC_XB1K", XC_HYB_MGGA_XC_XB1K}, /* Mixture of X with BC95 for kinetics */
1337#endif
1338#if defined(XC_HYB_MGGA_X_M06)
1339 {"XC_HYB_MGGA_X_M06", XC_HYB_MGGA_X_M06}, /* M06 hybrid exchange functional from Minnesota */
1340#endif
1341#if defined(XC_HYB_MGGA_X_M06_2X)
1342 {"XC_HYB_MGGA_X_M06_2X", XC_HYB_MGGA_X_M06_2X}, /* M06-2X hybrid exchange functional from Minnesota */
1343#endif
1344#if defined(XC_HYB_MGGA_XC_PW6B95)
1345 {"XC_HYB_MGGA_XC_PW6B95", XC_HYB_MGGA_XC_PW6B95}, /* Mixture of PW91 with BC95 from Zhao and Truhlar */
1346#endif
1347#if defined(XC_HYB_MGGA_XC_PWB6K)
1348 {"XC_HYB_MGGA_XC_PWB6K", XC_HYB_MGGA_XC_PWB6K}, /* Mixture of PW91 with BC95 from Zhao and Truhlar for kinetics */
1349#endif
1350#if defined(XC_HYB_MGGA_XC_TPSSH)
1351 {"XC_HYB_MGGA_XC_TPSSH", XC_HYB_MGGA_XC_TPSSH}, /*TPSS hybrid */
1352#endif
1353#if defined(XC_HYB_MGGA_XC_REVTPSSH)
1354 {"XC_HYB_MGGA_XC_REVTPSSH", XC_HYB_MGGA_XC_REVTPSSH}, /* revTPSS hybrid */
1355#endif
1356#if defined(XC_HYB_MGGA_X_MVSH)
1357 {"XC_HYB_MGGA_X_MVSH", XC_HYB_MGGA_X_MVSH}, /*MVSh hybrid */
1358#endif
1359#if defined(XC_HYB_MGGA_XC_WB97M_V)
1360 {"XC_HYB_MGGA_XC_WB97M_V", XC_HYB_MGGA_XC_WB97M_V}, /*Mardirossian and Head-Gordon */
1361#endif
1362#if defined(XC_HYB_MGGA_XC_B0KCIS)
1363 {"XC_HYB_MGGA_XC_B0KCIS", XC_HYB_MGGA_XC_B0KCIS}, /*Hybrid based on KCIS */
1364#endif
1365#if defined(XC_HYB_MGGA_XC_MPW1KCIS)
1366 {"XC_HYB_MGGA_XC_MPW1KCIS", XC_HYB_MGGA_XC_MPW1KCIS}, /*Modified Perdew-Wang + KCIS hybrid */
1367#endif
1368#if defined(XC_HYB_MGGA_XC_MPWKCIS1K)
1369 {"XC_HYB_MGGA_XC_MPWKCIS1K",
1370 XC_HYB_MGGA_XC_MPWKCIS1K}, /* Modified Perdew-Wang + KCIS hybrid with more exact exchange */
1371#endif
1372#if defined(XC_HYB_MGGA_XC_PBE1KCIS)
1373 {"XC_HYB_MGGA_XC_PBE1KCIS", XC_HYB_MGGA_XC_PBE1KCIS}, /* Perdew-Burke-Ernzerhof + KCIS hybrid */
1374#endif
1375#if defined(XC_HYB_MGGA_XC_TPSS1KCIS)
1376 {"XC_HYB_MGGA_XC_TPSS1KCIS", XC_HYB_MGGA_XC_TPSS1KCIS}, /* TPSS hybrid with KCIS correlation */
1377#endif
1378#if defined(XC_HYB_MGGA_X_REVSCAN0)
1379 {"XC_HYB_MGGA_X_REVSCAN0", XC_HYB_MGGA_X_REVSCAN0}, /* revised SCAN hybrid exchange */
1380#endif
1381#if defined(XC_HYB_MGGA_XC_B98)
1382 {"XC_HYB_MGGA_XC_B98", XC_HYB_MGGA_XC_B98} /*Becke 98 */
1383#endif
1384};
1385
1386/// Interface class to Libxc.
1388{
1389 protected:
1390 std::string libxc_name_;
1391
1392 int num_spins_;
1393
1394 std::unique_ptr<xc_func_type> handler_{nullptr};
1395
1396 bool libxc_initialized_{false};
1397
1398 private:
1399 /* forbid copy constructor */
1400 XC_functional_base(const XC_functional_base& src) = delete;
1401
1402 /* forbid assignment operator */
1403 XC_functional_base& operator=(const XC_functional_base& src) = delete;
1404
1405 public:
1406 XC_functional_base(const std::string libxc_name__, int num_spins__)
1407 : libxc_name_(libxc_name__)
1408 , num_spins_(num_spins__)
1409 {
1410 /* check if functional name is in list */
1411 if (libxc_functionals.count(libxc_name_) == 0 && libxc_name_ != "XC_GGA_DEBUG" &&
1412 libxc_name_ != "XC_LDA_DEBUG") {
1413 /* if not just return since van der walls functionals can be
1414 * used */
1415 libxc_initialized_ = false;
1416 return;
1417 }
1418
1419 auto ns = (num_spins__ == 1) ? XC_UNPOLARIZED : XC_POLARIZED;
1420
1421 if (libxc_name_ != "XC_GGA_DEBUG" && libxc_name_ != "XC_LDA_DEBUG") {
1422 handler_ = std::unique_ptr<xc_func_type>(new xc_func_type);
1423
1424 /* init xc functional handler */
1425 if (xc_func_init(handler_.get(), libxc_functionals.at(libxc_name_), ns) != 0) {
1426 RTE_THROW("xc_func_init() failed");
1427 }
1428 }
1429
1430 libxc_initialized_ = true;
1431 }
1432
1434 {
1435 this->libxc_name_ = src__.libxc_name_;
1436 this->num_spins_ = src__.num_spins_;
1437 this->handler_ = std::move(src__.handler_);
1438 this->libxc_initialized_ = src__.libxc_initialized_;
1439 src__.libxc_initialized_ = false;
1440 }
1441
1443 {
1444 if (handler_) {
1445 xc_func_end(handler_.get());
1446 }
1447 }
1448
1449 const std::string name() const
1450 {
1451 if (handler_) {
1452 return std::string(handler_->info->name);
1453 } else {
1454 return libxc_name_;
1455 }
1456 }
1457
1458 const std::string refs() const
1459 {
1460 if (handler_) {
1461 std::stringstream s;
1462 for (int i = 0; handler_->info->refs[i] != NULL; i++) {
1463 s << std::string(handler_->info->refs[i]->ref);
1464 if (strlen(handler_->info->refs[i]->doi) > 0) {
1465 s << " (" << std::string(handler_->info->refs[i]->doi) << ")";
1466 }
1467 s << std::endl;
1468 }
1469 return s.str();
1470 } else {
1471 return "";
1472 }
1473 }
1474
1475 int family() const
1476 {
1477 if (handler_) {
1478 return handler_->info->family;
1479 } else {
1480 if (libxc_name_ == "XC_GGA_DEBUG") {
1481 return XC_FAMILY_GGA;
1482 } else {
1483 return XC_FAMILY_LDA;
1484 }
1485 }
1486 }
1487
1488 xc_func_type* handler()
1489 {
1490 if(handler_) {
1491 return handler_.get();
1492 }
1493
1494 throw std::runtime_error("attempt to access nullptr in xc_functional_base::handler");
1495 }
1496
1497 bool is_lda() const
1498 {
1499 return family() == XC_FAMILY_LDA;
1500 }
1501
1502 bool is_gga() const
1503 {
1504 return family() == XC_FAMILY_GGA;
1505 }
1506
1507 int kind() const
1508 {
1509 if (handler_) {
1510 return handler_->info->kind;
1511 } else {
1512 return XC_EXCHANGE_CORRELATION;
1513 }
1514 }
1515
1516 bool is_exchange() const
1517 {
1518 return kind() == XC_EXCHANGE;
1519 }
1520
1521 bool is_correlation() const
1522 {
1523 return kind() == XC_CORRELATION;
1524 }
1525
1526 bool is_exchange_correlation() const
1527 {
1528 return kind() == XC_EXCHANGE_CORRELATION;
1529 }
1530
1531 /// Get LDA contribution.
1532 void get_lda(const int size, const double* rho, double* v, double* e) const
1533 {
1534 if (family() != XC_FAMILY_LDA) {
1535 RTE_THROW("wrong XC");
1536 }
1537
1538 /* check density */
1539 for (int i = 0; i < size; i++) {
1540 if (rho[i] < 0) {
1541 std::stringstream s;
1542 s << "rho is negative : " << double_to_string(rho[i]);
1543 RTE_THROW(s);
1544 }
1545 }
1546
1547 if (handler_) {
1548 xc_lda_exc_vxc(handler_.get(), size, rho, e, v);
1549 } else {
1550 for (int i = 0; i < size; i++) {
1551 /* E = \int e * rho * dr */
1552 e[i] = -0.001 * (rho[i] * rho[i]);
1553 /* var E / var rho = (de/drho) rho + e */
1554 v[i] = -0.002 * rho[i] * rho[i] + e[i];
1555 }
1556 }
1557 }
1558
1559 /// Get LSDA contribution.
1560 void get_lda(const int size, const double* rho_up, const double* rho_dn, double* v_up, double* v_dn, double* e) const
1561 {
1562 if (family() != XC_FAMILY_LDA) {
1563 RTE_THROW("wrong XC");
1564 }
1565
1566 std::vector<double> rho_ud(size * 2);
1567 /* check and rearrange density */
1568 for (int i = 0; i < size; i++) {
1569 if (rho_up[i] < 0 || rho_dn[i] < 0) {
1570 std::stringstream s;
1571 s << "rho is negative : " << double_to_string(rho_up[i]) << " "
1572 << double_to_string(rho_dn[i]);
1573 RTE_THROW(s);
1574 }
1575
1576 rho_ud[2 * i] = rho_up[i];
1577 rho_ud[2 * i + 1] = rho_dn[i];
1578 }
1579
1580 if (handler_) {
1581 std::vector<double> v_ud(size * 2);
1582
1583 xc_lda_exc_vxc(handler_.get(), size, &rho_ud[0], &e[0], &v_ud[0]);
1584
1585 /* extract potential */
1586 for (int i = 0; i < size; i++) {
1587 v_up[i] = v_ud[2 * i];
1588 v_dn[i] = v_ud[2 * i + 1];
1589 }
1590 } else {
1591 for (int i = 0; i < size; i++) {
1592 e[i] = -0.001 * (rho_up[i] * rho_up[i] + rho_dn[i] * rho_dn[i]);
1593 v_up[i] = -0.002 * rho_up[i] * (rho_up[i] + rho_dn[i]) + e[i];
1594 v_dn[i] = -0.002 * rho_dn[i] * (rho_up[i] + rho_dn[i]) + e[i];
1595 }
1596 }
1597 }
1598
1599 /// Get GGA contribution.
1600 void get_gga(const int size, const double* rho, const double* sigma, double* vrho, double* vsigma, double* e) const
1601 {
1602 if (family() != XC_FAMILY_GGA)
1603 RTE_THROW("wrong XC");
1604
1605 /* check density */
1606 for (int i = 0; i < size; i++) {
1607 if (rho[i] < 0.0) {
1608 std::stringstream s;
1609 s << "rho is negative : " << double_to_string(rho[i]);
1610 RTE_THROW(s);
1611 }
1612 }
1613
1614 if (handler_) {
1615 xc_gga_exc_vxc(handler_.get(), size, rho, sigma, e, vrho, vsigma);
1616 } else {
1617 for (int i = 0; i < size; i++) {
1618 e[i] = -0.001 * (rho[i] * sigma[i]);
1619 vrho[i] = -0.001 * sigma[i];
1620 vsigma[i] = -0.001 * rho[i];
1621 }
1622 }
1623 }
1624
1625 /// Get spin-resolved GGA contribution.
1626 void get_gga(const int size, const double* rho_up, const double* rho_dn, const double* sigma_uu,
1627 const double* sigma_ud, const double* sigma_dd, double* vrho_up, double* vrho_dn, double* vsigma_uu,
1628 double* vsigma_ud, double* vsigma_dd, double* e) const
1629 {
1630 if (family() != XC_FAMILY_GGA) {
1631 RTE_THROW("wrong XC");
1632 }
1633
1634 std::vector<double> rho(2 * size);
1635 std::vector<double> sigma(3 * size);
1636 /* check and rearrange density */
1637 /* rearrange sigma as well */
1638 for (int i = 0; i < size; i++) {
1639 if (rho_up[i] < 0 || rho_dn[i] < 0) {
1640 std::stringstream s;
1641 s << "rho is negative : " << double_to_string(rho_up[i]) << " "
1642 << double_to_string(rho_dn[i]);
1643 RTE_THROW(s);
1644 }
1645
1646 rho[2 * i] = rho_up[i];
1647 rho[2 * i + 1] = rho_dn[i];
1648
1649 sigma[3 * i] = sigma_uu[i];
1650 sigma[3 * i + 1] = sigma_ud[i];
1651 sigma[3 * i + 2] = sigma_dd[i];
1652 }
1653
1654 std::vector<double> vrho(2 * size);
1655 std::vector<double> vsigma(3 * size);
1656
1657 if (handler_) {
1658 xc_gga_exc_vxc(handler_.get(), size, &rho[0], &sigma[0], e, &vrho[0], &vsigma[0]);
1659
1660 /* extract vrho and vsigma */
1661 for (int i = 0; i < size; i++) {
1662 vrho_up[i] = vrho[2 * i];
1663 vrho_dn[i] = vrho[2 * i + 1];
1664
1665 vsigma_uu[i] = vsigma[3 * i];
1666 vsigma_ud[i] = vsigma[3 * i + 1];
1667 vsigma_dd[i] = vsigma[3 * i + 2];
1668 }
1669 } else {
1670 auto h1 = std::unique_ptr<xc_func_type>(new xc_func_type);
1671
1672 /* init xc functional handler */
1673 if (xc_func_init(h1.get(), XC_LDA_C_PZ, 2) != 0) {
1674 RTE_THROW("xc_func_init() failed");
1675 }
1676
1677 xc_lda_exc_vxc(h1.get(), size, &rho[0], e, &vrho[0]);
1678 /* extract vrho and vsigma */
1679 for (int i = 0; i < size; i++) {
1680 vrho_up[i] = vrho[2 * i];
1681 vrho_dn[i] = vrho[2 * i + 1];
1682
1683 vsigma_uu[i] = 0;
1684 vsigma_ud[i] = 0;
1685 vsigma_dd[i] = 0;
1686 }
1687
1688 for (int i = 0; i < size; i++) {
1689 e[i] += 0.001 * (sigma_uu[i] + sigma_ud[i] + sigma_dd[i]);
1690 vsigma_uu[i] = -0.001;
1691 vsigma_ud[i] = -0.001;
1692 vsigma_dd[i] = -0.001;
1693 }
1694 }
1695 }
1696
1697
1698 /// set density threshold of libxc, if density is below tre, all xc output will be set to 0.
1699 void set_dens_threshold(double tre)
1700 {
1701#if XC_MAJOR_VERSION >= 4
1702 xc_func_set_dens_threshold(this->handler(), tre);
1703#else
1704 std::cout << "set_dens_threshold not available in old libxc versions, install at least 4.2.3" << "\n";
1705#endif
1706 }
1707};
1708} // namespace sirius
1709#endif // __XC_FUNCTIONAL_BASE_H__
Interface class to Libxc.
void get_gga(const int size, const double *rho_up, const double *rho_dn, const double *sigma_uu, const double *sigma_ud, const double *sigma_dd, double *vrho_up, double *vrho_dn, double *vsigma_uu, double *vsigma_ud, double *vsigma_dd, double *e) const
Get spin-resolved GGA contribution.
void get_lda(const int size, const double *rho, double *v, double *e) const
Get LDA contribution.
void get_lda(const int size, const double *rho_up, const double *rho_dn, double *v_up, double *v_dn, double *e) const
Get LSDA contribution.
void get_gga(const int size, const double *rho, const double *sigma, double *vrho, double *vsigma, double *e) const
Get GGA contribution.
void set_dens_threshold(double tre)
set density threshold of libxc, if density is below tre, all xc output will be set to 0.
Namespace of the SIRIUS library.
Definition: sirius.f90:5
std::string double_to_string(double val, int precision=-1)
Convert double to a string with a given precision.
Output stream tools.
Eror and warning handling during run-time execution.