  This thesis focuses on the XY model, the simplest vector spin model, used for
describing numerous physical systems. It is studied for different sources of
quenched disorder: random couplings, random fields, or both them. The belief
propagation algorithm and the cavity method are exploited to solve the model on
the sparse topology provided by Bethe lattices. It is found that the
discretized version of the XY model, the so-called $Q$-state clock model,
provides a reliable and efficient proxy for the continuous model with an error
going to zero exponentially in $Q$, so implying a remarkable speedup in
numerical simulations. Interesting results regard the low-temperature solution
of the spin glass XY model, which is by far more unstable toward the replica
symmetry broken phase with respect to what happens in discrete models.
Moreover, even the random field XY model with ferromagnetic couplings exhibits
a replica symmetry broken phase, at variance with both the fully connected
version of the same model and the diluted random field Ising model, as a
further evidence of a more pronounced glassiness of the diluted XY model. Then,
the instabilities of the spin glass XY model in an external field are
characterized, recognizing different critical lines according to the different
symmetries of the external field. Finally, the inherent structures in the
energy landscape of the spin glass XY model in a random field are described,
exploiting the capability of the zero-temperature belief propagation algorithm
to actually reach the ground state of the system. Remarkably, the density of
soft modes in the Hessian matrix shows a non-mean-field behaviour, typical of
glasses in finite dimension, while the critical point of replica symmetry
instability predicted by the belief propagation algorithm seems to correspond
to a delocalization of such soft modes.
