  We define a (semi-classical) path integral for gravity with Neumann boundary
conditions in $D$ dimensions, and show how to relate this new partition
function to the usual picture of Euclidean quantum gravity. We also write down
the action in ADM Hamiltonian formulation and use it to reproduce the entropy
of black holes and cosmological horizons. A comparison between the
(background-subtracted) covariant and Hamiltonian ways of semi-classically
evaluating this path integral in flat space reproduces the generalized Smarr
formula and the first law. This "Neumann ensemble" perspective on gravitational
thermodynamics is parallel to the canonical (Dirichlet) ensemble of
Gibbons-Hawking and the microcanonical approach of Brown-York.
