On Jan 19, 2008 8:00 AM, John Cremona <john.cremona@gmail.com> wrote:
>
> Either this is a bug or I have been teaching students the wrong thing for years:
>
> (in 2.9.3)
>
> sage: A=AbelianGroup([7,8])
>
> sage: A.invariants()
> [7,8]
>
> sage: A.elementary_divisors()
> [7,8]
>
> There are two sets of invariants for a finite abelian group. The
> "elementary divisors" should be a list of integers n_1,n_2,...,n_k
> with each dividing the next such that A is the direct sum of cyclic
> groups of order n_i. In this case A is cyclic so the list should be
> just [56]. The other set is a list of prime powers and in this case
> is indeed [7,8] though we could argue about the ordering.
>
> Judging by the docstrings, the implemeter of these things in Sage does
> not agree with me, since the code seems to assume that the
> "invariants" are what I am calling the elem. divisors, and the elem.
> divisors are the prime-power factors of the invariants, sorted. In
> which case the invariants is listed above are wrong!
>
> The Sage version of this is all explained in the documentation in file
> sage/groups/abelian_gps/abelian_groups.py, attributed to David Joyner
> . Please will all the algebraists out there tell me whether tey agree
> with me or him! I'm not in a position to consult textbooks right now.
> The docs there refer to Henri Cohen's books so it is possible that
> there is a French/English split here BUT in any case the group I
> defined about is *cyclic* so one of the two outputs is wrong, even if
> we disagree which one!
The problem is that when David Joyner implemented this, doing
sage: A=AbelianGroup([7,8])
would immediately change the invariants to be the elementary divisors.
I.e., it was *impossible*
to make an abelian group with specified generator orders -- the would
also change to be elementary divisors. This was so
hugely painful to use that I fixed AbelianGroup so that one could create
a group with arbitrary generator orders. Unfortunately, I evidently
didn't correctly update the elementary_divisors function.
William