# N-electron valence state perturbation theory

In quantum chemistry, n-electron valence state perturbation theory (NEVPT) is a perturbative treatment applicable to multireference CASCI-type wavefunctions. It can be considered as a generalization of the well-known second-order Møller–Plesset perturbation theory to multireference complete active space cases. The theory is directly integrated into many quantum chemistry packages such as MOLCAS, Molpro, DALTON, PySCF and ORCA.
The research performed into the development of this theory led to various implementations. The theory here presented refers to the deployment for the single-state NEVPT, where the perturbative correction is applied to a single electronic state. Research implementations has been also developed for quasi-degenerate cases, where a set of electronic states undergo the perturbative correction at the same time, allowing interaction among themselves. The theory development makes use of the quasi-degenerate formalism by Lindgren and the Hamiltonian multipartitioning technique from Zaitsevskii and Malrieu.

## Theory

Let $\Psi _{m}^{(0)}$ be a zero-order CASCI wavefunction, defined as a linear combination of Slater determinants
    $\Psi _{m}^{(0)}=\sum _{I\in {\rm {CAS}}}C_{I,m}\left|I\right\rangle$
obtained diagonalizing the true Hamiltonian ${\hat {\mathcal {H}}}$ inside the CASCI space
    ${\hat {\mathcal {P}}}_{\rm {CAS}}{\hat {\mathcal {H}}}{\hat {\mathcal {P}}}_{\rm {CAS}}\left|\Psi _{m}^{(0)}\right\rangle =E_{m}^{(0)}\left|\Psi _{m}^{(0)}\right\rangle$
where ${\hat {\mathcal {P}}}_{\rm {CAS}}$ is the projector inside the CASCI space. It is possible to define perturber wavefunctions in NEVPT as zero-order wavefunctions of the outer space (external to CAS) where $k$ electrons are removed from the inactive part (core and virtual orbitals) and added to the valence part (active orbitals). At second order of perturbation $-2\leq k\leq 2$. Decomposing the zero-order CASCI wavefunction as an antisymmetrized product of the inactive part $\Phi _{c}$ and a valence part $\Psi _{m}^{v}$
    $\left|\Psi _{m}^{(0)}\right\rangle =\left|\Phi _{c}\Psi _{m}^{v}\right\rangle$
then the perturber wavefunctions can be written as
    $\left|\Psi _{l,\mu }^{k}\right\rangle =\left|\Phi _{l}^{-k}\Psi _{\mu }^{v+k}\right\rangle$
The pattern of inactive orbitals involved in the procedure can be grouped as a collective index $l$, so to represent the various perturber wavefunctions as $\Psi _{l,\mu }^{k}$, with $\mu$ an enumerator index for the different wavefunctions. The number of these functions is relative to the degree of contraction of the resulting perturbative space.
Supposing indexes $i$ and $j$ referring to core orbitals, $a$ and $b$ referring to active orbitals and $r$ and $s$ referring to virtual orbitals, the possible excitation schemes are:
* two electrons from core orbitals to virtual orbitals (the active space is not enriched nor depleted of electrons, therefore $k=0$)
* one electron from a core orbital to a virtual orbital, and one electron from a core orbital to an active orbital (the active space is enriched with one electron, therefore $k=+1$)
* one electron from a core orbital to a virtual orbital, and one electron from an active orbital to a virtual orbital (the active space is depleted with one electron, therefore $k=-1$)
* two electrons from core orbitals to active orbitals (active space enriched with two electrons, $k=+2$)
* two electrons from active orbitals to virtual orbitals (active space depleted with two electrons, $k=-2$)
These cases always represent situations where interclass electronic excitations happen. Other three excitation schemes involve a single interclass excitation plus an intraclass excitation internal to the active space:
* one electron from a core orbital to a virtual orbital, and an internal active-active excitation ($k=0$)
* one electron from a core orbital to an active orbital, and an internal active-active excitation ($k=+1$)
* one electron from an active orbital to a virtual orbital, and an internal active-active excitation ($k=-1$)

### Totally Uncontracted Approach

