  The Gibbs partition function is an important quantity in describing
statistical properties of a system in thermodynamic equilibrium. There are
several proposals to calculate the partition functions on near-team quantum
computers. However, the existing schemes require many copies of the Gibbs
states to perform an extrapolation for the calculation of the partition
function, and these could be costly performed on the near-term quantum
computers. Here, we propose an efficient scheme to calculate the Gibbs function
with the imaginary time evolution. To calculate the Gibbs function of $N$
qubits, only $2N$ qubits are required in our scheme. After preparing Gibbs
states with different temperatures by using the imaginary time evolution, we
measure the overlap between them on a quantum circuit, and this allows us to
calculate the Gibbs partition function.
