Ask Your Question
0

List of all invariant factors (finite abelian groups)

asked 2024-07-07 22:34:25 +0200

po gravatar image

updated 2024-07-07 22:35:18 +0200

I'm looking for a Sagemath builtin function giving the list of all the possible invariant factors of an abelian group with given finite order (say n)?

In Sagemath terminology, invariant factor is known as elementary divisor

For instance, if n = 48, it should return something like this:

[[2, 2, 2, 6], [2, 2, 12], [2, 24], [4, 12], [48]]

Or perhaps the list of all the possible elementary divisors in the proper sense.

This is not group theory but more or less combinatorics or counting.

edit retag flag offensive close merge delete

Comments

I could be wrong, but I don't think there is a built-in function. Using n=48 (for example) and n.factor()and the ideas at https://math.stackexchange.com/questi..., it shouldn't be hard to write something to do this.

John Palmieri gravatar imageJohn Palmieri ( 2024-07-08 00:27:37 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2024-07-09 14:48:19 +0200

vdelecroix gravatar image

You can easily do it recursively

def elementary_divisors(n, m=1):
    if n == 1:
        yield []
        return
    for d in n.divisors():
        if d == 1 or d % m:
            continue
        for ll in elementary_divisors(n // d, d):
            yield [d] + ll

Then

sage: list(elementary_divisors(48))
[[2, 2, 2, 6], [2, 2, 12], [2, 24], [4, 12], [48]]
edit flag offensive delete link more

Comments

Thanks for this code, it handles efficiently groups of order 2**50 (for instance), there are Partitions(50).cardinality() such groups.

po gravatar imagepo ( 2024-07-10 09:47:39 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2024-07-07 22:34:25 +0200

Seen: 135 times

Last updated: Jul 09