\documentclass[aip,jcp,reprint,noshowkeys]{revtex4-1}
\usepackage{graphicx,dcolumn,bm,xcolor,microtype,multirow,amscd,amsmath,amssymb,amsfonts,physics,mhchem,longtable,xspace}
\usepackage{mathpazo,libertine}

\usepackage{natbib}
\bibliographystyle{achemso}
\AtBeginDocument{\nocite{achemso-control}}

\newcommand{\alert}[1]{\textcolor{red}{#1}}
\definecolor{darkgreen}{HTML}{009900}
\usepackage[normalem]{ulem}
\newcommand{\titou}[1]{\textcolor{red}{#1}}
\newcommand{\juju}[1]{\textcolor{purple}{#1}}
\newcommand{\manu}[1]{\textcolor{darkgreen}{#1}}
\newcommand{\trashPFL}[1]{\textcolor{red}{\sout{#1}}}
\newcommand{\trashJL}[1]{\textcolor{purple}{\sout{#1}}}
\newcommand{\trashMG}[1]{\textcolor{darkgreen}{\sout{#1}}}
\newcommand{\MG}[1]{\manu{(\underline{\bf MG}: #1)}}
\newcommand{\JL}[1]{\juju{(\underline{\bf JL}: #1)}}
\newcommand{\PFL}[1]{\titou{(\underline{\bf PFL}: #1)}}

\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=blue,
    filecolor=blue,      
    urlcolor=blue,
    citecolor=blue
}
\newcommand{\cdash}{\multicolumn{1}{c}{---}}
\newcommand{\mc}{\multicolumn}
\newcommand{\fnm}{\footnotemark}
\newcommand{\fnt}{\footnotetext}
\newcommand{\tabc}[1]{\multicolumn{1}{c}{#1}}
\newcommand{\mr}{\multirow}
\newcommand{\SI}{\textcolor{blue}{supporting information}}

% second quantized operators
%\newcommand{\psix}[1]{\hat{\Psi}\left({\bf X}_{#1}\right)}
%\newcommand{\psixc}[1]{\hat{\Psi}^{\dagger}\left({\bf X}_{#1}\right)}
\newcommand{\ai}[1]{\hat{a}_{#1}}
\newcommand{\aic}[1]{\hat{a}^{\dagger}_{#1}}
\newcommand{\vpqrs}[0]{V_{pq}^{rs}}
\newcommand{\phix}[2]{\phi_{#1}(\bfr{#2})}
\newcommand{\phixprim}[2]{\phi_{#1}(\bfr{#2}')}


%operators 
\newcommand{\elemm}[3]{{\ensuremath{\bra{#1}{#2}\ket{#3}}\xspace}}
\newcommand{\ovrlp}[2]{{\ensuremath{\langle #1|#2\rangle}\xspace}}

%\newcommand{\ket}[1]{{\ensuremath{|#1\rangle}\xspace}}
%\newcommand{\bra}[1]{{\ensuremath{\langle #1|}\xspace}}

% 


% numbers
\newcommand{\bfr}[1]{{\bf x}_{#1}}
\newcommand{\wbasisval}[0]{W_{\wf{}{\Bas}}^{\text{val}}(\bfr{1},\bfr{2})}


% densities 
\newcommand{\onedmval}[0]{\rho_{ij,\sigma}^{\text{val}}}

% units
\newcommand{\IneV}[1]{#1 eV}
\newcommand{\InAU}[1]{#1 a.u.}
\newcommand{\InAA}[1]{#1 \AA}
\newcommand{\kcal}{kcal.mol$^{-1}$}


% methods
\newcommand{\D}{\text{D}}
\newcommand{\T}{\text{T}}
\newcommand{\Q}{\text{Q}}
\newcommand{\X}{\text{X}}
\newcommand{\UEG}{\text{UEG}}
\newcommand{\LDA}{\text{LDA}}
\newcommand{\PBE}{\text{PBE}}
\newcommand{\FCI}{\text{FCI}}
\newcommand{\CCSDT}{\text{CCSD(T)}}
\newcommand{\lr}{\text{lr}}
\newcommand{\sr}{\text{sr}}

\newcommand{\Nel}{N}


\newcommand{\n}[2]{n_{#1}^{#2}}
\newcommand{\Ec}{E_\text{c}}
\newcommand{\E}[2]{E_{#1}^{#2}}
\newcommand{\bE}[2]{\Bar{E}_{#1}^{#2}}
\newcommand{\bEc}[1]{\Bar{E}_\text{c}^{#1}}
\newcommand{\e}[2]{\varepsilon_{#1}^{#2}}
\newcommand{\be}[2]{\Bar{\varepsilon}_{#1}^{#2}}
\newcommand{\bec}[1]{\Bar{e}^{#1}}
\newcommand{\wf}[2]{\Psi_{#1}^{#2}}
\newcommand{\W}[2]{W_{#1}^{#2}}
\newcommand{\w}[2]{w_{#1}^{#2}}
\newcommand{\hn}[2]{\Hat{n}_{#1}^{#2}}
\newcommand{\rsmu}[2]{\mu_{#1}^{#2}}
\newcommand{\SO}[2]{\phi_{#1}(\bx{#2})}

\newcommand{\modX}{\text{X}}
\newcommand{\modY}{\text{Y}}

% basis sets 
\newcommand{\Bas}{\mathcal{B}}
\newcommand{\Basval}{\mathcal{B}_\text{val}}
\newcommand{\Val}{\mathcal{V}}
\newcommand{\Cor}{\mathcal{C}}

% operators
\newcommand{\hT}{\Hat{T}}
\newcommand{\hWee}[1]{\Hat{W}_\text{ee}^{#1}}
\newcommand{\f}[2]{f_{#1}^{#2}}
\newcommand{\Gam}[2]{\Gamma_{#1}^{#2}}

% coordinates
\newcommand{\br}[1]{\mathbf{r}_{#1}}
\newcommand{\bx}[1]{\mathbf{x}_{#1}}
\newcommand{\dbr}[1]{d\br{#1}}
\newcommand{\dbx}[1]{d\bx{#1}}

\newcommand{\ra}{\rightarrow}
\newcommand{\De}{D_\text{e}}

\newcommand{\LCPQ}{Laboratoire de Chimie et Physique Quantiques (UMR 5626), Universit\'e de Toulouse, CNRS, UPS, France}
\newcommand{\LCT}{Laboratoire de Chimie Th\'eorique, Universit\'e Pierre et Marie Curie, Sorbonne Universit\'e, CNRS, Paris, France}

\begin{document}	

\title{A Density-Based Basis Set Correction For Wave Function Theory}

\author{Bath\'elemy Pradines}
\affiliation{\LCPQ}
\author{Anthony Scemama}
\affiliation{\LCPQ}
\author{Julien Toulouse}
\affiliation{\LCT}
\author{Pierre-Fran\c{c}ois Loos}
\email[Corresponding author: ]{loos@irsamc.ups-tlse.fr}
\affiliation{\LCPQ}
\author{Emmanuel Giner}
\affiliation{\LCT}

\begin{abstract}
We report a universal density-based basis set incompleteness correction that can be applied to any wave function theory method.
\end{abstract}

\maketitle

%%%%%%%%%%%%%%%%%%%%%%%%
\section{Introduction}
%%%%%%%%%%%%%%%%%%%%%%%%
Contemporary quantum chemistry has developed in two directions --- wave function theory (WFT) \cite{Pop-RMP-99} and density-functional theory (DFT). \cite{Koh-RMP-99}
Although both spring from the same Schr\"odinger equation, each of these philosophies has its own advantages and shortcomings.

WFT is attractive as it exists a well-defined path for systematic improvement.
For example, the coupled cluster (CC) family of methods offers a powerful WFT approach for the description of weakly correlated systems and is well regarded as the gold standard of quantum chemistry. 
By increasing the excitation degree of the CC expansion, one can systematically converge, for a given basis set, to the exact, full configuration interaction (FCI) limit, although the computational cost associated with such improvement is usually pricey.
One of the most fundamental drawback of conventional WFT methods is the slow convergence of energies and properties with respect to the size of the one-electron basis set.
This undesirable feature was put into light by Kutzelnigg more than thirty years ago, \cite{Kut-TCA-85}
who proposed, to palliate this, to introduce explicitly the interelectronic distance $r_{12} = \abs{\br{1} - \br{2}}$ as a basis function. \cite{Kut-TCA-85, KutKlo-JCP-91, TerKloKut-JCP-91, KloKut-JCP-91, KloRohKut-CPL-91, NogKut-JCP-94}
The resulting F12 methods yields a prominent improvement of the energy convergence, and achieve chemical accuracy for small organic molecules with relatively small Gaussian basis sets. \cite{Ten-TCA-12, TenNog-WIREs-12, HatKloKohTew-CR-12, KonBisVal-CR-12}
For example, at the CCSD(T) level, it is advertised that one can obtain quintuple-zeta quality correlation energies with a triple-zeta basis, \cite{TewKloNeiHat-PCCP-07} although computational overheads are introduced by the large auxiliary basis used to resolve three- and four-electron integrals.

Present-day DFT calculations are almost exclusively done within the so-called Kohn-Sham (KS) formalism, which corresponds to an exact dressed one-electron theory. \cite{KohSha-PR-65}
DFT's attractivity originates from its very favorable cost/efficient ratio as it can provide accurate energies and properties at a relatively low computational cost.
Thanks to this, KS-DFT \cite{HohKoh-PR-64, KohSha-PR-65} has become the workhorse of electronic structure calculations for atoms, molecules and solids. \cite{ParYan-BOOK-89}
To obtain accurate results within DFT, one only requires an exchange and correlation functionals, which can be classified in various families depending on their physical input quantities. \cite{Bec-JCP-14}
Although there is no clear way on how to systematically improve density-functional approximations (DFAs), climbing the Jacob's ladder of DFT is potentially the most satisfactory way forward (or upward in that case). \cite{PerSch-AIPCP-01, PerRuzTaoStaScuCso-JCP-05}
%The local-density approximation (LDA) sits on the first rung of the Jacob's ladder and only uses as input the electron density $n$. \cite{Dir-PCPRS-30, VosWilNus-CJP-80}
%The generalized-gradient approximation (GGA) corresponds to the second rung and adds the gradient of the electron density $\nabla n$ as an extra ingredient.\cite{Bec-PRA-88, PerWan-PRA-91, PerBurErn-PRL-96}
In the present context, one of the interesting feature of density-based methods is their much faster convergence with respect to the size of the basis set. \cite{FraMusLupTou-JCP-15}

Progress toward unifying these two approaches are on-going.
Using accurate and rigorous WFT methods, some of us have developed radical generalizations of DFT that are free of the well-known limitations of conventional DFT. 
In that respect range-separated DFT (RS-DFT) is particularly promising as it allows to perform multi-configurational DFT calculations within a rigorous mathematical framework. 
Range-separated hybrids, i.e.~single-determinant approximations of RS-DFT, correct for the wrong long-range behavior of the usual hybrid approximations thanks to the inclusion of the long-range part of the Hartree-Fock (HF) exchange.  

%The present manuscript is organized as follows.
Unless otherwise stated, atomic used are used.

%%%%%%%%%%%%%%%%%%%%%%%%
\section{Theory}
%%%%%%%%%%%%%%%%%%%%%%%%
The present basis set correction relies on the RS-DFT formalism to capture the missing part of the short-range correlation effects, a consequence of the incompleteness of the one-electron basis set. 
Here, we only provide the main working equations. 
We refer the interested reader to Ref.~\onlinecite{GinPraFerAssSavTou-JCP-18} for a more formal derivation.  


%=================================================================
%\subsection{Correcting the basis set error of a general WFT model}
%=================================================================
Let us assume we have both the energy $\E{\modX}{\Bas}$ and density $\n{\modY}{\Bas}$ of a $\Nel$-electron system described by two methods $\modX$ and $\modY$ (potentially identical) in an incomplete basis set $\Bas$. 
According to Eq.~(15) of Ref.~\onlinecite{GinPraFerAssSavTou-JCP-18}, assuming that $\E{\modX}{\Bas}$ and $\n{\modY}{\Bas}$ are reasonable approximations of the \titou{FCI} energy and density within $\Bas$, the exact ground state energy $\E{}{}$ may be written as
\begin{equation}
	\label{eq:e0basis}
	\E{}{} 
	\approx \E{\modX}{\Bas} 
	+ \bE{}{\Bas}[\n{\modY}{\Bas}],
\end{equation}
where
\begin{equation}
	\label{eq:E_funcbasis}
	 \bE{}{\Bas}[\n{}{}]
	= \min_{\wf{}{} \to \n{}{}}  \mel*{\wf{}{}}{\hT + \hWee{}}{\wf{}{}} 
	- \min_{\wf{}{\Bas} \to \n{}{}}  \mel*{\wf{}{\Bas}}{\hT + \hWee{}}{\wf{}{\Bas}}
\end{equation}
is the basis-dependent complementary density functional, $\hT$ is the kinetic operator and $\hWee{} = \sum_{i<j} r_{ij}^{-1}$ is the interelectronic repulsion operator.
In Eq.~\eqref{eq:E_funcbasis}, $\wf{}{\Bas}$ and $\wf{}{}$ are two general $\Nel$-electron wave functions belonging to the Hilbert space spanned by $\Bas$ and the complete basis, respectively.
Both wave functions yield the same target density $\n{}{}$. 

%\alert{Provided that the functional $\bE{}{\Bas}[\n{}{}]$ is known exactly, the only approximation performed in \eqref{eq:e0basis} is that the FCI density $\n{\FCI}{\Bas}$ coincides with the exact ground state density, which in general is a reasonable approximation as the density converges rapidly with the basis set.}

Importantly, in the limit of a complete basis set $\Bas$ (which we refer to as $\Bas \to \infty$), we have, for any density $\n{}{}$, $\lim_{\Bas \to \infty} \bE{}{\Bas}[\n{}{}] = 0$, which implies that
\begin{equation}
  \label{eq:limitfunc}
        \lim_{\Bas \to \infty} \qty( \E{\modX}{\Bas} + \bE{}{\Bas}[\n{\modY}{\Bas}] ) = \E{\modX}{} \approx E,
\end{equation}
where $\E{\modX}{}$ is the energy associated with the method $\modX$ in the complete basis set.
In the case $\modX = \FCI$, we have as strict equality as $E_{\FCI}^\infty = E$.
Provided that the functional $\bE{}{\Bas}[\n{}{}]$ is known exactly, \manu{the only source of error at this stage lies in the potential approximate nature of the methods $\modX$ and $\modY$}.

%Here we propose to generalize such approach to a general WFT model, referred here as $\model$, projected in a basis set $\Bas$ which must provides a density $\denmodel$ and an energy $\emodel$. 
%As any wave function model is necessary an approximation to the FCI model, one can write 
%\begin{equation}
% \efci \approx \emodel
%\end{equation}
%and 
%\begin{equation}
% \denfci \approx \denmodel
%\end{equation}
%and by defining the energy provided by the model $\model$ in the complete basis set 
%\begin{equation}
% \emodelcomplete = \lim_{\Bas \rightarrow \infty} \emodel\,\, , 
%\end{equation}
%we can then write 
%\begin{equation}
% \emodelcomplete \approx \emodel + \ecompmodel
%\end{equation}
%which verifies the correct limit since 
%\begin{equation}
% \lim_{\Bas \rightarrow \infty} \ecompmodel = 0\,\, .
%\end{equation}


%=================================================================
%\subsection{Basis set correction for the CIPSI algorithm and the CCSD(T) ansatz}
%=================================================================
%In this work we propose to apply the basis set correction to a selected CI algorithm, namely the CIPSI algorithm, and to the CCSD(T) ansatz in %order to speed-up the basis set convergence of these models. 

%=================================================================
%\subsubsection{Basis set correction for the CCSD(T) energy}
%=================================================================
%The CCSD(T) method is a very popular WFT approach which is known to provide very good estimation of the correlation energies for weakly correlated systems, whose wave function are dominated by the HF Slater determinant. 
%Defining $\ecc$ as the CCSD(T) energy obtained in $\Bas$, in the present notations we have 
%\begin{equation}
% \emodel = \ecc \,\, .
%\end{equation}
%In the context of the basis set correction, one needs to choose a density as the density of the model $\denmodel$, and we chose here the HF density
%\begin{equation}
% \denmodel = \denhf \,\, .
%\end{equation}
%Such a choice can be motivated by the fact that the correction to the HF density brought by the excited Slater determinants are at least of second-order in perturbation theory. 
%Therefore, we approximate the complete basis set CCSD(T) energy $\ecccomplete$ by
%\begin{equation}
% \ecccomplete \approx \ecc + \efuncden{\denhf} \,\, .
%\end{equation}

%=================================================================
%\subsubsection{Correction of the CIPSI algorithm}
%=================================================================
%The CIPSI algorithm approximates the FCI wave function through an iterative selected CI procedure, and the FCI energy through a second-order multi-reference perturbation theory.
%The CIPSI algorithm belongs to the general class of methods build upon selected CI\cite{bender,malrieu,buenker1,buenker-book,three_class_CIPSI,harrison,hbci}
%which have been successfully used to converge to FCI correlation energies, one-body properties, and nodal surfaces.\cite{three_class_CIPSI,Rubio198698,cimiraglia_cipsi,cele_cipsi_zeroth_order,Angeli2000472,canadian,atoms_3d,f2_dmc,atoms_dmc_julien,GinTewGarAla-JCTC-18,SceBenJacCafLoo-JCP-18,LooSceBloGarCafJac-JCTC-18,LooBogSceCafJAc-JCTC-19}
%The CIPSI algorithm used in this work uses iteratively enlarged selected CI spaces and
%Epstein--Nesbet\cite{epstein,nesbet} multi-reference perturbation theory. Within a basis set $\Bas$, the CIPSI energy is
%\begin{align}
%  E_\mathrm{CIPSI}^{\Bas} &= E_\text{v} + E^{(2)} \,\,,
%\end{align}
%where $E_\text{v}$ is the variational energy
%\begin{align}
% E_\text{v} &= \min_{\{ c_{\rm I}\}} \frac{\elemm{\Psi^{(0)}}{\hat{H}}{\Psi^{(0)}}  }{\ovrlp{\Psi^{(0)}}{\Psi^{(0)}}}\,\,,
%\end{align}
%where the reference wave function $\ket{\Psi^{(0)}} = \sum_{{\rm I}\,\in\,\mathcal{R}} \,\,c_{\rm I} \,\,\ket{\rm I}$ is expanded in Slater determinants I within the CI reference space $\mathcal{R}$, and $E^{(2)}$ is the second-order energy correction
%\begin{align}
%  E^{(2)} &= \sum_{\kappa} \frac{|\elemm{\Psi^{(0)}}{\hat{H}}{\kappa}|^2}{E_\text{v} - \elemm{\kappa}{H}{\kappa}} = \sum_{\kappa} \,\, e_{\kappa}^{(2)} \,\, ,
%\end{align}
%where $\kappa$ denotes a determinant outside $\mathcal{R}$.
%To reduce the cost of the evaluation of the second-order energy correction, the semi-stochastic multi-reference approach
%of Garniron \textit{et al.} \cite{stochastic_pt_yan} was used, adopting the technical specifications recommended in that work.
%The CIPSI energy is systematically refined by doubling the size of the CI reference space at each iteration, selecting
%the determinants $\kappa$ with the largest $\vert e_{\kappa}^{(2)} \vert$. 
%In order to reach a faster convergence of the estimation of the FCI energy, we use the extrapolated FCI energy (exFCI) proposed by Holmes \textit{et al}\cite{HolUmrSha-JCP-17} which we refer here as $\EexFCIbasis$. 
%
%In the context of the basis set correction, we use the following conventions
%\begin{equation}
% \emodel = \EexFCIbasis
%\end{equation}
%\begin{equation}
% \denmodelr = \dencipsir
%\end{equation}
%where the density $\dencipsir$ is defined as
%\begin{equation}
% \dencipsi = \sum_{ij \in \Bas} \elemm{\Psi^{(0)}}{\aic{i}\ai{j}}{\Psi^{(0)}} \phi_i(\bfrb{} ) \phi_j(\bfrb{} ) \,\, ,
%\end{equation}
%and $\phi_i(\bfrb{} )$ are the spin orbitals in the MO basis evaluated at $\bfrb{}$. As it was shown in \onlinecite{GinPraFerAssSavTou-JCP-18} that the CIPSI density converges rapidly with the size of $\Psi^{(0)}$ for weakly correlated systems, $\dencipsir$ can be thought as a reasonable approximation of the FCI density $\denfci$. 
%
%Finally, we approximate complete basis set exFCI energy $\EexFCIinfty$ as
%\begin{equation}
% \EexFCIinfty \approx \EexFCIbasis + \efuncden{\dencipsi}
%\end{equation}

However, in addition of being unknown, the functional $\bE{}{\Bas}[\n{}{}]$ is obviously \textit{not} universal as it depends on $\Bas$. 
One of the consequences of the incompleteness of $\Bas$ is that $\wf{}{\Bas}$ does not have a cusp (i.e.~a discontinuous derivative) at the electron-electron (e-e) coalescence points. 
As the e-e cusp originates from the divergence of the Coulomb operator at $r_{12} = 0$, a cuspless wave function could equivalently originate from a Hamiltonian with a non-divergent Coulomb interaction at $r_{12} = 0$. 
Therefore, as we shall do later on, it feels natural to evaluate $\bE{}{\Bas}[\n{}{}]$ with short-range density functionals.
Contrary to the conventional RS-DFT scheme which requires a range-separated \textit{parameter} $\rsmu{}{}$, the spatial inhomogeneity of $\Bas$ forces us to define a range-separated \textit{function} $\rsmu{}{}(\br{})$ as the value of $\rsmu{}{}$ must be known at any point in space.

The first step of our basis set correction consists in obtaining an effective operator $\W{\wf{}{\Bas}}{}(\bx{1},\bx{2})$ which i) is finite at the e-e coalescence point as long as an incomplete basis set is used, and ii) tends to the genuine, unbounded $r_{12}^{-1}$ Coulomb operator in the limit of a complete basis set. 
In a second step, we shall link $\W{\wf{}{\Bas}}{}(\bx{1},\bx{2})$ to $\rsmu{}{}(\br{})$.
In the final step, we employ $\rsmu{}{}(\br{})$ within short-range density functionals. \cite{TouGorSav-TCA-05}
%Following Ref.~\onlinecite{GinPraFerAssSavTou-JCP-18}, we approximate $\bE{}{\Bas}[\n{}{}]$ following a two-step procedure which guarantees the correct behaviour in the limit $\Bas \to \infty$ [see Eq.~\eqref{eq:limitfunc}]. 
%First, we choose a specific class of short-range density functionals, namely the short-range correlation functionals with multi-determinantal reference (ECMD) introduced by Toulouse \textit{et al.} \cite{TouGorSav-TCA-05} that we evaluate at $\n{\modX}{\Bas}$ alongside $\mu(\br{})$.% (see Sec.~\ref{sec:ecmd}) .   
%Second, we define a real-space representation of the Coulomb operator projected in $\Bas$, which is then fitted with a long-range interaction thanks to a range-separation \textit{function} $\mu(\br{})$ defined in real space. %(see Sec.~\ref{sec:weff}). 


%=================================================================
%\subsection{General scheme for the approximation of the unknown complementary functional $\efuncbasis$}
%=================================================================


%=================================================================
%\subsection{Definition of a real-space representation of the coulomb operator truncated in a basis-set $\Bas$}
%\label{sec:weff}
%=================================================================
%=================================================================
%\subsection{Effective Coulomb operator}
%=================================================================
To compute the effective operator $\W{\wf{}{\Bas}}{}(\bx{1},\bx{2})$ defined as
\begin{equation}
	\label{eq:int_eq_wee}
	\mel*{\wf{}{\Bas}}{\hWee{\Bas}}{\wf{}{\Bas}} = \iint \W{\wf{}{\Bas}}{}(\bx{1},\bx{2}) \n{\wf{}{\Bas}}{(2)}(\bx{1},\bx{2}) \dbx{1} \dbx{2},
\end{equation}
where 
\begin{equation}
	\n{\wf{}{\Bas}}{(2)}(\bx{1},\bx{2})
	= \sum_{pqrs \in \Bas}  \SO{p}{1} \SO{q}{2} \Gam{pq}{rs}[\wf{}{\Bas}] \SO{r}{1} \SO{s}{2}
\end{equation}
is the two-body density associated with $\wf{}{\Bas}$, $\Gam{pq}{rs}[\wf{}{\Bas}] = \mel*{\wf{}{\Bas}}{ \aic{r}\aic{s}\ai{p}\ai{q} }{\wf{}{\Bas}}$ is the two-body density tensor of $\wf{}{\Bas}$, $\SO{i}{}$ are spinorbitals, $\bx{} = \qty(\br{},\sigma)$ collects space and spin variables, and $\int \dbx{} = \sum_{\sigma}\,\int_{\mathbb{R}^3} \dbr{}$), one must realize that
\begin{equation}
	\mel*{\wf{}{\Bas}}{\hWee{}}{\wf{}{\Bas}} = \mel*{\wf{}{\Bas}}{\hWee{\Bas}}{\wf{}{\Bas}},
\end{equation}
which states that the expectation value of $\hWee{}$ over $\wf{}{\Bas}$ is equal to the expectation value of its projected version in $\Bas$ 
\begin{equation}
\label{eq:WeeB}
	\hWee{\Bas} =  \frac{1}{2} \sum_{pqrs \in \Bas}\vpqrs \aic{r} \aic{s} \ai{q} \ai{p}
\end{equation}
over the same wave function $\wf{}{\Bas}$, where the indices run over all spinorbitals in $\Bas$ and $\vpqrs$ are the usual two-electron Coulomb integrals. 
Because one can show (see Appendix A of Ref.~\onlinecite{GinPraFerAssSavTou-JCP-18}) that  
\begin{subequations}
\begin{align}
	\label{eq:expectweeb}
	\mel*{\wf{}{\Bas}}{\hWee{\Bas}}{\wf{}{\Bas}} & =  \frac{1}{2} \iint \f{\wf{}{\Bas}}{}(\bx{1},\bx{2}) \dbx{1} \dbx{2},
	\\
   \label{eq:expectwee}
	\mel*{\wf{}{\Bas}}{\hWee{}}{\wf{}{\Bas}} & =  \frac{1}{2} \iint r_{12}^{-1} \n{\wf{}{\Bas}}{(2)}(\bx{1},\bx{2}) \dbx{1} \dbx{2},
\end{align}
\end{subequations}
where
\begin{multline}
	\label{eq:fbasis}
	\f{\wf{}{\Bas}}{}(\bx{1},\bx{2}) 
	\\
	=  \sum_{pqrstu \in \Bas}  \SO{p}{1} \SO{q}{2} \vpqrs \Gam{rs}{tu}[\wf{}{\Bas}] \SO{t}{1} \SO{u}{2},
\end{multline}
it comes naturally that 
\begin{equation}
	\label{eq:def_weebasis}
	\W{\wf{}{\Bas}}{}(\bx{1},\bx{2}) = \f{\wf{}{\Bas}}{}(\bx{1},\bx{2})/\n{\wf{}{\Bas}}{(2)}(\bx{1},\bx{2}).
\end{equation}

As already discussed in Ref.~\onlinecite{GinPraFerAssSavTou-JCP-18}, $\W{\wf{}{\Bas}}{}(\bx{1},\bx{2})$ is symmetric, \textit{a priori} non translational nor rotational invariant if $\Bas$ does not have such symmetries and is necessarily \textit{finite} at $r_{12} = 0$ for an incomplete basis set. 
Also, as demonstrated in Appendix B of Ref.~\onlinecite{GinPraFerAssSavTou-JCP-18}
\begin{equation}
	\label{eq:lim_W}
	\lim_{\Bas \to \infty}\W{\wf{}{\Bas}}{}(\bx{1},\bx{2}) = r_{12}^{-1}. 
\end{equation}


%=================================================================
%\subsection{Range-separation function}
%=================================================================
To be able to approximate the complementary functional $\bE{}{\Bas}[\n{}{}]$ thanks to functionals developed in the field of RS-DFT, we associate the effective interaction to a long-range interaction characterized by a range-separation function $\rsmu{}{}(\br{})$. 
Although this choice is not unique, the long-range interaction we have chosen is 
\begin{equation}
	\w{}{\lr,\rsmu{}{}}(\br{1},\br{2}) = \frac{1}{2} \qty{ \frac{\erf[ \rsmu{}{}(\br{1}) r_{12}]}{r_{12}} + \frac{\erf[ \rsmu{}{}(\br{2}) r_{12}]}{ r_{12}} }.
\end{equation}
Ensuring that $\w{}{\lr,\rsmu{}{}}(\br{1},\br{2})$ and $\W{\wf{}{\Bas}}{}(\bx{1},\bx{2})$ have the same value at coalescence of opposite-spin electron pairs yields
\begin{equation}
	\label{eq:mu_of_r}
	\rsmu{\wf{}{\Bas}}{}(\br{}) = \frac{\sqrt{\pi}}{2} \W{\wf{}{\Bas}}{}(\bx{},\Bar{\bx{}}),
\end{equation}
where $(\bx{},\Bar{\bx{}})$ represents a couple of opposite-spin electrons at the same position $\br{}$.
%More precisely, if we define the value of the interaction at coalescence as 
%\begin{equation}
% \label{eq:def_wcoal}
% \wbasiscoal{} = W_{\wf{}{\Bas}}(\bfr{},\bar{{\bf x}}_{}).
%\end{equation}
%where $(\bx{},\Bar{\bx{}})$ means a couple of anti-parallel spins at the same position $\br{}$, 
%we propose a fit for each point in $\rnum^3$ of $\wbasiscoal{ }$ with a long-range-like interaction:
%\begin{equation}
%  \wbasiscoal{} = \w{}{\lr,\rsmu{\wf{}{\Bas}}{}}(\bfrb{},\bfrb{})
%\end{equation}
%where the long-range-like interaction is defined as
%\begin{equation}
%	\w{}{\lr,\rsmu{}{}}(\br{1},\br{2}) = \frac{1}{2} \qty{ \frac{\erf[ \murr{1} \, r_{12}]}{r_{12}} + \frac{\erf[ \murr{2} r_{12}]}{ r_{12}} }.  
%\end{equation}
%Equation \eqref{eq:def_wcoal} is equivalent to the following condition
%\begin{equation}
% \label{eq:mu_of_r}
% 	\rsmu{\wf{}{\Bas}}{}(\br{}) = \frac{\sqrt{\pi}}{2} \W{\wf{}{\Bas}}{}(\br{})
%\end{equation}
%As we defined an effective interaction for the valence electrons, we also introduce a valence range-separation parameter as
%\begin{equation}
% \label{eq:mu_of_r_val}
% \murpsival = \frac{\sqrt{\pi}}{2} \, \wbasiscoalval{} \, .
%\end{equation}
%An important point to notice is that, in the limit of a complete basis set $\Bas$, as 
%\begin{equation}
%\label{eq:lim_W}
%	\lim_{\Bas \rightarrow \infty}\wbasis = r_{12}^{-1}  \quad \forall  (\bx{1},\bx{2})
%% &\lim_{\Bas \rightarrow \infty}\wbasisval = 1/r_{12} \,\,\,\,\forall \,\, (\bfr{1},\bfr{2})\,\, , 
%\end{equation}
%one has $\lim_{\Bas \rightarrow \infty} \wbasiscoal{} = \infty$
%% &\lim_{\Bas \rightarrow \infty} \wbasiscoalval{} = +\infty\,\,, 
%and therefore 
%\begin{equation}
%\label{eq:lim_mur}
%	\lim_{\Bas \rightarrow \infty} \rsmu{\wf{}{\Bas}}{}(\br{}) = \infty
%%\lim_{\Bas \rightarrow \infty} \murpsival = +\infty \,\, .
%\end{equation}



%=================================================================
%\subsection{Complementary functional}
%=================================================================
%\label{sec:ecmd}

Following Ref.~\onlinecite{GinPraFerAssSavTou-JCP-18}, we propose here to approximate $\bE{}{\Bas}[\n{}{}]$ using a specific class of short-range correlation functionals known as ECMD whose general definition reads \cite{TouGorSav-TCA-05}
\begin{multline}
  \label{eq:ec_md_mu}
  \bE{}{\sr}[\n{}{}(\br{}),\rsmu{}{}(\br{})] = \min_{\wf{}{} \to \n{}{}(\br{})} \mel*{\Psi}{\hT + \hWee{}}{\wf{}{}}
  \\
  - \mel*{\wf{}{\rsmu{}{}}[\n{}{}(\br{})]}{\hT + \hWee{}}{\wf{}{\rsmu{}{}}[\n{}{}(\br{})]},
\end{multline}
where $\wf{}{\rsmu{}{}}[\n{}{}(\br{})]$ is defined by the constrained minimization
\begin{equation}
\label{eq:argmin}
	\wf{}{\rsmu{}{}}[\n{}{}(\br{})] = \arg \min_{\wf{}{} \to \n{}{}(\br{})} \mel*{\wf{}{}}{\hT + \hWee{\lr,\rsmu{}{}}}{\wf{}{}},
\end{equation}
with $\hWee{\lr,\rsmu{}{}} = \sum_{i<j} \w{}{\lr,\rsmu{}{}}(r_{ij})$.
%and
%\begin{equation}
%\label{eq:erf}
%	\w{}{\lr,\rsmu{}{}}(r_{12}) = \frac{\erf(\rsmu{}{} r_{12})}{r_{12}}.
%\end{equation}
%is the long-range part of the Coulomb operator.
The ECMD functionals admit, for any density $\n{}{}(\br{})$, the two following limiting forms:
\begin{subequations}
\begin{align}
	\label{eq:large_mu_ecmd}
	\lim_{\mu \to \infty}  \bE{}{\sr}[\n{}{}(\br{}),\rsmu{}{}(\br{})] & = 0,
	\\
	\label{eq:small_mu_ecmd}
	\lim_{\mu \to 0}  \bE{}{\sr}[\n{}{}(\br{}),\rsmu{}{}(\br{})] & = \Ec[\n{}{}(\br{})],
\end{align}
\end{subequations}
where $\Ec[\n{}{}(\br{})]$ is the usual universal correlation functional defined in KS-DFT. 
The ECMD functionals differ from the standard RS-DFT correlation functional by the fact that the reference is not the KS Slater determinant but a multi-determinantal wave function.
This makes them particularly well adapted to the present context where one aims at correcting a general WFT method. 

%--------------------------------------------
%\subsubsection{Local density approximation}
%--------------------------------------------
Following Ref.~\onlinecite{GinPraFerAssSavTou-JCP-18}, we define the LDA version of ECMD as 
\begin{equation}
	\label{eq:def_lda_tot}
	\bE{\LDA}{\sr}[\n{}{}(\br{}),\rsmu{}{}(\br{})] = \int \be{\UEG}{\sr}[\n{}{}(\br{}),\rsmu{}{}(\br{})] \n{}{}(\br{}) \dbr{},
\end{equation}
where $\be{\UEG}{\sr}(\n{}{},\rsmu{}{})$ is the multi-determinant short-range correlation energy per particle of the uniform electron gas (UEG) for which a parametrization can be found in Ref.~\onlinecite{PazMorGorBac-PRB-06}. 
%In practice, for open-shell systems, we use the spin-resolved version of this functional (i.e., depending on both spin densities) but for simplicity we will continue to use only the notation of the spin-unpolarized case.

%--------------------------------------------
%\subsubsection{New PBE functional}
%--------------------------------------------
The short-range LDA correlation functional defined in Eq.~\eqref{eq:def_lda_tot} relies on the transferability of the physics of the UEG which is certainly valid for large $\mu$ but is known to over correlate for small $\mu$. 
In order to correct such a defect, we propose here a new ECMD functional inspired by the recent functional proposed by some of the present authors \cite{FerGinTou-JCP-18} which interpolates between the usual PBE correlation functional $\e{\PBE}{}(\n{}{},\nabla \n{}{})$ for small $\rsmu{}{}$ and the exact large-$\rsmu{}{}$ behavior, \cite{TouColSav-PRA-04, GoriSav-PRA-06, PazMorGori-PRB-06} yielding
\begin{subequations}
\begin{gather}
	\label{eq:epsilon_cmdpbe}
	\be{\PBE}{\sr}(\n{}{},\nabla \n{}{},\rsmu{}{}) = \frac{\e{\PBE}{}(\n{}{},\nabla \n{}{})}{1 + \beta(n,\nabla n, \rsmu{}{})\rsmu{}{3} },
	\\
	\label{eq:epsilon_cmdpbe}
	\beta(n,\nabla n,\rsmu{}{}) = \frac{3}{2\sqrt{\pi} (1 - \sqrt{2} )} \frac{\e{\PBE}{}(\n{}{},\nabla \n{}{})}{\n{\UEG}{(2)}(\n{}{})}.
\end{gather}
\end{subequations}
The difference between the ECMD PBE functional defined in Ref.~\onlinecite{FerGinTou-JCP-18} and the present expression \eqref{eq:epsilon_cmdpbe} is that we approximate here the \textit{exact} ground-state on-top pair density of the system $\n{}{(2)}$ by its UEG version, i.e.~$\n{}{(2)} \approx \n{\UEG}{(2)} =  \n{}{2} g_0(\n{}{})$, where $g_0(\n{}{})$ is the UEG correlation factor whose parametrization can be found in Eq.~(46) of Ref.~\onlinecite{GorSav-PRA-06}. 
Therefore, the PBE complementary functional reads
\begin{equation}
	\label{eq:def_lda_tot}
	\bE{\PBE}{\sr}[\n{}{}(\br{}),\rsmu{}{}(\br{})] = \int \be{\PBE}{\sr}[\n{}{}(\br{}),\nabla \n{}{}(\br{}),\rsmu{}{}(\br{})] \n{}{}(\br{}) \dbr{}.
\end{equation}
Depending on the functional choice, the complementary functional $\bE{}{\Bas}[\n{\wf{}{\Bas}}{}]$ is then equal to $\bE{\LDA}{\sr}[\n{\wf{}{\Bas}}{}(\br{}),\rsmu{\wf{}{\Bas}}{}(\br{})]$ or $\bE{\PBE}{\sr}[\n{\wf{}{\Bas}}{}(\br{}),\rsmu{\wf{}{\Bas}}{}(\br{})]$ where $\rsmu{\wf{}{\Bas}}{}(\br{})$ is given by Eq.~\eqref{eq:mu_of_r}.

%The general scheme for estimating $\ecompmodel$ is the following. Consider a given approximated ECMD functional $\ecmuapprox$  labelled by ECMD-$\mathcal{X}$. 
%Such a functional of the density $\denr$ (and potentially its derivatives $\nabla \denr$) is defined for any value of the range-separation parameter $\mu$.  
%A general scheme to approximate  $\ecompmodel$ is to use $\ecmuapprox$ with the $\mur$ defined in \eqref{eq:def_weebasis} and to evaluate it at the density defined by the model $\denmodel$
%\begin{equation}
% \label{eq:approx_ecfuncbasis}
% \ecompmodel \approx \ecmuapproxmurmodel
%\end{equation}
%Therefore, any approximated ECMD can be used to estimate $\ecompmodel$. 
%It is important to notice that in the limit of a complete basis set, according to equations \eqref{eq:lim_mur} and \eqref{eq:large_mu_ecmd} one has 
%\begin{equation}
% \lim_{\Bas \rightarrow \infty} \ecmuapproxmurmodel = 0 \quad ,
%\end{equation}
%for whatever choice of density $\denmodel$, wave function $\wf{}{\Bas}$ used to define the interaction, and ECMD functional used to approximate the exact ECMD. 


%=================================================================
%\subsection{Valence effective interaction}
%=================================================================
As most WFT calculations are performed within the frozen-core (FC) approximation, it is important to define an effective interaction within a general subset of molecular orbitals. 
We then naturally split the basis set as $\Bas = \Cor \bigcup \Val$, where $\Cor$ and $\Val$ are its core and valence parts, respectively.% and $\Cor \bigcap \Val = \O$.

%According to Eqs.~\eqref{eq:expectweeb} and \eqref{eq:def_weebasis} , the effective interaction is defined by the expectation value of the coulomb operator over a wave function $\wf{}{\Bas}$. 
Accounting solely for the valence electrons, Eq.~\eqref{eq:expectweeb} becomes
\begin{equation}
	\label{eq:expectweebval}
	\mel*{\wf{}{\Bas}}{\hWee{\Val}}{\wf{}{\Bas}} =  \frac{1}{2} \iint \f{\wf{}{\Bas}}{\Val}(\bx{1},\bx{2}) \dbx{1} \dbx{2},
\end{equation}
where $\hWee{\Val}$, the valence part of the Coulomb operator, has a similar expression as $\hWee{\Bas}$ in Eq.~\eqref{eq:WeeB}.
%\begin{equation}
%      \hWee{\Val} =  \frac{1}{2} \sum_{ijkl \in \Val} \vijkl \aic{k}\aic{l}\ai{j}\ai{i},
%\end{equation}
Following the spirit of Eq.~\eqref{eq:fbasis}, we have
\begin{multline}
	\label{eq:fbasisval}
	\f{\wf{}{\Bas}}{\Val}(\bx{1},\bx{2}) 
	\\
	=  \sum_{pq \in \Bas} \sum_{rstu \in \Val}  \SO{p}{1} \SO{q}{2} \vpqrs \Gam{rs}{tu}[{\wf{}{\Bas}}] \SO{t}{1} \SO{u}{2},
\end{multline}
and the valence part of the effective interaction is
\begin{subequations}
\begin{gather}
	\W{\wf{}{\Bas}}{\Val}(\bx{1},\bx{2}) = \f{\wf{}{\Bas}}{\Val}(\bx{1},\bx{2})/\n{\wf{}{\Bas},\Val}{(2)}(\bx{1},\bx{2}),
	\\
	\rsmu{\wf{}{\Bas}}{\Val}(\br{}) = \frac{\sqrt{\pi}}{2} \W{\wf{}{\Bas}}{\Val}(\bx{},\Bar{\bx{}}),
\end{gather}
\end{subequations}
where 
\begin{equation}
	\n{\wf{}{\Bas},\Val}{(2)}(\bx{1},\bx{2})
	= \sum_{pqrs \in \Val}  \SO{p}{1} \SO{q}{2} \Gam{pq}{rs}[\wf{}{\Bas}] \SO{r}{1} \SO{s}{2}
\end{equation}
is the two body density associated to the valence electrons.
%\begin{equation}
% \twodmrdiagpsival = \sum_{klmn \in \Val} \SO{m}{1} \SO{n}{2} \gammamnkl[\wf{}{\Bas}] \SO{k}{1} \SO{l}{2} .
%\end{equation}
%It is worth noting that, in Eq.~\eqref{eq:fbasisval} the difference between the set of orbitals for the indices $(i,j)$, which span the full set of MOs within $\Bas$,  and the $(k,l,m,n)$, which span only the valence space $\Basval$. Only with such a definition, one can show (see annex) that $\fbasisval$ fulfills \eqref{eq:expectweebval} and tends to the exact interaction $1/r_{12}$ in the limit of a complete basis set $\Bas$, whatever the choice of subset $\Basval$. 
It is worth noting that, within the present definition, $\W{\wf{}{\Bas}}{\Val}(\bx{1},\bx{2})$ still satisfies Eq.~\eqref{eq:lim_W}.

%We now introduce a valence-only approximation for the complementary functional which is needed to correct for frozen core WFT models. 
%Defining the valence one-body spin density matrix as
%\begin{equation}
% \begin{aligned}
% \onedmval[\wf{}{\Bas}] & = \elemm{\wf{}{\Bas}}{a^{\dagger}_{i,\sigma} a_{j,\sigma}}{\wf{}{\Bas}} \qquad \text{if }(i,j)\in \Basval \\
%                      & = 0 \qquad \text{in other cases}
% \end{aligned}
%\end{equation}
%then one can define the valence density as:
%\begin{equation}
%  \denval_{\sigma}({\bf r}) = \sum_{i,j} \onedmval[\wf{}{\Bas}] \phi_i({\bf r}) \phi_j({\bf r}) 
%\end{equation}
%Therefore, we propose the following valence-only approximations for the complementary functional 
%\begin{equation}
% \label{eq:def_lda_tot}
%  \ecompmodelldaval = \int \, \text{d}{\bf r} \,\, \denval({\bf r}) \,\, \emuldaval\,,
%\end{equation}
%\begin{equation}
% \label{eq:def_lda_tot}
%  \ecompmodelpbeval = \int \, \text{d}{\bf r} \,\, \bar{e}_{\text{c,md}}^\text{PBE}(\denval({\bf r}),\nabla \denval({\bf r});\,\murval)
%\end{equation}
Defining $\n{\wf{}{\Bas}}{\Val}$ as the valence one-electron density, the valence part of the complementary functional $\bE{}{\Val}[\n{\wf{}{\Bas}}{\Val}]$ is then evaluated as $\bE{\LDA}{\sr}[\n{\wf{}{\Bas}}{\Val}(\br{}),\rsmu{\wf{}{\Bas}}{\Val}(\br{})]$ or $\bE{\PBE}{\sr}[\n{\wf{}{\Bas}}{\Val}(\br{}),\rsmu{\wf{}{\Bas}}{\Val}(\br{})]$.

%%%%%%%%%%%%%%%%%%%%%%%%
\section{Results}
%%%%%%%%%%%%%%%%%%%%%%%%

%%% TABLE I %%%
\begin{table*}
	\caption{
		\label{tab:diatomics}
		Dissociation energy ($\De$) in {\kcal} of the \ce{C2}, \ce{O2}, \ce{N2} and \ce{F2} molecules computed with various methods and basis sets.
		The deviation with respect to the CBS values are reported in parenthesis.
		}
		\begin{ruledtabular}
			\begin{tabular}{llddddd}
							&					&	\mc{4}{c}{Dunning's basis set}													
				\\
													\cline{3-6}
                  Molecule	&	Method				&	\tabc{$\X = \D$}	&	\tabc{$\X = \T$}	&	\tabc{$\X = \Q$}	&	\tabc{$\X = 5$}		&	\tabc{CBS}	
				\\
				\hline
				\ce{C2}		&	exFCI\fnm[1]		&	132.0	(-13.7	)	&	140.3	(-5.4	)	&	143.6	(-2.1	)	&	144.7	(-1.0	)	&	145.7			\\	
				(cc-pVXZ)	&	exFCI+LDA\fnm[1]	&	141.3	(-4.4	)	&	145.1	(-0.6	)	&	146.4	(+0.7	)	&	146.3	(+0.6	)	&					\\	
							&	exFCI+PBE\fnm[1]	&	145.7	(+0.0	)	&	145.7	(+0.0	)	&	146.3	(+0.6	)	&	146.2	(+0.5	)	&					\\	
                            &	CCSD(T)\fnm[1]		&	129.2	(-16.2	)	&	139.1	(-6.3	)	&	143.0	(-2.4	)	&	144.2	(-1.2	)	&					\\
							&	CCSD(T)+LDA\fnm[1]	&	139.1	(-6.3	)	&	143.7	(-1.7	)	&	145.9	(+0.5	)	&	145.9	(+0.5	)	&					\\	
							&	CCSD(T)+PBE\fnm[1]	&	142.8	(-2.6	)	&	144.2	(-1.2	)	&	145.9	(+0.5	)	&	145.8	(+0.4	)	&				\\	\\
				\ce{C2}	   	&	exFCI\fnm[2]		&	131.0	(-16.1	)	&	141.5	(-5.6	)	&	145.1	(-2.0	)	&	146.1	(-1.0	)	&	147.1			\\	
				(cc-pCVXZ)	&	exFCI+LDA\fnm[2]	&	141.4	(-5.7	)	&	146.7	(-0.4	)	&	147.8	(+0.7	)	&	147.6	(+0.5	)	&					\\	
							&	exFCI+PBE\fnm[2]	&	145.1	(-2.0	)	&	147.0	(-0.1	)	&	147.7	(+0.6	)	&	147.5	(+0.4	)	&				\\	\\
				\ce{N2}		&	exFCI\fnm[1]		&	201.1	(-26.7	)	&	217.1	(-10.7	)	&	223.5	(-4.3	)	&	225.7	(-2.1	)	&	227.8       	\\
				(cc-pVXZ)	&	exFCI+LDA\fnm[1]	&	217.9	(-9.9	)	&	225.9	(-1.9	)	&	228.0	(+0.2	)	&	228.6	(+0.8	)	&					\\	
							&	exFCI+PBE\fnm[1]	&	227.7	(-0.1	)	&	227.8	(+0.0	)	&	228.3	(+0.5	)	&	228.5	(+0.7	)	&					\\	
                            &	CCSD(T)\fnm[1]		&	199.9	(-27.9	)	&	216.3	(-11.5	)	&	222.8	(-5.0	)	&	225.0	(-2.8	)	&	227.2			\\
							&	CCSD(T)+LDA\fnm[1]	&	216.3	(-11.5	)	&	224.8	(-3.0	)	&	227.2	(-0.6	)	&	227.8	(+0.0	)	&					\\	
							&	CCSD(T)+PBE\fnm[1]	&	225.9	(-1.9	)	&	226.7	(-1.1	)	&	227.5	(-0.3	)	&	227.8	(+0.0	)	&				\\	\\
				\ce{N2}		&	exFCI\fnm[2]		&	202.2	(-26.6	)	&	218.5	(-10.3	)	&	224.4	(-4.4	)	&	226.6 	(-2.2	)	&	 228.8			\\
				(cc-pCVXZ)	&	exFCI+LDA\fnm[2]	&	218.0	(-10.8	)	&	226.8	(-2.0	)	&	229.1	(+0.3	)	&	229.4	(+0.6	)	&					\\
							&	exFCI+PBE\fnm[2]	&	226.4	(-2.4	)	&	228.2	(-0.6	)	&	229.1	(+0.3	)	&	229.2	(+0.4	)	&				\\	\\
				\ce{O2}		&	exFCI\fnm[1]		&	105.2	(-14.8	)	&	114.5	(-5.5	)	&	118.0	(-2.0	)	&	119.1	(-0.9	)	&	120.0       	\\
				(cc-pVXZ)	&	exFCI+LDA\fnm[1]	&	112.4	(-7.6	)	&	118.4	(-1.6	)	&	120.2	(+0.2	)	&	120.4	(+0.4	)	&					\\	
							&	exFCI+PBE\fnm[1]	&	117.2	(-2.8	)	&	119.4	(-0.6	)	&	120.3	(+0.3	)	&	120.4	(+0.4	)	&					\\	
                            &	CCSD(T)\fnm[1]		&	103.9	(-16.1	)	&	113.6	(-6.4	)	&	117.1	(-2.9	)	&	118.6	(-1.4	)	&	120.0			\\
							&	CCSD(T)+LDA\fnm[1]	&	110.6	(-9.4	)	&	117.2	(-2.8	)	&	119.2	(-0.8	)	&	119.8	(-0.2	)	&					\\	
							&	CCSD(T)+PBE\fnm[1]	&	115.1	(-4.9	)	&	118.0	(-2.0	)	&	119.3	(-0.7	)	&	119.8	(-0.2	)	&				\\	\\
				\ce{F2}		&	exFCI\fnm[1]		&	26.7	(-12.3	)	&	35.1	(-3.9	)	&	37.1	(-1.9	)	&	38.0	(-1.0	)	&	39.0			\\
				(cc-pVXZ)	&	exFCI+LDA\fnm[1]	&	30.4	(-8.6	)	&	37.2	(-1.8	)	&	38.4	(-0.6	)	&	38.9	(-0.1	)	&					\\	
							&	exFCI+PBE\fnm[1]	&	33.1	(-5.9	)	&	37.9	(-1.1	)	&	38.5	(-0.5	)	&	38.9	(-0.1	)	&					\\	
                            &	CCSD(T)\fnm[1]		&	25.7 	(-12.5	)	&	34.4 	(-3.8	)	&	36.5 	(-1.7	)	&	37.4 	(-0.8	)	&	38.2 			\\
							&	CCSD(T)+LDA\fnm[1]	&	29.2 	(-9.0	)	&	36.5 	(-1.7	)	&	37.2 	(-1.0	)	&	38.2 	(+0.0	)	&					\\	
							&	CCSD(T)+PBE\fnm[1]	&	31.5 	(-6.7	)	&	37.1 	(-1.1	)	&	37.8 	(-0.4	)	&	38.2 	(+0.0	)	&					\\	
		\end{tabular}
	\end{ruledtabular}
	\fnt[1]{Fronzen core calculations. Only valence spinorbitals are taken into account in the basis set correction.}
	\fnt[2]{``Full'' calculation, i.e., all electrons are correlated. All spinorbitals are taken into account in the basis set correction.}
\end{table*}

%%% TABLE II %%%
\begin{table}
	\caption{
	Statistical analysis (in \kcal) of the G2 atomization energies depicted in Fig.~\ref{fig:G2_AE}. 
	Mean absolute deviation (MAD), root-mean-square deviation (RMSD), and maximum deviation (MAX) with respect to the CCSD(T)/CBS reference data.
	\label{tab:stats}}
	\begin{ruledtabular}
		\begin{tabular}{lddd}
			Method					&	\tabc{MAD}	&	\tabc{RMSD}	&	\tabc{MAX}	\\
			\hline
			CCSD(T)/cc-pVDZ			&	22.81		&	25.82			&	72.08	\\
			CCSD(T)/cc-pVTZ			&	7.95		&	8.99			&	25.99	\\
			CCSD(T)/cc-pVQZ			&	3.24		&	3.67			&	11.66	\\
			CCSD(T)/cc-pV5Z			&	1.39		&	1.54			&	3.46	\\
			\\
			CCSD(T)+LDA/cc-pVDZ		&	11.75		&	13.99			&	54.88	\\
			CCSD(T)+LDA/cc-pVTZ		&	3.11		&	3.94			&	16.77	\\
			CCSD(T)+LDA/cc-pVQZ		&	0.87		&	1.36			&	6.22	\\
			\\
			CCSD(T)+PBE/cc-pVDZ		&	8.68		&	10.92			&	45.81	\\
			CCSD(T)+PBE/cc-pVTZ		&	2.66		&	3.52			&	14.73	\\
			CCSD(T)+PBE/cc-pVQZ		&	0.88		&	1.36			&	5.96	\\
		\end{tabular}
	\end{ruledtabular}
\end{table}

%%% FIGURE 1 %%%
\begin{figure*}
	\includegraphics[width=\linewidth]{VDZ}
	\includegraphics[width=\linewidth]{VTZ}
	\includegraphics[width=\linewidth]{VQZ}
	\caption{
	Deviation (in \kcal) from CCSD(T)/CBS reference atomization energies obtained with various methods with the cc-pVDZ (top), cc-pVTZ (center) and cc-pVQZ (bottom) basis sets.	
	\label{fig:G2_AE}}
\end{figure*}

%\subsection{Comparison between the CIPSI and CCSD(T) models in the case of C$_2$, N$_2$, O$_2$, F$_2$}
We begin the investigation of the behavior of the basis-set correction by the study of the atomization energies of the C$_2$, N$_2$, O$_2$ and F$_2$ homo-nuclear diatomic molecules in the Dunning cc-pVXZ and cc-pCVXZ in the case of N$_2$ (X=D,T,Q,5) using both the CIPSI algorithm and the CCSD(T). N$_2$, O$_2$ and F$_2$ belong to the G2 set and can be considered as weakly correlated, whereas C$_2$ contains already a non negligible non dynamic correlation component. 

All through this work, we follow the frozen core (FC) convention of Klopper \textit{et. al}\cite{HauKlo-JCP-12} which consists in all-electron calculations for Li-Be, a He core for B-Na atoms and a Ne core for the Al-Cl series. In the context of the DFT correction for the basis-set, this implies that, for a given system in a given basis set $\Bas$, the set of valence orbitals $\Basval$ involved in the definition of the valence interaction $\wbasisval$ and density $\onedmval$ refers to all MOs except the core. 
In order to estimate the CBS limit of each model we use the two-point extrapolation of Ref. \onlinecite{HalHelJorKloKocOls-CPL-98} for the correlation energies and report the corresponding atomization energy which are referred as $D_e^{Q5Z}$ and $D_e^{C(Q5)Z}$ for the cc-pVXZ and cc-pCVXZ basis sets, respectively. All through this work, the valence interaction and density was used when the frozen core approximation was done on the WFT model. 

%\subsection{Convergence of the atomization energies with the WFT models }
As the exFCI calculations were converged with a precision of about 0.2 mH, we can consider the atomization energies computed at this level as near FCI values which we will consider as the reference for a given system in a given basis set. The results for these molecules are shown in Table \ref{tab:diatomics}. 
As one can notice from the data, the convergence of the exFCI atomization energies is slow with respect to the basis set, and the chemical accuracy is barely reached for C$_2$, O$_2$ and F$_2$ even at the cc-pv5Z basis set. Also, the atomization energies are always too small, reflecting the fact that, in a given basis set, a molecule is always more poorly described than the atoms due to the larger number of interacting pairs of electrons in the molecule. 
The same behaviours hold for the CCSD(T) model, and one can notice that the atomization energies of the CCSD(T) are always slightly underestimated with respect to the CIPSI ones, showing that the CCSD(T) ansatz is better suited for the atoms than for the molecule. 

%\subsection{The effect of the basis set correction within the LDA and PBE approximation}
Regarding the effect of the basis set correction, both for the CIPSI and CCSD(T) models, several observations can be done. 
First, in a given basis set, the addition of the basis set correction, both at the LDA and PBE level, improves the result even if it can overestimates the estimated CBS atomization energies by a few tens of kcal/mol (the largest deviation being 0.6 kcal/mol for N$_2$ at the (FC)CCSD(T)+PBE-val level in the cc-pv5z basis). Nevertheless, the deviations observed in the largest basis sets are typically in the range of the accuracy of the atomization energies computed with the CBS extrapolation technique.  
Also, the values obtained with the largest basis sets tends to converge toward a value close to the estimated CBS values. Also, one can observe that the sensitivity to the functional is quite large for the double- and triple-zeta basis sets, where clearly the PBE functional performs better. Nevertheless, from the quadruple-zeta basis set, the LDA and PBE functional agrees within a few tens of kcal/mol. 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Supporting information}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
See {\SI} for raw data of the G2 atomization energies.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{acknowledgements}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
The authors would like to thank... nobody.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{acknowledgements}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\bibliography{G2-srDFT,G2-srDFT-control}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}
