Derivation of the Average Force in the Cannonical Ensemble

In the cannonical or NVT ensemble the number of particles, volume, and temperature are fixed. If we have a microstates rR3Nr \in \mathbb{R}^{3N} and macrostates RRmR \in \mathbb{R}^m and a coarse-graining function fR3NRmf \in \mathbb{R}^{3N} \longrightarrow \mathbb{R}^m. Each microstate has an energy ER3NRE \in \mathbb{R}^{3N} \longrightarrow \mathbb{R}. In the cannonical ensemble the Hemholtz free energy is:

H(R)=kBTln(Z(R))H(R) = -k_BT \ln(Z(R))

where the partition function is

Z(R)=eE(r)kBTδ(f(r)R)drZ(R) = \int e^{-\frac{E(r)}{k_B T}} \delta(f(r) - R) dr

Taking the gradient of HH

RH(R)=kBTRln(Z(R))=kBTRZ(R)Z(R)\nabla_R H(R) = -k_BT \nabla_R \ln(Z(R)) =-k_BT \dfrac{\nabla_R Z(R)}{Z(R)}
=kBT1Z(R)RZ(R)= -k_BT \dfrac{1}{Z(R)} \nabla_R Z(R)

Then substituting in for ZZ gives

=kBT1Z(R)ReE(r)kBTδ(f(r)R)dr= -k_BT \dfrac{1}{Z(R)} \nabla_R \int e^{-\frac{E(r)}{k_B T}} \delta(f(r) - R) dr

And the only part of the expression that depends on RR is the delta function.

=kBT1Z(R)eE(r)kBTRδ(f(r)R)dr= -k_BT \dfrac{1}{Z(R)} \int e^{-\frac{E(r)}{k_B T}} \nabla_R\delta(f(r) - R) dr

For any function bg(ab)=ag(ab)\nabla_b g(a-b) = -\nabla_a g(a-b) so Rδ(f(r)R)=f(r)δ(f(r)R)\nabla_R \delta(f(r)-R) = -\nabla_{f(r)} \delta(f(r)-R)

=kBT1Z(R)eE(r)kBTf(r)δ(f(r)R)dr= k_BT \dfrac{1}{Z(R)} \int e^{-\frac{E(r)}{k_B T}} \nabla_{f(r)}\delta(f(r) - R) dr

The gradient can be converted with the Jacobian matrix f(r)δ(f(r)R)=(J(f(r))+)Trδ(f(r)R)\nabla_{f(r)}\delta(f(r) - R) = (J(f(r))^+)^T\nabla_{r}\delta(f(r) - R), using the pseudoinverse of the matrix.

=kBT1Z(R)eE(r)kBT(J(f(r))+)Trδ(f(r)R)dr= k_BT \dfrac{1}{Z(R)} \int e^{-\frac{E(r)}{k_B T}} (J(f(r))^+)^T\nabla_{r}\delta(f(r) - R) dr

Next, using the divergence theorem where the total divergence of a volume Ω\Omega is equal to the surface integral Γ\Gamma. If AA is a scalar function and B\vec{B} is a vector function then

ΓA(r)B(r)ndr=Ωr(A(r)B(r))dr\int_{\Gamma} A(r)\vec{B}(r) \cdot \vec{n} dr = \int_{\Omega} \nabla_r \cdot (A(r)\vec{B}(r)) dr

Where n\vec{n} is the normal vector to the surface.

The product rule for gradients

r(A(r)B(r))=rA(r)B(r)+A(r)rB(r)\nabla_r \cdot (A(r)\vec{B}(r)) = \nabla_r A(r) \cdot \vec{B}(r) + A(r) \nabla_r \cdot \vec{B}(r)

substitutded becomes

ΓA(r)B(r)ndr=ΩrA(r)B(r)dr+ΩA(r)rB(r)dr\int_{\Gamma} A(r)\vec{B}(r) \cdot \vec{n} dr = \int_{\Omega} \nabla_r A(r) \cdot \vec{B}(r) dr + \int_{\Omega} A(r) \nabla_r \cdot \vec{B}(r) dr

(J+)T(J^+)^T has dimension m×3Nm \times 3N so we can treat each row as a vector. In the following notation we apply dot products and gradients to each row of (J+)T(J^+)^T. We substitute A=δf(r)RA = \delta{f(r) - R} and B=eE(r)kBT(J(f(r))+)TB = e^{-\frac{E(r)}{k_B T}}(J(f(r))^+)^T.

