← Background
Background · Integrals and Reduced Descriptions

How Is a Variable Removed by Integration, and What Survives?

An N-electron wavefunction depends on 3N positions and N spins. The electron density depends on three numbers. The route between them is one operation, repeated: integrate over what is not asked about.

1. Two Variables, One at a Time

For a function f(x,y) continuous on a closed bounded region, or absolutely integrable, Fubini's theorem says that a double integral can be done as two single integrals, in either order. The inner integral removes one variable and returns a function of the other:

Fubini∬DfdA=∫[∫f(x,y)dy]dx=∫[∫f(x,y)dx]dy.

Worked example: f=xy on the triangle 0≤y≤x≤1. The limits of the inner integral depend on the outer variable, so they change with the order.

Left: at fixed x the inner variable runs from 0 to x. Right: at fixed y it runs from y to 1. The red arrow is one inner integral.
  1. Vertical slices, inner integral: ∫0xxydy=x[y2/2]0x=x3/2.
  2. Outer integral: ∫01x3/2dx=1/8.
  3. Horizontal slices, inner integral: ∫y1xydx=y(1−y2)/2.
  4. Outer integral: ∫01(y−y3)/2dy=1/4−1/8=1/8. The two orders agree.

2. Marginals: What Is Kept and What Is Lost

If p(x,y)≥0 integrates to one, the inner integral pX(x)=∫p(x,y)dy is the marginal density of x. Any average of a function of x alone needs only pX:

⟨g(x)⟩=∬g(x)p(x,y)dxdy=∫g(x)[∫p(x,y)dy]dx=∫g(x)pX(x)dx.
  1. Take p=x+y on the unit square. Check normalization: ∫01∫01(x+y)dydx=∫01(x+1/2)dx=1.
  2. Marginal: pX(x)=x+1/2.
  3. Average: ⟨x⟩=∫01x(x+1/2)dx=1/3+1/4=7/12.
  4. Information lost: p=1 and p=1+(2x−1)(2y−1) both have pX=1 and pY=1, because ∫01(2y−1)dy=0. The correlation between x and y is not recoverable from the marginals.

3. The Electron Density as a Marginal

Write xk=(𝐫k,σk) for space and spin, and let dxk mean ∑σk∫dVk. The probability density for all electrons is |Ψ(x1,…,xN)|2, normalized to one.

  1. Probability of electron 1 near 𝐫, whatever its spin and wherever the others are: p1(𝐫)=∑σ1∫|Ψ(𝐫,σ1,x2,…,xN)|2dx2⋯dxN.
  2. Antisymmetry gives |Ψ|2 unchanged when two labels are swapped, so pk=p1 for every k.
  3. The density of electrons of any label is the sum ∑kpk=Np1.
Electron density: N times the integral over everything elseρ(𝐫)=N∑σ1∫|Ψ(𝐫,σ1,x2,…,xN)|2dx2⋯dxN,∫ℝ3ρdV=N.

Worked Example: A Closed-Shell Pair

  1. Ψ=ϕ(𝐫1)ϕ(𝐫2)(α1β2−β1α2)/2, with ∫|ϕ|2dV=1.
  2. Sum over both spins: ∑σ1σ2|α1β2−β1α2|2/2=(1+1)/2=1.
  3. Integrate over 𝐫2: ∫|ϕ(𝐫2)|2dV2=1.
  4. Multiply by N=2: ρ(𝐫)=2|ϕ(𝐫)|2.

Worked Example: Two Electrons of the Same Spin

  1. Ψ=[a(1)b(2)−b(1)a(2)]/2, with a,b real and orthonormal, and both spins α.
  2. Square: |Ψ|2=[a12b22+b12a22−2a1b1a2b2]/2.
  3. Integrate over 𝐫2: ∫b2=1, ∫a2=1, and ∫ab=0 removes the cross term. So ∫|Ψ|2dV2=(a12+b12)/2.
  4. Multiply by 2: ρ=a2+b2.

