# Operators and matrix elements

## Contents

# Operators and matrix elements#

## Single-electron systems#

Operators acting on single-electron wave functions, or spin orbitals (ignoring the freedom of charge conjugation), take the form

Pure spatial (or spin) operators refer to the situation when \(\hat{\omega}^\mathrm{s}\) (or \(\hat{\omega}^\mathrm{o}\)) equals the identity operator \(\hat{I}^\mathrm{s}\) (or \(\hat{I}^\mathrm{o}\)).

Note

All electronic operators have components in all underlying vector spaces. However, it is a common practice to leave out a reference to identiy operators.

Example: The kinetic energy operator can be written

## Many-electron systems#

### One-electron operators#

One-electron operators take the form

Despite the name, one-electron operators act on many-electron wave functions, but each term in the sum has a non-trivial action only in a single particle space. Furthermore, the non-trivial one-particle operator \(\hat{\omega}\) is identical in all terms in the sum.

Note

It is a common practice to leave out a reference to identiy operators.

Example: The kinetic energy operator for a \(N\)-electron system can be written

where the particle index, \(i\), is used to denote in which particle space the action takes place.

#### Action of one-electron operators on Slater determinants#

Consider a one-electron operator for an \(N\)-electron system

The action of this operator on a Slater determinant results in a sum of \(N\) Slater determinants, each with a single modified spin-orbital

where the modified orbitals are given by

#### Commutator of one-electron operators#

Consider two one-electron operators for an \(N\)-electron system

The commutator of these operators results in another one-electron operator

### Two-electron operators#

Two-electron operators take the form

Analogous to one-electron operators, two-electron operators act on many-electron wave functions, but each term in the sum has a non-trivial action only in two particle spaces. Furthermore, the non-trivial two-particle operator \(\hat{\omega}(i,j)\) is identical in all terms in the sum, where the particle indices, \(i\) and \(j\), are used to denote in which two particle spaces the action takes place.

Example: The Coulomb repulsion operator for a \(N\)-electron system can be written

where \(e\) is the elementary charge.

## Matrix elements for Slater determinants#

Let \(|\Phi \rangle\) be a Slater determinant for an \(N\)-electron system.

With \(\hat{\Omega}\) being a one-electron operator, the pertinent matrix elements become

With \(\hat{\Omega}\) being a two-electron operator, the pertinent matrix elements become

The two-electron integrals are here written in physicist’s notation and summation run over occupied spin orbitals.

### Spin orbitals#

Integrals with respect to spin orbitals are in this book expressed in the physicist’s notation:

and

### Molecular orbitals#

Integrals with respect to spatial (or molecular) orbitals are in this book expressed in the chemist’s notation:

and

## Reduced particle density operators#

Consider an \(N\)-electron system in a state represented by a general state vector that can be expressed as a linear combination of Slater determinants

The one- and two-particle particle reduced densities can then be evaluated as expectation values of one- and two-particle operators, respectively, using the expressions given above for matrix elements.

The resulting formulas will be expressions involving products of molecular orbitals from which we can identify one- and two-particle density matrices.

### One-particle density operator#

The one-particle density can be written as an expectation of a one-electron operator according to

with

After evaluation of this expectation value, the one-particle density matrix, \(D\), is identified from the expression

For a state represented by a single Slater determinant, the one-electron density becomes

where the summation run over the \(N\) occupied spin orbitals. Consequently, the density matrix is in this case equal to the identity matrix in the occupied–occupied block and zero elsewhere.

### Two-particle density#

The two-particle density can be written as an expectation of a two-electron operator according to

with

After evaluation of this expectation value, the two-particle density matrix, \(D\), is identified from the expression

For a state represented by a single Slater determinant, the two-electron density becomes

where the summations run over the \(N\) occupied spin orbitals.

## Molecular Hamiltonian#

Molecular quatum mechanics is concerned with the motions of electrons *and* nuclei, governed in turn by the molecular Hamiltonian

where the nuclear kinetic energy operator is given by

The electromagnetic forces acting on nuclei and electrons are of the same order of magnitude, but since nuclear masses are at least 1800 times larger (\(m_\mathrm{p} / m_\mathrm{e} \approx 1836.15\)), we expect nuclear velocities to be much smaller than those of electrons. To decouple their motions, it is a common practice to work in the basis of the eigenstates of the electronic Hamiltonian

