Value groups of discrete valuations¶
This file defines additive subgroups of QQ generated by a rational number.
AUTHORS:
- Julian Rueth (2013-09-06): initial version
-
class
sage.rings.padics.discrete_value_group.
DiscreteValueGroup
(generator, category)¶ Bases:
sage.structure.unique_representation.UniqueRepresentation
,sage.structure.parent.Parent
The value group of a discrete valuation, an additive subgroup of QQ generated by
generator
.INPUT:
generator
– a rational number
EXAMPLES:
sage: D1 = DiscreteValueGroup(0); D1 DiscreteValueGroup(0) sage: D2 = DiscreteValueGroup(4/3); D2 DiscreteValueGroup(4/3) sage: D3 = DiscreteValueGroup(-1/3); D3 DiscreteValueGroup(1/3)
TESTS:
sage: TestSuite(D1).run() sage: TestSuite(D2).run() sage: TestSuite(D3).run()
-
index
(other)¶ Return the index of
other
in this group.INPUT:
other
– a subgroup of this group
EXAMPLES:
sage: DiscreteValueGroup(3/8).index(DiscreteValueGroup(3)) 8 sage: DiscreteValueGroup(3).index(DiscreteValueGroup(3/8)) Traceback (most recent call last): ... ValueError: `other` must be a subgroup of this group sage: DiscreteValueGroup(3).index(DiscreteValueGroup(0)) +Infinity sage: DiscreteValueGroup(0).index(DiscreteValueGroup(0)) 1 sage: DiscreteValueGroup(0).index(DiscreteValueGroup(3)) Traceback (most recent call last): ... ValueError: `other` must be a subgroup of this group