# 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}\) (\(\hat{\omega}^\mathrm{o}\)) equals the identity operator \(\hat{I}^\mathrm{s}\) (\(\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 identity 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.

*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 \(|\Psi \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 summations run over occupied spin orbitals.

### Spin orbitals#

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

and

### Molecular orbitals#

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

and

## 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 = """2
C -0.71500000 0.00000000 0.00000000
O 0.71500000 0.00000000 0.00000000
"""
molecule = vlx.Molecule.read_xyz_string(mol_str)
basis = vlx.MolecularBasis.read(molecule, "cc-pVDZ", ostream=None)
scf_drv = vlx.ScfRestrictedDriver()
scf_drv.ostream.mute()
scf_results = scf_drv.compute(molecule, basis)
```

3Dmol.js failed to load for some reason. Please check your browser console for error messages.

From the converged SCF optimization we can retrieve information such as

```
nocc = molecule.number_of_alpha_electrons()
C = scf_results["C_alpha"] # 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.366128020401
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.97928532728614
```

### 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 the oooo-block of ERIs
eri_drv = vlx.MOIntegralsDriver()
g_oooo = eri_drv.compute_in_memory(molecule, basis, scf_drv.mol_orbs, "chem_oooo")
g_aver = 2 * np.einsum("iijj", g_oooo) - np.einsum("ijji", g_oooo)
print("Expectation value of two-electron Hamiltonian:", g_aver)
```

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

### Expectation value of electronic Hamiltonian#

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

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