Let $G$ and $H$ be two finitely generated groups, where $H$ is abelian. I'm curious in which cases $Hom(G,H)$ turns out to be cyclic or virtually cyclic.



When is Hom(G,H) cyclic?
If $H$ is abelian, any homomorphism $G \to H$ factors through the abelianization $G/[G, G] \to H$, so we may assume WLOG that $G$ is also abelian, so we can apply the structure theorem to both $G$ and $H$. Then $\text{Hom}(G, H)$ is virtually cyclic if and only if it has rank at most $1$, hence if and only if both $G$ and $H$ themselves have rank at most $1$, and this is easy to test (it reduces to linear algebra over $\mathbb{Q}$ given a presentation of $G$ and $H$). 


To see when $\text{Hom}(G, H)$ is cyclic, write $G\_p, H\_p$ for the $p$-parts of $G, H$ respectively and $\mathbb{Z}^a, \mathbb{Z}^b$ for the torsion-free parts. Then
$$\text{Hom}(G, H) \cong H^a \oplus \bigoplus\_p \text{Hom}(G\_p, H\_p).$$


In particular, it has rank $ab \le 1$. If $ab = 1$, then $H \cong \mathbb{Z}$ and $G$ has rank $1$ so that $\text{Hom}(G, H) \cong \mathbb{Z}$.


If $ab = 0$, then $\text{Hom}(G, H)$ is finite, so it is cyclic if and only if its $p$-parts
$$\text{Hom}(G, H)\_p \cong H\_p^a \oplus \text{Hom}(G\_p, H\_p)$$


are cyclic. This can occur in a few different ways; either $\text{Hom}(G\_p, H\_p) = 0, a = 1$, and $H\_p$ is cyclic, or $H\_p = 0$, or $a = 0$ and $G\_p, H\_p$ are both cyclic. 


