  Let $\pi$ be a discrete group, and let $G$ be a compact connected Lie group.
Then there is a map
$\Theta\colon\mathrm{Hom}(\pi,G)_0\to\mathrm{map}_*(B\pi,BG)_0$ between the
null-components of the spaces of homomorphism and based maps, which sends a
homomorphism to the induced map between classifying spaces. Atiyah and Bott
studied this map for $\pi$ a surface group, and showed that it is surjective in
rational cohomology. In this paper, we prove that the map $\Theta$ is
surjective in rational cohomology for $\pi=\mathbb{Z}^m$ and the classical
group $G$ except for $SO(2n)$, and that it is not surjective for
$\pi=\mathbb{Z}^m$ with $m\ge 3$ and $G=SO(2n)$ with $n\ge 4$. As an
application, we consider the surjectivity of the map $\Theta$ in rational
cohomology for $\pi$ a finitely generated nilpotent group. We also consider the
dimension of the cokernel of the map $\Theta$ in rational homotopy groups for
$\pi=\mathbb{Z}^m$ and the classical groups $G$ except for $SO(2n)$.
