Localized Orbital Scaling Correction (LOSC) C library
|
The C interface for LOSC curvature matrix. More...
Go to the source code of this file.
Classes | |
struct | LoscCurvatureBase |
The C interface for LOSC curvature base class. More... | |
struct | LoscCurvatureV1 |
The C interface for LOSC curvature class of version 1. More... | |
struct | LoscCurvatureV2 |
The C interface for LOSC curvature class of version 2. More... | |
Macros | |
#define | losc_dfa_info_free(ptr) _losc_DFAInfo_free(&(ptr)) |
Free a LoscDFAInfo struct. More... | |
#define | losc_curvature_v1_free(ptr) _losc_curvature_v1_free(&(ptr)) |
Free a struct LoscCurvatureV1. More... | |
#define | losc_curvature_v2_free(ptr) _losc_curvature_v2_free(&(ptr)) |
Free a struct LoscCurvatureV2. More... | |
Typedefs | |
typedef struct LoscDFAInfo | LoscDFAInfo |
The DFA information. More... | |
typedef struct LoscCurvatureBase | LoscCurvatureBase |
The C interface for LOSC curvature base class. More... | |
typedef struct LoscCurvatureV1 | LoscCurvatureV1 |
The C interface for LOSC curvature class of version 1. More... | |
typedef struct LoscCurvatureV2 | LoscCurvatureV2 |
The C interface for LOSC curvature class of version 2. More... | |
Functions | |
LoscDFAInfo * | losc_dfa_info_create (double gga_x, double hf_x, const char *name) |
Create a struct LoscDFAInfo. More... | |
LoscCurvatureV1 * | losc_curvature_v1_create (const LoscDFAInfo *dfa, const losc_matrix *df_pii, const losc_matrix *df_Vpq_inv, const losc_matrix *grid_lo, const double *grid_weight) |
Create a struct LoscCurvatureV1. More... | |
LoscCurvatureV2 * | losc_curvature_v2_create (const LoscDFAInfo *dfa, const losc_matrix *df_pii, const losc_matrix *df_Vpq_inv, const losc_matrix *grid_lo, const double *grid_weight) |
Constructor of LoscCurvatureV2. More... | |
The C interface for LOSC curvature matrix.
#define losc_curvature_v1_free | ( | ptr | ) | _losc_curvature_v1_free(&(ptr)) |
Free a struct LoscCurvatureV1.
[in,out] | ptr | a pointer with type LoscCurvatureV1 * . At exit, ptr is set to null. |
#define losc_curvature_v2_free | ( | ptr | ) | _losc_curvature_v2_free(&(ptr)) |
Free a struct LoscCurvatureV2.
[in,out] | ptr | a pointer with type LoscCurvatureV1 * . At exit, ptr is set to null. |
#define losc_dfa_info_free | ( | ptr | ) | _losc_DFAInfo_free(&(ptr)) |
Free a LoscDFAInfo struct.
[in,out] | ptr | a pointer with type LoscDFAInfo * . At exit, ptr is set to null. |
typedef struct LoscCurvatureBase LoscCurvatureBase |
The C interface for LOSC curvature base class.
typedef struct LoscCurvatureV1 LoscCurvatureV1 |
The C interface for LOSC curvature class of version 1.
Curvature version 1 is defined as \( \kappa \) in Eq. 3 in the original LOSC paper (https://doi.org/10.1093/nsr/nwx11).
typedef struct LoscCurvatureV2 LoscCurvatureV2 |
The C interface for LOSC curvature class of version 2.
The curvature matrix is defined as \(\tilde{\kappa}\) in Eq. 8 of the LOSC2 paper (J. Phys. Chem. Lett. 2020, 11, 4, 1528-1535).
typedef struct LoscDFAInfo LoscDFAInfo |
The DFA information.
LoscCurvatureV1* losc_curvature_v1_create | ( | const LoscDFAInfo * | dfa, |
const losc_matrix * | df_pii, | ||
const losc_matrix * | df_Vpq_inv, | ||
const losc_matrix * | grid_lo, | ||
const double * | grid_weight | ||
) |
Create a struct LoscCurvatureV1.
[in] | dfa | Type of DFA. |
[in] | df_pii | Three-body integral \( \langle p |ii \rangle \) used in density fitting. Index p is for fitbasis and index i is for LOs. The dimension of df_pii is [nfitbasis, nlo] . |
[in] | df_Vpq_inv | Inverse of \( \langle p | 1/\mathbf{r} | q \rangle \) matrix used in density fitting. Index p and q are for LOs. The dimension of df_Vpq_inv is [nfitbasis, nfitbasis] . |
[in] | grid_lo | LOs' value on grid points with dimension of [npts, nlo] . |
[in] | grid_weight | Coefficient vector for numerical integral on grid with size of npts . |
grid_lo
matrix can be very large. LoscCurvatureV2* losc_curvature_v2_create | ( | const LoscDFAInfo * | dfa, |
const losc_matrix * | df_pii, | ||
const losc_matrix * | df_Vpq_inv, | ||
const losc_matrix * | grid_lo, | ||
const double * | grid_weight | ||
) |
Constructor of LoscCurvatureV2.
[in] | dfa | Type of DFA. |
[in] | df_pii | Three-body integral \( \langle p |ii \rangle \) used in density fitting. Index p is for fitbasis and index i is for LOs. The dimension of df_pii is [nfitbasis, nlo] . |
[in] | df_Vpq_inv | Inverse of \( \langle p | 1/\mathbf{r} | q \rangle \) matrix used in density fitting. Index p and q are for LOs. The dimension of df_Vpq_inv is [nfitbasis, nfitbasis] . |
[in] | grid_lo | LOs' value on grid points with dimension of [npts, nlo] . |
[in] | grid_weight | Coefficient vector for numerical integral on grid with size of npts . |
grid_lo
matrix can be very large. LoscDFAInfo* losc_dfa_info_create | ( | double | gga_x, |
double | hf_x, | ||
const char * | name | ||
) |
Create a struct LoscDFAInfo.
[in] | gga_x | The total weights of all GGA and LDA type exchanges. |
[in] | hf_x | The total weights of HF exchanges. |
[in] | name | The name of the DFA. Default to an empty string. |
\[ E^{\rm{B3LYP}}_{\rm{xc}} = E^{\rm{LDA}}_{\rm{x}} + a_0 (E^{\rm{HF}}_{\rm{x}} - E^{\rm{LDA}}_{\rm{x}}) + a_x (E^{\rm{GGA}}_{\rm{x}} - E^{\rm{LDA}}_{\rm{x}}) + E^{\rm{LDA}}_{\rm{c}} + a_c (E^{\rm{GGA}}_{\rm{c}} - E^{\rm{LDA}}_{\rm{c}}), \]
in which exchanges end with suffix_x
and correlations end with suffix _c
, \( a_0=0.20 \), \( a_x=0.72 \) and \( a_c=0.81 \). Only the exchanges are considered and the correlations are ignored. The GGA and LDA exchanges are viewed as the same type. Therefore, the total weights of GGA and LDA exchanges are \( 1 - a_0 + a_x \times (1 - 1) = 1 - a_0 = 0.80 \), and the total weights of HF exchanges is \( a_0 = 0.20 \). To construct a DFAInfo
object for B3LYP functional, one should do the following