Base class for groups¶
- class sage.groups.group.Group[source]¶
Bases:
Parent
Base class for all groups.
- is_abelian()[source]¶
Test whether this group is abelian.
EXAMPLES:
sage: from sage.groups.group import Group sage: G = Group() sage: G.is_abelian() Traceback (most recent call last): ... NotImplementedError
>>> from sage.all import * >>> from sage.groups.group import Group >>> G = Group() >>> G.is_abelian() Traceback (most recent call last): ... NotImplementedError
- is_commutative()[source]¶
Test whether this group is commutative.
This is an alias for is_abelian, largely to make groups work well with the Factorization class.
(Note for developers: Derived classes should override is_abelian, not is_commutative.)
EXAMPLES:
sage: SL(2, 7).is_commutative() # needs sage.libs.gap sage.modules sage.rings.finite_rings False
>>> from sage.all import * >>> SL(Integer(2), Integer(7)).is_commutative() # needs sage.libs.gap sage.modules sage.rings.finite_rings False
- is_finite()[source]¶
Return
True
if this group is finite.EXAMPLES:
sage: from sage.groups.group import Group sage: G = Group() sage: G.is_finite() Traceback (most recent call last): ... NotImplementedError
>>> from sage.all import * >>> from sage.groups.group import Group >>> G = Group() >>> G.is_finite() Traceback (most recent call last): ... NotImplementedError
- is_multiplicative()[source]¶
Return
True
if the group operation is given by*
(rather than+
).Override for additive groups.
EXAMPLES:
sage: from sage.groups.group import Group sage: G = Group() sage: G.is_multiplicative() True
>>> from sage.all import * >>> from sage.groups.group import Group >>> G = Group() >>> G.is_multiplicative() True
- is_trivial()[source]¶
Return
True
if this group is the trivial group.A group is trivial, if it consists only of the identity element.
Warning
It is in principle undecidable whether a group is trivial, for example, if the group is given by a finite presentation. Thus, this method may not terminate.
EXAMPLES:
sage: groups.presentation.Cyclic(1).is_trivial() True sage: G.<a,b> = FreeGroup('a, b') sage: H = G / (a^2, b^3, a*b*~a*~b) sage: H.is_trivial() False
>>> from sage.all import * >>> groups.presentation.Cyclic(Integer(1)).is_trivial() True >>> G = FreeGroup('a, b', names=('a', 'b',)); (a, b,) = G._first_ngens(2) >>> H = G / (a**Integer(2), b**Integer(3), a*b*~a*~b) >>> H.is_trivial() False
A non-trivial presentation of the trivial group:
sage: F.<a,b> = FreeGroup() sage: J = F / ((~a)*b*a*(~b)^2, (~b)*a*b*(~a)^2) sage: J.is_trivial() True
>>> from sage.all import * >>> F = FreeGroup(names=('a', 'b',)); (a, b,) = F._first_ngens(2) >>> J = F / ((~a)*b*a*(~b)**Integer(2), (~b)*a*b*(~a)**Integer(2)) >>> J.is_trivial() True
- order()[source]¶
Return the number of elements of this group.
This is either a positive integer or infinity.
EXAMPLES:
sage: from sage.groups.group import Group sage: G = Group() sage: G.order() Traceback (most recent call last): ... NotImplementedError
>>> from sage.all import * >>> from sage.groups.group import Group >>> G = Group() >>> G.order() Traceback (most recent call last): ... NotImplementedError
- quotient(H, **kwds)[source]¶
Return the quotient of this group by the normal subgroup \(H\).
EXAMPLES:
sage: from sage.groups.group import Group sage: G = Group() sage: G.quotient(G) Traceback (most recent call last): ... NotImplementedError
>>> from sage.all import * >>> from sage.groups.group import Group >>> G = Group() >>> G.quotient(G) Traceback (most recent call last): ... NotImplementedError
- sage.groups.group.is_Group(x)[source]¶
Return whether
x
is a group object.INPUT:
x
– anything
OUTPUT: boolean
EXAMPLES:
sage: F.<a,b> = FreeGroup() # needs sage.groups sage: from sage.groups.group import is_Group sage: is_Group(F) # needs sage.groups doctest:warning...DeprecationWarning: use instead G in Groups() See https://github.com/sagemath/sage/issues/37449 for details. True sage: is_Group("a string") False
>>> from sage.all import * >>> F = FreeGroup(names=('a', 'b',)); (a, b,) = F._first_ngens(2)# needs sage.groups >>> from sage.groups.group import is_Group >>> is_Group(F) # needs sage.groups doctest:warning...DeprecationWarning: use instead G in Groups() See https://github.com/sagemath/sage/issues/37449 for details. True >>> is_Group("a string") False