# Summing over Adjacency Matrices in Partition Function

I'm currently reading a paper (abstract here) on the statistical mechanics of Random Geometric Graphs, and they start with the statistical mechanics of hidden variable graphs.

They've taken $$a_{ij}$$ as the components of the adjacency matrix, $$\rho(h_i)$$ as the probability for node $$i$$ to have hidden variable $$h_i$$, and $$p(h_i,h_j)$$ as the probability that nodes with $$h_i$$ and $$h_j$$ are connected. From this they get the following path integral for the partition function

$$Z(\mu) = \int \prod_i dh_i \rho(h_i) \sum_{\{a_{ij}\}}\prod_{i

which is alright, but then they do the sum over the $$\{a_{ij}\}$$ and get

$$Z(\mu) = \int \prod_i dh_i \exp \big(\sum_i \ln[\rho(h_i)] + \sum_{i

It's clear to me that that the first term in the exponential corresponds to the product of $$\rho(h_i)$$ but I'm not really sure how to begin on the sum over $$\{a_{ij}\}$$. I thought to use something similar to the transfer matrix method from the 1D ising model, but I can't really figure out how to properly reapply it here. I was also unable to find any reading on doing sums over ensembles like this, but from the way its mentioned in the paper it appears as though its rather standard, so just knowing the proper name for this might be helpful as well.

At constant $$h_i$$, the partition function is already separated over the $$a_{ij}$$ so you can just compute:
$$Z(\mu) = \prod_i (\int dh_i \rho(h_i)) \prod_{i