A possible approach is to define the perturber wavefunctions into Hilbert spaces $S_{l}^{k}$ defined by those determinants with given k and l labels. The determinants characterizing these spaces can be written as a partition comprising the same inactive (core + virtual) part $\Phi _{l}^{-k}$ and all possible valence (active) parts $\Psi _{I}^{k}$
    $S_{l}^{k}\ {\stackrel {\mathrm {def} }{=}}\ \{\Phi _{l}^{-k}\Psi _{I}^{k}\}$
The full dimensionality of these spaces can be exploited to obtain the definition of the perturbers, by diagonalizing the Hamiltonian inside them
    ${\hat {\mathcal {P}}}_{S_{l}^{k}}{\hat {\mathcal {H}}}{\hat {\mathcal {P}}}_{S_{l}^{k}}\left|\Phi _{l}^{-k}\Psi _{\mu }^{v+k}\right\rangle =E_{l,\mu }\left|\Phi _{l}^{-k}\Psi _{\mu }^{v+k}\right\rangle$
This procedure is impractical given its high computational cost: for each $S_{l}^{k}$ space, a diagonalization of the true Hamiltonian must be performed. Computationally, is preferable to improve the theoretical development making use of the modified Dyall's Hamiltonian ${\hat {\mathcal {H}}}^{D}$. This Hamiltonian behaves like the true Hamiltonian inside the CAS space, having the same eigenvalues and eigenvectors of the true Hamiltonian projected onto the CAS space. Also, given the decomposition for the wavefunction defined before, the action of the Dyall's Hamiltonian can be partitioned into
    ${\hat {\mathcal {H}}}^{D}\left|\Phi _{l}^{-k}\Psi _{\mu }^{v+k}\right\rangle =E_{l,\mu }^{k}\left|\Phi _{l}^{-k}\Psi _{\mu }^{v+k}\right\rangle$
stripping out the constant contribution of the inactive part and leaving a subsystem to be solved for the valence part
    ${\hat {\mathcal {H}}}_{v}^{D}\left|\Psi _{\mu }^{v+k}\right\rangle =E_{\mu }^{k}\left|\Psi _{\mu }^{v+k}\right\rangle$
The total energy $E_{l,\mu }^{k}$ is the sum of $E_{\mu }^{k}$ and the energies of the orbitals involved in the definition of the inactive part $\Phi _{l}^{-k}$. This introduces the possibility to perform a single diagonalization of the valence Dyall's Hamiltonian on the CASCI zero-order wavefunction and evaluate the perturber energies using the property depicted above.

### Strongly Contracted Approach

A different choice in the development of the NEVPT approach is to choose a single function for each space $S_{l}^{k}$, leading to the Strongly Contracted (SC) scheme. A set of perturbative operators are used to produce a single function for each space, defined as the projection inside each space ${\hat {\mathcal {P}}}_{S_{l}^{k}}$ of the application of the Hamiltonian to the contracted zero order wavefunction. In other words,
    $\Psi _{l}^{k}={\hat {\mathcal {P}}}_{S_{l}^{k}}{\hat {\mathcal {H}}}\Psi _{m}^{(0)}$
where ${\hat {\mathcal {P}}}_{S_{l}^{k}}$ is the projector onto the subspace. This can be equivalently written as the application of a specific part of the Hamiltonian to the zero-order wavefunction
    $\Psi _{l}^{k}=V_{l}^{k}\Psi _{m}^{(0)}$
For each space, appropriate operators can be devised. We will not present their definition, as it could result overkilling. Suffice to say that the resulting perturbers are not normalized, and their norm
    $N_{l}^{k}=\left\langle \Psi _{l}^{k}\left.\right|\Psi _{l}^{k}\right\rangle =\left\langle \Psi _{m}^{(0)}\left|\left(V_{l}^{k}\right)^{+}V_{l}^{k}\right|\Psi _{m}^{(0)}\right\rangle$
plays an important role in the Strongly Contracted development. To evaluate these norms, the spinless density matrix of rank not higher than three between the $\Psi _{m}^{(0)}$ functions are needed.
An important property of the $\Psi _{l}^{k}$ is that any other function of the space $S_{l}^{k}$ which is orthogonal to $\Psi _{l}^{k}$ do not interact with the zero-order wavefunction through the true Hamiltonian. It is possible to use the $\Psi _{l}^{k}$ functions as a basis set for the expansion of the first-order correction to the wavefunction, and also for the expression of the zero-order Hamiltonian by means of a spectral decomposition
    ${\hat {\mathcal {H}}}_{0}=\sum _{lk}\left|\Psi _{l}^{k}^{\prime }\right\rangle E_{l}^{k}\left\langle \Psi _{l}^{k}^{\prime }\right\rangle +\sum _{m}\left|\Psi _{m}^{(0)}\right\rangle E_{m}^{(0)}\left\langle \Psi _{m}^{(0)}\right|$
