def __cmp__(self, other): """ Compare torsion subgroups. INPUT: - ``other`` - an object If other is a torsion subgroup, the abelian varieties are compared. Otherwise, the generic behavior for finite abelian variety subgroups is used. EXAMPLE:: sage: G = J0(11).rational_torsion_subgroup(); H = J0(13).rational_torsion_subgroup() sage: G == G True sage: G < H # since 11 < 13 True sage: G > H False sage: G < 5 # random (meaningless since it depends on memory layout) False """ if isinstance(other, RationalTorsionSubgroup): return cmp(self.abelian_variety(), other.abelian_variety()) return FiniteSubgroup.__cmp__(self, other)
def __cmp__(self, other): """ Compare torsion subgroups. INPUT: - ``other`` - an object If other is a torsion subgroup, the abelian varieties are compared. Otherwise, the generic behavior for finite abelian variety subgroups is used. EXAMPLE:: sage: from sage_modabvar import J0 sage: G = J0(11).rational_torsion_subgroup(); H = J0(13).rational_torsion_subgroup() sage: G == G True sage: G < H # since 11 < 13 True sage: G > H False sage: G < 5 # random (meaningless since it depends on memory layout) False """ if isinstance(other, RationalTorsionSubgroup): return cmp(self.abelian_variety(), other.abelian_variety()) return FiniteSubgroup.__cmp__(self, other)
def __init__(self, abvar): """ Create the torsion subgroup. INPUT: - ``abvar`` - a modular abelian variety EXAMPLES:: sage: T = J0(14).rational_torsion_subgroup(); T Torsion subgroup of Abelian variety J0(14) of dimension 1 sage: type(T) <class 'sage.modular.abvar.torsion_subgroup.RationalTorsionSubgroup'> """ FiniteSubgroup.__init__(self, abvar)
def __init__(self, abvar): """ Create the torsion subgroup. INPUT: - ``abvar`` - a modular abelian variety EXAMPLES:: sage: T = J0(14).rational_torsion_subgroup(); T Torsion subgroup of Abelian variety J0(14) of dimension 1 sage: type(T) <class 'sage.modular.abvar.torsion_subgroup.RationalTorsionSubgroup_with_category'> """ FiniteSubgroup.__init__(self, abvar)