  We develop an efficient method to compute the torus partition function of the
six-vertex model exactly for finite lattice size. The method is based on the
algebro-geometric approach to the resolution of Bethe ansatz equations
initiated in a previous work, and on further ingredients introduced in the
present paper. The latter include rational $Q$-system, primary decomposition,
algebraic extension and Galois theory. Using this approach, we probe new
structures in the solution space of the Bethe ansatz equations which enable us
to boost the efficiency of the computation. As an application, we study the
zeros of the partition function in a partial thermodynamic limit of $M \times
N$ tori with $N \gg M$. We observe that for $N \to \infty$ the zeros accumulate
on some curves and give a numerical method to generate the curves of
accumulation points.
