  We propose a duality analysis for obtaining the critical manifold of
two-dimensional spin glasses. Our method is based on the computation of
quenched free energies with periodic and twisted periodic boundary conditions
on a finite basis. The precision can be systematically improved by increasing
the size of the basis, leading to very fast convergence towards the
thermodynamic limit. We apply the method to obtain the phase diagrams of the
random-bond Ising model and $q$-state Potts gauge glasses. In the Ising case,
the Nishimori point is found at $p_N = 0.10929 \pm 0.00002$, in agreement with
and improving on the precision of existing numerical estimations. Similar
precision is found throughout the high-temperature part of the phase diagram.
Finite-size effects are larger in the low-temperature region, but our results
are in qualitative agreement with the known features of the phase diagram. In
particular we show analytically that the critical point in the ground state is
located at finite $p_0$.

Disordered Systems and Neural Networks