Ask Your Question
0

List of all invariant factors (finite abelian groups)

asked 0 years ago

po gravatar image

updated 0 years ago

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.

Preview: (hide)

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 ( 0 years ago )

1 Answer

Sort by » oldest newest most voted
3

answered 0 years ago

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]]
Preview: (hide)
link

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 ( 0 years ago )

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: 0 years ago

Seen: 241 times

Last updated: Jul 09 '24