If the gravitational field couples with matter fields, such as a charged scalar field, I know the partition function of the grand canonical ensemble naturally relates to the path-integral expression of gravitational field, how about the canonical ensemble?
Besides the Gibbons-Hawking term, do we need to consider another boundary term to build the partition function of the canonical ensemble? What features are this extra boundary term demanded and why are they ?
I hope someone can give an instructive and brief description on this topic. Thank you in advance.