Action Principle and Partition Function for the Gravitational Field in Black-Hole Topologies | Synapse