Can someone explain the precise difference between of direct sum and direct product of groups?

As far as I know, the direct product of groups $G_1, \dots , G_n$ is the group with the underlying set being the cartesian product and the operation done component wise. It's not clear to me what a direct sum of groups $G_1, \dots ,G_n$ really means. Wikipedia makes it sound like the term "direct sum" is used to refer to the direct product of abelian groups.

Some clarification would be appreciated.

-

The direct sum of a family $\{G_i:i\in I\}$ of groups is the same as the direct product when $I$ is finite. When $I$ is infinite, however, the direct sum is a proper subgroup of the direct product: it’s the set of $g\in\prod_{i\in I}G_i$ such that $g_i=1_{G_i}$ for all but at most finitely many $i\in I$.

-
Also, in the category of abelian groups, the direct sum is the coproduct whereas the direct product is the product. Roughly speaking, this means that it's easy to construct maps from the coproduct but to the product. –  Hew Wolff Jan 17 '13 at 21:49
Also, note that the set $\prod_{i\in I}G_i$ is a group whose elements are all vectors $(g_k)$ in the Cartesian product and whose operation is $(g_k)+(g'_k)=(g_k+g'_k)$. –  B. S. Jan 18 '13 at 3:44
@Babak: That is also true of the direct sum. The difference is that in the direct sum all but finitely many of the $g_k$ and $g_k'$ are the identity in $G_k$. –  Brian M. Scott Jan 18 '13 at 3:46
Ofcourse, Brian. You noted it before. I just noted the operation and the nature of these structures. Nice illustration. +1 –  B. S. Jan 18 '13 at 3:49
@Babak: Sorry; I didn’t realize what you were doing. I thought that you were trying to point out another difference between the two. –  Brian M. Scott Jan 18 '13 at 3:50
show 1 more comment

There is the unrestricted and restricted direct product. It seems to me that it is most usual (e.g. as in the post by Brian Scott) to call "direct product" the unrestricted one and "direct sum" the unrestricted one, but some people (notably Russian) call "direct product" the restricted one and "cartesian product" the unrestricted one. Also some people (such as Serre) say that "direct sum" is meaningless because it is not a coproduct in the category of groups (unlike the unrestricted direct product of modules over a given ring). Besides, I think there was an attempt by Bourbaki to promote "free sum" to mean "free product" but it seems that "free product" is almost universal now.

-