  We consider $(M,d)$ a connected and compact manifold and we denote by
$\mathcal{B}_i$ the Bernoulli space $M^{\Z}$ of sequences represented by
$$x=(... x_{-3},x_{-2},x_{-1},x_0,x_1,x_2,x_3,...),$$ where $x_i$ belongs to
the space (alphabet) $M$. The case where $M=\mathbb{S}^1$, the unit circle, is
of particular interest here. The analogous problem in the one-dimensional
lattice $\mathbb{N}$ is also considered. %In this case we consider the
potential $A: {\cal B}=M^\mathbb{N} \to \mathbb{R}.$ Let $A: \mathcal{B}_i \rar
\R$ be an {\it observable} or {\it potential} defined in the Bernoulli space
$\mathcal{B}_i$. The potential $A$ describes an interaction between sites in
the one-dimensional lattice $M^\mathbb{Z}$. Given a temperature $T$, we analyze
the main properties of the Gibbs state $\hat{\mu}_{\frac{1}{T} A}$ which is a
certain probability measure over ${\cal B}_i$. We denote this setting "the
general XY model". In order to do our analysis we consider the Ruelle operator
associated to $\frac{1}{T} A$, and, we get in this procedure the main
eigenfunction $\psi_{\frac{1}{T} A}$. Later, we analyze selection problems when
temperature goes to zero: a) existence, or not, of the limit (on the uniform
convergence) $$V:=\lim_{T\to 0} T\, \log(\psi_{\frac{1}{T} A}),\,\,\,\,\text{a
question about selection of subaction},$$ and, b) existence, or not, of the
limit (on the weak$^*$ sense) $$\tilde{\mu}:=\lim_{T\to 0}
\hat{\mu}_{\frac{1}{T}\, A},\,\,\,\,\text{a question about selection of
measure}.$$ The existence of subactions and other properties of Ergodic
Optimization are also considered.