where $\left|\Psi _{l}^{k}^{\prime }\right\rangle$ are the normalized $\left|\Psi _{l}^{k}\right\rangle$.
The expression for the first-order correction to the wavefunction is therefore
    $\Psi _{m}^{(1)}=\sum _{kl}\left|\Psi _{l}^{k}^{\prime }\right\rangle {\frac {\left\langle \Psi _{l}^{k}^{\prime }\left|{\hat {\mathcal {H}}}\right|\Psi _{m}^{(0)}\right\rangle }{E_{m}^{(0)}-E_{l}^{k}}}=\sum _{kl}\left|\Psi _{l}^{k}^{\prime }\right\rangle {\frac {\sqrt {N_{l}^{k}}}{E_{m}^{(0)}-E_{l}^{k}}}$
and for the energy is
    $E_{m}^{(2)}=\sum _{kl}{\frac {\left|\left\langle \Psi _{l}^{k}^{\prime }\left|{\hat {\mathcal {H}}}\right|\Psi _{m}^{(0)}\right\rangle \right|^{2}}{E_{m}^{(0)}-E_{l}^{k}}}=\sum _{kl}{\frac {N_{l}^{k}}{E_{m}^{(0)}-E_{l}^{k}}}$
This result still misses a definition of the perturber energies $E_{l}^{k}$, which can be defined in a computationally advantageous approach by means of the Dyall's Hamiltonian
    $E_{l}^{k}={\frac {1}{N_{l}^{k}}}\left\langle \Psi _{l}^{k}\left|{\hat {\mathcal {H}}}^{D}\right|\Psi _{l}^{k}\right\rangle$
leading to
    $N_{l}^{k}E_{l}^{k}=\left\langle \Psi _{m}^{(0)}\left|\left(V_{l}^{k}\right)^{+}{\hat {\mathcal {H}}}^{D}V_{l}^{k}\right|\Psi _{m}^{(0)}\right\rangle =\left\langle \Psi _{m}^{(0)}\left|\left(V_{l}^{k}\right)^{+}V_{l}^{k}{\hat {\mathcal {H}}}^{D}\right|\Psi _{m}^{(0)}\right\rangle +\left\langle \Psi _{m}^{(0)}\left|\left(V_{l}^{k}\right)^{+}\left[{\hat {\mathcal {H}}}^{D},V_{l}^{k}\right]\right|\Psi _{m}^{(0)}\right\rangle$
Developing the first term and extracting the inactive part of the Dyall's Hamiltonian it can be obtained
    $E_{l}^{k}=E_{m}^{(0)}+\Delta \epsilon _{l}+{\frac {1}{N_{l}^{k}}}\left\langle \Psi _{m}^{(0)}\left|\left(V_{l}^{k}\right)^{+}\left[{\hat {\mathcal {H}}}_{v},V_{l}^{k}\right]\right|\Psi _{m}^{(0)}\right\rangle$
with $\Delta \epsilon _{l}$ equal to the sum of the orbital energies of the newly occupied virtual orbitals minus the orbital energies of the unoccupied core orbitals.
The term that still needs to be evaluated is the bracket involving the commutator. This can be obtained developing each $V$ operator and substituting. To obtain the final result it is necessary to evaluate Koopmans matrices and density matrices involving only active indexes. An interesting case is represented by the contribution for the $V_{ijrs}^{(0)}$ case, which is trivial and can be demonstrated identical to the Møller–Plesset second-order contribution
    $E_{m}^{(2)}\left(S_{rsij}^{0}\right)=-{\frac {N_{rsij}^{0}}{\epsilon _{r}+\epsilon _{s}-\epsilon _{i}-\epsilon _{j}}}$
NEVPT2 can therefore be seen as a generalized form of MP2 to multireference wavefunctions.

### Partially Contracted Approach