4. Keep Two Coordinates: The Pair Density

Stopping one integration earlier keeps the correlation, with the same normalization as in reduced density matrices and cumulants:

Pair density and its sum ruleρ2(𝐫1,𝐫2)=N(N−1)∑σ1σ2∫|Ψ|2dx3⋯dxN,∫ρ2(𝐫1,𝐫2)dV2=(N−1)ρ(𝐫1).

For the same-spin pair, ρ2=(a1b2−b1a2)2, which vanishes at 𝐫1=𝐫2. Take the two lowest states of a box of unit length, a=2sin⁡πx and b=2sin⁡2πx.

Violet contours: the pair density. Red: the density obtained by integrating x2 out. The left half of the box holds exactly one electron on average.
  1. Mean number in the left half Ω=[0,1/2]: ∫Ωρdx=∫Ωa2+∫Ωb2=1/2+1/2=1.
  2. Overlaps restricted to Ω: Saa=Sbb=1/2, and Sab=∫01/2(cos⁡πx−cos⁡3πx)dx=1/π+1/(3π)=4/(3π).
  3. Probability that both are in Ω: P2=∬ΩΩ|Ψ|2=SaaSbb−Sab2=1/4−16/(9π2), equal to 0.069873 (midpoint quadrature: 0.069873).
  4. By the left-right symmetry of a2,b2, the probability of neither is also P2. The number in Ω is 0, 1 or 2 with mean 1, so its variance is 2P2, equal to 0.1397. The density gives the mean; the variance needs the pair density.

5. Integrating Out a Direction of Space: Formaldehyde

The same operation works on the three coordinates of ρ itself. Integrating the density perpendicular to a molecular plane gives a column density, σ(y,z)=∫ρ(x,y,z)dx. It is a different function from the slice ρ(0,y,z) that the molecular graph is usually drawn on.

Formaldehyde, restricted Hartree–Fock, def2-TZVP basis (Cartesian), at a fixed input geometry in bohr: O (0, 0, 1.14), C (0, 0, −1.14), H (0, ±1.77, −2.25); the geometry was not optimized. Left: slice, with critical points and bond paths from libqtaim. Right: the marginal, by quadrature in x of the libqtaim density.
  1. libqtaim finds 4 attractors, 3 bond critical points, 0 ring and 0 cage points of the three-dimensional ρ; the alternating sum is 1.
  2. Fubini checks the marginal: ∬σdydz=∫ρdV=N=16. The two quadratures give 16.000008 and 16.000000.
  3. Along the C–O axis the minimum of the marginal σ(0,z) lies at z= −0.481 bohr, while the minimum of ρ(0,0,z), the bond critical point, lies at z= −0.397 bohr (libqtaim: −0.3972). Integrating a direction away moves, and in general can create or destroy, critical points, so topology is analyzed on ρ itself.

6. Gaussian Integrating-Out

One family of integrals stays in its own family after a variable is removed. Take f=exp⁡[−(ax2+2bxy+cy2)] with c>0 and ac>b2.

  1. Collect the terms containing y into a square: cy2+2bxy=c(y+bx/c)2−b2x2/c (see completing the square).
  2. Substitute into the exponent: f=exp⁡[−(a−b2/c)x2]exp⁡[−c(y+bx/c)2].
  3. Shift u=y+bx/c, du=dy: ∫−∞∞e−cu2du=π/c.
The y variable integrated out∫−∞∞fdy=π/ce−(a−b2/c)x2.
a=1, b=0.7, c=0.9. At x=0.8 a trapezoidal sum over y gives 1.3958305929 and the formula 1.3958305929. The marginal is wider than the slice because a−b2/c is smaller than a.

7. Effective Potentials: What Is Left Behind

Read the exponent as minus a quadratic energy S(x,y)=ax2+2bxy+cy2. Setting ∂S/∂y=2bx+2cy=0 gives y*=−bx/c and S(x,y*)=(a−b2/c)x2, the same exponent as the integral. For a quadratic dependence with a constant c, integrating a variable out and eliminating it at its stationary point give the same effective function of what remains.

