n, [names=None]) |
gen,
ngens
Further documentation:
i) |
The
-th generator of the abelian monoid.
sage: F = FreeAbelianMonoid(5,'a') sage: F.gen(0) a_0 sage: F.gen(2) a_2
) |
The number of free generators of the abelian monoid.
sage: F = FreeAbelianMonoid(3000) sage: F.ngens() 3000
Instances of class FreeAbelianMonoid_class also have the following special methods:
__call__,
__contains__,
__repr__
Further documentation:
x) |
Create an element of this abelian monoid from
.
sage: F = FreeAbelianMonoid(10) sage: F(F.gen(2)) x_2 sage: F(1) 1
x) |
Return True if
is an element of this abelian monoid.
sage: F = FreeAbelianMonoid(10) sage: F.gen(2)*F.gen(3) in F True
Note that a monoid on
generators is not considered a submonoid
of one on
generators.
sage: FreeAbelianMonoid(9).gen(2) in F False
However, multiple calls to the monoid constructor do not return multiple distinct monoids.
sage: FreeAbelianMonoid(10).gen(2) in F True