An alternative approach, named Partially Contracted (PC) is to define the perturber wavefunctions in a subspace ${\overline {S}}_{l}^{k}$ of $S_{l}^{k}$ with dimensionality higher than one (like in case of the Strongly Contracted approach). To define this subspace, a set of functions $\Phi$ is generated by means of the $V_{l}^{k}$ operators, after decontraction of their formulation. For example, in the case of the $V_{rsi}^{-1}$ operator
    $V_{rsi}^{-1}=\gamma _{rs}\sum _{a}\left(\left\langle rs\left.\right|ia\right\rangle E_{ri}E_{sa}+\left\langle sr\left.\right|ia\right\rangle E_{si}E_{ra}\right)\quad r\leq s$
The Partially Contracted approach makes use of functions $\Phi _{risa}=E_{ri}E_{sa}\Psi _{m}^{(0)}$ and $\Phi _{risa}=E_{si}E_{ra}\Psi _{m}^{(0)}$. These functions must be orthonormalized and purged of linear dependencies which may arise. The resulting set spans the ${\overline {S}}_{rsi}^{-1}$ space.
Once all the ${\overline {S}}_{l}^{k}$ spaces have been defined, we can obtain as usual a set of perturbers from the diagonalization of the Hamiltonian (true or Dyall) inside this space
    ${\hat {\mathcal {P}}}_{{\overline {S}}_{l}^{k}}{\hat {\mathcal {H}}}{\hat {\mathcal {P}}}_{{\overline {S}}_{l}^{k}}\left|\Psi _{l\mu }^{k}\right\rangle =E_{l,\mu }^{k}\left|\Psi _{l\mu }^{k}\right\rangle$
As usual, the evaluation of the Partially Contracted perturbative correction by means of the Dyall Hamiltonian involves simply manageable entities for nowadays computers.
Although the Strongly Contracted approach makes use of a perturbative space with very low flexibility, in general it provides values in very good agreement with those obtained by the more decontracted space defined for the Partially Contracted approach. This can be probably explained by the fact that the Strongly Contracted perturbers are a good average of the totally decontracted perturbative space.
The Partially Contracted evaluation has a very little overhead in computational cost with respect to the Strongly Contracted one, therefore they are normally evaluated together.

## Properties

NEVPT is blessed with many important properties, making the approach very solid and reliable. These properties arise both from the theoretical approach used and on the Dyall's Hamiltonian particular structure:
* Size consistency: NEVPT is size consistent (strict separable). Briefly, if A and B are two non-interacting systems, the energy of the supersystem A-B is equal to the sum of the energy of A plus the energy of B taken by themselves ($E(A-B)=E(A)+E(B)$). This property is of particular importance to obtain correctly behaving dissociation curves.
* Absence of intruder states: in perturbation theory, divergencies can occur if the energy of some perturber happens to be nearly equal to the energy of the zero-order wavefunction. This situation, which is due to the presence of an energy difference at the denominator, can be avoided if the energies associated to the perturbers are guaranteed to be never nearly equal to the zero-order energy. NEVPT satisfies this requirement.
* Invariance under active orbital rotation: The NEVPT results are stable if an intraclass active-active orbital mixing occurs. This arises both from the structure of the Dyall Hamiltonian and the properties of a CASSCF wavefunction. This property has been also extended to the intraclass core-core and virtual-virtual mixing, thanks to the Non Canonical NEVPT approach, allowing to apply a NEVPT evaluation without performing an orbital canonization (which is required, as we saw previously)
* Spin purity is guaranteed: The resulting wave functions are guaranteed to be spin pure, due to the spin-free formalism.
* Efficiency: although not a formal theoretical property, computational efficiency is highly important for the evaluation on medium-size molecular systems. The current limit of the NEVPT application is largely dependent on the feasibility of the previous CASSCF evaluation, which scales factorially with respect to the active space size. The NEVPT implementation using the Dyall's Hamiltonian involves the evaluation of Koopmans' matrices and density matrices up to the four-particle density matrix spanning only active orbitals. This is particularly convenient, given the small size of currently used active spaces.
* Partitioning into additive classes: The perturbative correction to the energy is additive on eight different contributions. Although the evaluation of each contribution has a different computational cost, this fact can be used to improve performance, by parallelizing each contribution to a different processor.