The Electrostatic Potential in ℒBO

In the chemical Lagrangian density the Coulomb field enters locally as ℒφ=−ρcφ+|∇φ|2/(8π), with ρc the microscopic net charge density (nuclei minus electrons, configuration by configuration).

  1. Vary φ: δ∫ℒφdV=∫[−ρcδφ+∇φ⋅∇δφ/(4π)]dV.
  2. Integrate by parts, with the surface term at infinity vanishing: ∫[−ρc−∇2φ/(4π)]δφdV=0, so ∇2φ=−4πρc.
  3. On the solution, ∫|∇φ|2/(8π)=−∫φ∇2φ/(8π)=∫ρcφ/2.
  4. Add the source term: Lφ=−12∫ρcφdV=−12∬ρc(𝐫)ρc(𝐫′)/|𝐫−𝐫′|dVdV′. This is minus the Coulomb energy. The infinite self-interaction of each point particle is dropped by convention.

Two Things That Are Different

8. Why an Atom Integrates ρ Over Ω

An atom in a molecule is a region Ω of ordinary space. Its population restricts one electron to Ω and leaves all the others unrestricted:

Atomic populationN(Ω)=∫ΩρdV=N∫ΩdV1∑σ1∫|Ψ|2dx2⋯dxN.

Any partition of space makes the N(Ω) add to N. The zero-flux atom, ∇ρ⋅𝐧=0 on its surface, has a property that an arbitrary region lacks: its two kinetic energies agree. (This is necessary for such an atom but does not by itself identify one: other special surfaces can have zero net flux by cancellation.) The two kinetic densities differ by −∇2ρ/4, so by Gauss's theorem

L(Ω)=∫ΩℒBOdV=K(Ω)−G(Ω)=−14∫Ω∇2ρdV=−14∮∂Ω∇ρ⋅𝐧dS=0.

Here ℒBO denotes the on-shell electronic part, integrated over all other electrons. The variational argument for this surface is in calculus of variations.

The molecular-plane traces of the interatomic surfaces, followed downhill from each bond critical point, with the populations from the finer quadrature below.
libqtaim basin integrals, as computed, on two grids (grid sizes in the text below). No value is rescaled.
AtomN(Ω), coarseN(Ω), fineG(Ω), fineL(Ω), coarseL(Ω), fine
O9.282089.2820775.5502−5.0 × 10−5−4.9 × 10−5
C4.779214.7793536.96731.3 × 10−4−8.9 × 10−5
H0.969330.969330.60304.7 × 10−65.0 × 10−6
H0.969330.969330.60304.7 × 10−65.0 × 10−6

The sum of N(Ω) minus N is −4.7 × 10−5 on the coarse angular grid (48, 96) and 8.6 × 10−5 on the fine grid (72, 144); the radial rule of the library's basin integrator is adaptive. The nonzero L(Ω) values measure quadrature error. SCF energy: −113.916561 hartree; largest relative difference between the libqtaim and PySCF densities at 200 test points, each difference divided by the larger of the reference density and 10−3: 9.4 × 10−15.

9. Exercises

  1. Reverse the order of ∫01∫x1e−y2dydx and evaluate it.
    Answer

    The region is 0≤x≤y≤1, so the integral is ∫01ye−y2dy=(1−e−1)/2.

  2. Show that ∫ρ2dV1dV2=N(N−1).
    Answer

    Integrate the sum rule: ∫(N−1)ρdV1=(N−1)N.

  3. For the box pair, evaluate ρ2(x,x).
    Answer

    (a(x)b(x)−b(x)a(x))2=0 for every x.

  4. Integrate y out of e−(x2+2xy+2y2).
    Answer

    a=1,b=1,c=2, giving π/2e−x2/2.

References

Comments, questions or contributions? Please open an issue or a pull request on GitHub.