Solution group of Pell's equation Let the Solution space of Pell's equation $ x^2-Dy^2 = 1 $ as $ S_D = \{ (x,y) | x^2-Dy^2=1 \} $.

I know the well-defined trivial injection between $ S_\sqrt D $ and $ {\mathbb{Q}(\sqrt D)}^\times $. Let the trivial injection as $ \varphi $, and let the Solution group of Pell's equation $ G_\sqrt D = \varphi(S_\sqrt D) $.


Then, What group is isomorphic to $ G_\sqrt D $?


I computed when $D$ is $2$, and got an answer that $ G_\sqrt 2 $ and $ \mathbb{Z} \otimes \frac{\mathbb{Z}}{2\mathbb{Z}} $ are isomorphic.

In general cases, how can compute that?

I'll assume that $D$ is a squarefree integer, and that $x$ and $y$ are required to be integers. Then this group is the unit group of the ring of integers of $\Bbb{Q}(\sqrt{D})$. Dirichlet's unit theorem answers your question for the most part.
This theorem tells you that the unit group is a finitely generated abelian group, and its rank is $1$ if $D>0$ and $0$ if $D<0$. This means that for every squarefree integer $D$ there is some finite abelian group $\mu_D$ such that
\begin{eqnarray*}
G_{\sqrt{D}}&\cong&\Bbb{Z}\times\mu_D\qquad&\text{ if }D>0,\\
G_{\sqrt{D}}&\cong&\mu_D,\qquad&\text{ if }D<0.
\end{eqnarray*}
It is a nice exercise to verify that the torsion group $\mu_D$ is $\langle-1\rangle$ if $D\neq-1,-3$. The two exceptional values $D=-1$ and $D=-3$ correspond to the Gaussian and Eisenstein integers, respectively, with torsion groups $\langle i\rangle$ and $\langle\omega\rangle$ that are cyclic of orders $4$ and $6$, respectively.