introducing in order terms associated with the electronic kinetic energy, electron–nuclear attraction, electron–electron repulsion, and nuclear–nuclear repulsion. We use variables \(\mathbf{r}\) and \(\mathbf{R}\) to collectively denote the sets of electronic and nuclear coordinates, respectively.

In a brief notation, the electronic Hamiltonian is expressed in terms of the one- and two-electron components in addition to the nuclear repulsion term

For a given *fixed* nuclear configuration the nuclear repulsion amounts a mere scalar number as we solve the time-independent Schrödinger equation

where it is noted that the electronic wave functions (indexed with \(K\)) have a parametric dependence on the nuclear coordinates. We use these states as a basis in which we express a given total rovibronic molecular wave function according to

## Adiabatic Born–Oppenheimer approximation#

In view of the differences in nuclear and electronic velocities, it is reasonable to assume that the variations of the electronic wave functions with respect to nuclear displacements are small. Moreover, the summation over electronic states is often approximated with a single term. This is known as the adiabatic approximation and it is accurate as long as the electronic states are well separated in energy.

We arrive at the adiabatic Born–Oppenheimer approximation where the total molecular wave function takes the form of a product

or, in a state vector notation,

In cases where it is clear from the context, the electronic state index on the nuclear state vector \(|k\rangle\) is often omitted.

## Matrix element of electronic Hamiltonian#

```
import numpy as np
import veloxchem as vlx
mol_str = """
C 0.00000000 0.00000000 0.00000000
O 0.00000000 0.00000000 1.43
"""
molecule = vlx.Molecule.read_str(mol_str, units="angstrom")
basis = vlx.MolecularBasis.read(molecule, "cc-pVDZ")
scf_drv = vlx.ScfRestrictedDriver()
scf_drv.compute(molecule, basis)
```

Some information after the SCF optimization.

```
nocc = molecule.number_of_alpha_electrons()
C = scf_drv.scf_tensors["C"] # MO coefficient matrix
E_nuc = molecule.nuclear_repulsion_energy()
E_tot = scf_drv.get_scf_energy()
E_elec = E_tot - E_nuc
print("Number of occupied orbitals:", nocc)
print(f"Nuclear repulsion energy: {E_nuc : 19.12f}")
print(f"Electronic energy: {E_elec : 26.12f}")
print(f"Total Hartree-Fock energy: {E_tot : 18.12f}")
```

```
Number of occupied orbitals: 7
Nuclear repulsion energy: 17.762591694646
Electronic energy: -130.366128020400
Total Hartree-Fock energy: -112.603536325754
```

### Expectation value of one-electron Hamiltonian#

For a closed-shell Slater determinant, the expectation value of a one-electron operator becomes

where the sum now runs over doubly occpuied molecular orbitals, referring to spatial integrals.

```
kin_drv = vlx.KineticEnergyIntegralsDriver()
T_ao = kin_drv.compute(molecule, basis).to_numpy()
T = np.einsum("ai, ab, bj -> ij", C, T_ao, C)
npot_drv = vlx.NuclearPotentialIntegralsDriver()
V_ao = -npot_drv.compute(molecule, basis).to_numpy()
V = np.einsum("ai, ab, bj -> ij", C, V_ao, C)
# core Hamiltonian
h = T + V
h_aver = 2 * np.einsum("ii", h[:nocc, :nocc])
print("Expectation value of one-electron Hamiltonian:", h_aver)
```

```
Expectation value of one-electron Hamiltonian: -188.97928532728577
```

### Expectation value of two-electron Hamiltonian#

For a closed-shell Slater determinant, the expectation value of a two-electron operator becomes

where the sum now runs over doubly occpuied molecular orbitals, referring to spatial two-electron integrals (Coulomb and exchange) written in the chemist’s notation.

```
# obtain all-occupied block ("OOOO") of ERIs in physicist's notation
moints_drv = vlx.MOIntegralsDriver()
ijij = moints_drv.compute_in_mem(molecule, basis, scf_drv.mol_orbs, "OOOO")
g_aver = 2 * np.einsum("ijij", ijij[:, :, :, :]) - np.einsum("ijji", ijij[:, :, :, :])
print("Expectation value of two-electron Hamiltonian:", g_aver)
```

```
Expectation value of two-electron Hamiltonian: 58.61315730688542
```

### Expectation value of electronic Hamiltonian#

```
print(f"Expectation value of electronic Hamiltonian: {h_aver + g_aver:.12f}")
```

```
Expectation value of electronic Hamiltonian: -130.366128020400
```