In the conformal field theories given by the Ising and Dirac models, when the system is in the ground state, the moments of the reduced density matrix of two disjoint intervals and of its partial transpose have been written as partition functions on higher genus Riemann surfaces with symmetry. We show that these partition functions can be expressed as the grand canonical partition functions of the two-dimensional two component classical Coulomb gas on certain circular lattices at specific values of the coupling constant.