numerical semigroup in sagemath

148 views
Skip to first unread message

springfield .gion

unread,
Jul 25, 2017, 8:53:37 AM7/25/17
to sage-support
Hi, I need to create and manipulate the additive semigroups generated by integers (such as those generated by tuples of coprime integers), but I am struggling with the syntax; is there an easy way to create something along the line of:

S = ZZ.Semigroup([2,3])   
S = {0,2,3,4,....}

Thanks in advance

Simon King

unread,
Jul 25, 2017, 9:34:26 AM7/25/17
to sage-s...@googlegroups.com
Hi!
I would expect the syntax
S = NN*[2,3]
(which is meant to create the set of NN-linear combinations of the given
generators 2, 3, and is analogous on how one can create an ideal in
some ring R), but it seems to be not implemented.

Best regards,
Simon

Kwankyu

unread,
Jul 26, 2017, 9:08:43 PM7/26/17
to sage-support
There is a nice GAP package for numerical semigroups. You can use that via sage interface once you install it into the GAP under Sage (which could be tricky). Check

John H Palmieri

unread,
Jul 26, 2017, 11:38:25 PM7/26/17
to sage-support

You can try this:

    S = NN.subsemigroup([2,3])   # or ZZ.subsemigroup([2,3])

although (a) it is not clear to me that this the right thing (it looks like the multiplicative subsemigroup, not the additive one) and (b) I can't do anything sensible with it.

So I tried to use multiplicative semigroups instead. If A is the multiplicative semigroup consisting of powers of 2, then we could ask for the multiplicative subsemigroup generated by 2**2 and 2**3, which should be analogous to what you want. Unfortunately, it is broken:

    sage: A = NN.subsemigroup([2])
    sage: S = A.subsemigroup([2**2, 2**3])

Listing some elements and their base 2 logs is promising:

    sage: list(S.some_elements())  # output omitted since it is a little lengthy
    sage: [log_b(ZZ(_),2) for _ in list(S.some_elements())]   # output omitted

but this is surprising:

    sage: S.cardinality()
    11441

I certainly didn't know that this semigroup was finite, let alone precisely what its cardinality is.

--
John

Reply all
Reply to author
Forward
0 new messages