Γδ(f(r)R)eE(r)kBT(J(f(r))+)T(r)ndr\int_{\Gamma} \delta(f(r)-R)e^{-\frac{E(r)}{k_B T}}(J(f(r))^+)^T(r) \cdot \vec{n} dr
=ΩeE(r)kBT(J(f(r))+)Trδ(f(r)R)dr+ΩreE(r)kBT(J(f(r))+)Tδ(f(r)R)dr= \int_{\Omega} \cdot e^{-\frac{E(r)}{k_B T}}(J(f(r))^+)^T \nabla_r \delta(f(r)- R) dr + \int_{\Omega} \nabla_r \cdot e^{-\frac{E(r)}{k_B T}}(J(f(r))^+)^T \delta(f(r) -R) dr

In the limit that Ω\Omega expands to cover all of R3N\mathbb{R}^{3N} the boundary points xΓx \in \Gamma will contain points that get infinitely far away from the origin limΩR3Nx=\displaystyle \lim_{\Omega \rightarrow \mathbb{R}^{3N}} |x| = \infty. We assume that the energy E(r)E(r) goes towards infinity away from the origin meaning eE(r)kBTe^{-\frac{E(r)}{k_B T}} tends towards zero, and the delta function δ(f(r)R)\delta(f(r) - R) is always zero in the limit towards infinity. With these assumptions the boundary term on the left hand side of the equality disappers.

0=eE(r)kBT(J(f(r))+)Trδ(f(r)R)dr+reE(r)kBT(J(f(r))+)Tδ(f(r)R)dr0 = \int e^{-\frac{E(r)}{k_B T}}(J(f(r))^+)^T \cdot \nabla_r \delta(f(r)- R) dr + \int \nabla_r \cdot e^{-\frac{E(r)}{k_B T}}(J(f(r))^+)^T \delta(f(r) -R) dr

so then

eE(r)kBT(J(f(r))+)Trδ(f(r)R)dr=reE(r)kBT(J(f(r))+)Tδ(f(r)R)dr\int e^{-\frac{E(r)}{k_B T}}(J(f(r))^+)^T \cdot \nabla_r \delta(f(r)- R) dr = - \int \nabla_r \cdot e^{-\frac{E(r)}{k_B T}}(J(f(r))^+)^T \delta(f(r) -R) dr

and dot product-ing each row of a matrix is just matrix multiplication so

eE(r)kBT(J(f(r))+)Trδ(f(r)R)dr=reE(r)kBT(J(f(r))+)Tδ(f(r)R)dr\int e^{-\frac{E(r)}{k_B T}}(J(f(r))^+)^T \nabla_r \delta(f(r)- R) dr = - \int \nabla_r \cdot e^{-\frac{E(r)}{k_B T}}(J(f(r))^+)^T \delta(f(r) -R) dr

Then substitue into the original equation gives

RF(R)=kBT1Z(R)reE(r)kBT(J(f(r))+)Tδ(f(r)R)dr\nabla_R F(R) = -k_BT \dfrac{1}{Z(R)} \int \nabla_r \cdot e^{-\frac{E(r)}{k_B T}}(J(f(r))^+)^T \delta(f(r) -R) dr

Using the gradient product rule again

=kBT1Z(R)(eE(r)kBT(J(f(r))+)TrE(r)kBT+eE(r)kBTr(J(f(r))+)T)δ(f(r)R)dr= -k_BT \dfrac{1}{Z(R)} \int (-e^{-\frac{E(r)}{k_B T}}(J(f(r))^+)^T\dfrac{\nabla_r E(r)}{k_B T} + e^{-\frac{E(r)}{k_B T}}\nabla_r \cdot(J(f(r))^+)^T)\delta(f(r) -R) dr
=1Z(R)eE(r)kBTδ(f(r)R)((J(f(r))+)T(rE(r))kBT(J(f(r))+)Tr)dr= \dfrac{1}{Z(R)} \int e^{-\frac{E(r)}{k_B T}}\delta(f(r) -R) ((J(f(r))^+)^T(\nabla_r E(r)) -k_B T(J(f(r))^+)^T\nabla_r) dr
=(J(f(r))+)T(rE(r))kBT(J(f(r))+)TrR= \bigg\langle (J(f(r))^+)^T(\nabla_r E(r)) -k_B T(J(f(r))^+)^T\nabla_r \bigg\rangle_R
=(J(f(r))+)T(rE(r))kBT(J(f(r))+)TrR= \bigg\langle (J(f(r))^+)^T(\nabla_r E(r)) \bigg\rangle - k_B T \bigg\langle(J(f(r))^+)^T\nabla_r \bigg\rangle_R