Localized Orbital Scaling Correction (LOSC) C library
correction.h File Reference

The C interface for LOSC corrections. More...

#include <c_losc/matrix.h>
#include <stddef.h>

Go to the source code of this file.

Functions

losc_matrix * losc_ao_hamiltonian_correction (const losc_matrix *S, const losc_matrix *C_lo, const losc_matrix *Curvature, const losc_matrix *LocalOcc)
 Calculate LOSC effective Hamiltonian under AO basis. More...
 
double energy_correction (const losc_matrix *Curvature, const losc_matrix *LocalOcc)
 Calculate the total energy correction from LOSC. More...
 
double * orbital_energy_post_scf (const losc_matrix *H_dfa, const losc_matrix *H_losc, const losc_matrix *C_co)
 Calculate corrected orbital energy from LOSC in a post-SCF approach. More...
 

Detailed Description

The C interface for LOSC corrections.

Function Documentation

double energy_correction ( const losc_matrix *  Curvature,
const losc_matrix *  LocalOcc 
)

Calculate the total energy correction from LOSC.

This is just the energy correction from LOSC, NOT the total energy of LOSC-DFA. Total energy of LOSC-DFA is: E_losc_dfa = E_dfa + E_losc.

Parameters
[in]CurvatureLOSC curvature matrix with dimension of [nlo, nlo].
[in]LocalOccLocal occupation matrix with dimension of [nlo, nlo].
Returns
The total energy correction from LOSC.
See also
LoscCurvatureBase.kappa: obtain the LOSC curvature matrix.
losc_local_occupation(): obtain the LOSC local occupation matrix.
losc_matrix* losc_ao_hamiltonian_correction ( const losc_matrix *  S,
const losc_matrix *  C_lo,
const losc_matrix *  Curvature,
const losc_matrix *  LocalOcc 
)

Calculate LOSC effective Hamiltonian under AO basis.

The LOSC effective Hamiltonian is constructed with LOs fixed. The expression of the effective Hamiltonian is shown as Eq. S25 in the supporting information of the original LOSC paper (https://doi.org/10.1093/nsr/nwx111). This effective Hamiltonian is exact in the developed version of SCF-LOSC (self-consistent LOSC). See reference (J. Phys. Chem. Lett. 2020, 11, 23, 10269-10277) for more details about how to perform reliable SCF-LOSC calculations.

Parameters
[in]SAO overlap matrix with dimension [nbasis, nbasis].
[in]C_loLOs coefficient matrix under AOs with dimension of [nbasis, nlo]. The i-th column in C_lo matrix is the i-th LO.
[in]CurvatureLOSC curvature matrix with dimension of [nlo, nlo].
[in]LocalOccLocal occupation matrix with dimension of [nlo, nlo].
Returns
Create a LOSC effective Hamiltonian matrix with dimension [nbasis, nbasis] and return the matrix pointer.
See also
LoscCurvatureBase.kappa: Obtain the curvature matrix.
losc_local_occupation(): Obtain the local occupation matrix.
Note
Make sure all the input matrices are corrresponding to the same spin.
double* orbital_energy_post_scf ( const losc_matrix *  H_dfa,
const losc_matrix *  H_losc,
const losc_matrix *  C_co 
)

Calculate corrected orbital energy from LOSC in a post-SCF approach.

This function gives the final orbital energies WITH the correction from LOSC. Note the difference to the function energy_correction() that only calculates the energy correction. The corrected orbital energies are the expectation values of converged DFA's COs on the LOSC-DFA Hamiltonian, that is,

\[ \epsilon_i = \langle \psi_i | H_{\rm{dfa}} + H_{\rm{losc}} | \psi_i \rangle. \]

Parameters
[in]H_dfaThe DFA Hamiltonian under AOs with dimension of [nbasis, nbasis].
[in]H_loscThe LOSC effective Hamiltonian under AOs with dimension of [nbasis, nbasis].
[in]C_coThe coefficient matrix of converged DFA COs under AOs with dimension of [nbasis, n] (n <= nbasis, which is the number of COs). You can choose whatever number of COs you want.
Returns
Create an array of the corrected orbital energies from LOSC with size of n and return the pointer. The order of orbital energies match the order of input COs (order of columns in C_co matrix).
See also
losc_ao_hamiltonian_correction(): obtain the LOSC effective Hamiltonian under AOs.
Note
This function only calculates the orbital energies for the single spin associated with the input matrices.
This function is just one of the ways to construct the LOSC corrected orbital energies in the post-SCF LOSC calculations. It is the way we used to produce results in the published paper for the post-SCF LOSC calculations. Besides this way, there are another two ways to calculate corrected orbital energies: (1) diagonalize the corrected LOSC-DFA Hamiltonian; (2) follow Eq. 11 of the original paper of LOSC to calculate the corrections to orbital energies. These three ways usually produce very similar results.