### Abstract:

Quantum field theory and statistical mechanics share many common features in their formulations. A very important example is the similar form of the partition function. Exact computations of the partition function can help us understand non-perturbative physics and calculate many physical quantities. In this thesis, we study a number of examples in both quantum field theory and statistical mechanics, in which one can compute the partition function exactly. Recently, people have found a consistent way of defining supersymmetric theories on curved backgrounds. This gives interesting deformations to the original supersymmetric theories defined on the flat spacetime. Using the supersymmetric localization method one is able to calculate the exact partition functions of some supersymmetric gauge theories on compact manifolds, which provides us with many more rigorous checks of dualities and many geometrical properties of the models. We discuss the localization of supersymmetric gauge theories on squashed $S^3$, round $S^2$ and $T^2$. Entanglement entropy and R\'enyi entropy are key concepts in some branches of condensed matter physics, for instance, quantum phase transition, topological phase and quantum computation. They also play an increasingly important role in high energy physics and black-hole physics. A generalized and related concept is the supersymmetric R\'enyi entropy. In the thesis we review these concepts and their relation with the partition function on a sphere. We also consider the thermal correction to the R\'enyi entropy at finite temperature. Partition functions can also be used to relate two apparently different theories. One example discussed in the thesis is the Gross-Pitaevskii equation and a string-like nonlinear sigma model. The Gross-Pitaevskii equation is known as a mean-field description of Bose-Einstein condensates. It has some nontrivial solutions like the vortex line and the dark soliton. We give a field theoretic derivation of these solutions, and discuss recent developments of the relation between the Gross-Pitaevskii equation and the Kardar-Parisi-Zhang equation. Moreover, a (2+1)-dimensional system consisting of only vortex solutions can be described by a statistical model called point-vortex model. We evaluate its partition function exactly, and find a phase transtition at negative temperature. The order parameter, the critical exponent and the correlation function are also discussed.