Complete Discrete Valuation Rings (CDVR) and Fields (CDVF)¶
- class sage.categories.complete_discrete_valuation.CompleteDiscreteValuationFields[source]¶
- Bases: - Category_singleton- The category of complete discrete valuation fields. - EXAMPLES: - sage: Zp(7) in CompleteDiscreteValuationFields() # needs sage.rings.padics False sage: QQ in CompleteDiscreteValuationFields() False sage: LaurentSeriesRing(QQ, 'u') in CompleteDiscreteValuationFields() True sage: Qp(7) in CompleteDiscreteValuationFields() # needs sage.rings.padics True sage: TestSuite(CompleteDiscreteValuationFields()).run() - >>> from sage.all import * >>> Zp(Integer(7)) in CompleteDiscreteValuationFields() # needs sage.rings.padics False >>> QQ in CompleteDiscreteValuationFields() False >>> LaurentSeriesRing(QQ, 'u') in CompleteDiscreteValuationFields() True >>> Qp(Integer(7)) in CompleteDiscreteValuationFields() # needs sage.rings.padics True >>> TestSuite(CompleteDiscreteValuationFields()).run() - class ElementMethods[source]¶
- Bases: - object- denominator()[source]¶
- Return the denominator of this element normalized as a power of the uniformizer - EXAMPLES: - sage: # needs sage.rings.padics sage: K = Qp(7) sage: x = K(1/21) sage: x.denominator() 7 + O(7^21) sage: x = K(7) sage: x.denominator() 1 + O(7^20) - >>> from sage.all import * >>> # needs sage.rings.padics >>> K = Qp(Integer(7)) >>> x = K(Integer(1)/Integer(21)) >>> x.denominator() 7 + O(7^21) >>> x = K(Integer(7)) >>> x.denominator() 1 + O(7^20) - Note that the denominator lives in the ring of integers: - sage: x.denominator().parent() # needs sage.rings.padics 7-adic Ring with capped relative precision 20 - >>> from sage.all import * >>> x.denominator().parent() # needs sage.rings.padics 7-adic Ring with capped relative precision 20 - When the denominator is indistinguishable from 0 and the precision on the input is \(O(p^n)\), the return value is \(1\) if \(n\) is nonnegative and \(p^(-n)\) otherwise: - sage: # needs sage.rings.padics sage: x = K(0, 5); x O(7^5) sage: x.denominator() 1 + O(7^20) sage: x = K(0, -5); x O(7^-5) sage: x.denominator() 7^5 + O(7^25) - >>> from sage.all import * >>> # needs sage.rings.padics >>> x = K(Integer(0), Integer(5)); x O(7^5) >>> x.denominator() 1 + O(7^20) >>> x = K(Integer(0), -Integer(5)); x O(7^-5) >>> x.denominator() 7^5 + O(7^25) 
 - numerator()[source]¶
- Return the numerator of this element, normalized in such a way that \(x = x.numerator() / x.denominator()\) always holds true. - EXAMPLES: - sage: # needs sage.rings.padics sage: K = Qp(7, 5) sage: x = K(1/21) sage: x.numerator() 5 + 4*7 + 4*7^2 + 4*7^3 + 4*7^4 + O(7^5) sage: x == x.numerator() / x.denominator() True - >>> from sage.all import * >>> # needs sage.rings.padics >>> K = Qp(Integer(7), Integer(5)) >>> x = K(Integer(1)/Integer(21)) >>> x.numerator() 5 + 4*7 + 4*7^2 + 4*7^3 + 4*7^4 + O(7^5) >>> x == x.numerator() / x.denominator() True - Note that the numerator lives in the ring of integers: - sage: x.numerator().parent() # needs sage.rings.padics 7-adic Ring with capped relative precision 5 - >>> from sage.all import * >>> x.numerator().parent() # needs sage.rings.padics 7-adic Ring with capped relative precision 5 
 - valuation()[source]¶
- Return the valuation of this element. - EXAMPLES: - sage: K = Qp(7) # needs sage.rings.padics sage: x = K(7); x # needs sage.rings.padics 7 + O(7^21) sage: x.valuation() # needs sage.rings.padics 1 - >>> from sage.all import * >>> K = Qp(Integer(7)) # needs sage.rings.padics >>> x = K(Integer(7)); x # needs sage.rings.padics 7 + O(7^21) >>> x.valuation() # needs sage.rings.padics 1 
 
 
- class sage.categories.complete_discrete_valuation.CompleteDiscreteValuationRings[source]¶
- Bases: - Category_singleton- The category of complete discrete valuation rings. - EXAMPLES: - sage: Zp(7) in CompleteDiscreteValuationRings() # needs sage.rings.padics True sage: QQ in CompleteDiscreteValuationRings() False sage: QQ[['u']] in CompleteDiscreteValuationRings() True sage: Qp(7) in CompleteDiscreteValuationRings() # needs sage.rings.padics False sage: TestSuite(CompleteDiscreteValuationRings()).run() - >>> from sage.all import * >>> Zp(Integer(7)) in CompleteDiscreteValuationRings() # needs sage.rings.padics True >>> QQ in CompleteDiscreteValuationRings() False >>> QQ[['u']] in CompleteDiscreteValuationRings() True >>> Qp(Integer(7)) in CompleteDiscreteValuationRings() # needs sage.rings.padics False >>> TestSuite(CompleteDiscreteValuationRings()).run() - class ElementMethods[source]¶
- Bases: - object- denominator()[source]¶
- Return the denominator of this element normalized as a power of the uniformizer - EXAMPLES: - sage: # needs sage.rings.padics sage: K = Qp(7) sage: x = K(1/21) sage: x.denominator() 7 + O(7^21) sage: x = K(7) sage: x.denominator() 1 + O(7^20) - >>> from sage.all import * >>> # needs sage.rings.padics >>> K = Qp(Integer(7)) >>> x = K(Integer(1)/Integer(21)) >>> x.denominator() 7 + O(7^21) >>> x = K(Integer(7)) >>> x.denominator() 1 + O(7^20) - Note that the denominator lives in the ring of integers: - sage: x.denominator().parent() # needs sage.rings.padics 7-adic Ring with capped relative precision 20 - >>> from sage.all import * >>> x.denominator().parent() # needs sage.rings.padics 7-adic Ring with capped relative precision 20 - When the denominator is indistinguishable from 0 and the precision on the input is \(O(p^n)\), the return value is \(1\) if \(n\) is nonnegative and \(p^(-n)\) otherwise: - sage: # needs sage.rings.padics sage: x = K(0, 5); x O(7^5) sage: x.denominator() 1 + O(7^20) sage: x = K(0, -5); x O(7^-5) sage: x.denominator() 7^5 + O(7^25) - >>> from sage.all import * >>> # needs sage.rings.padics >>> x = K(Integer(0), Integer(5)); x O(7^5) >>> x.denominator() 1 + O(7^20) >>> x = K(Integer(0), -Integer(5)); x O(7^-5) >>> x.denominator() 7^5 + O(7^25) 
 - lift_to_precision(absprec=None)[source]¶
- Return another element of the same parent with absolute precision at least - absprec, congruent to this element modulo the precision of this element.- INPUT: - absprec– integer or- None(default:- None); the absolute precision of the result. If- None, lifts to the maximum precision allowed.
 - Note - If setting - absprecthat high would violate the precision cap, raises a precision error. Note that the new digits will not necessarily be zero.- EXAMPLES: - sage: # needs sage.rings.padics sage: R = ZpCA(17) sage: R(-1, 2).lift_to_precision(10) 16 + 16*17 + O(17^10) sage: R(1, 15).lift_to_precision(10) 1 + O(17^15) sage: R(1, 15).lift_to_precision(30) Traceback (most recent call last): ... PrecisionError: precision higher than allowed by the precision cap sage: (R(-1, 2).lift_to_precision().precision_absolute() ....: == R.precision_cap()) True sage: R = Zp(5); c = R(17, 3); c.lift_to_precision(8) # needs sage.rings.padics 2 + 3*5 + O(5^8) sage: c.lift_to_precision().precision_relative() == R.precision_cap() # needs sage.rings.padics True - >>> from sage.all import * >>> # needs sage.rings.padics >>> R = ZpCA(Integer(17)) >>> R(-Integer(1), Integer(2)).lift_to_precision(Integer(10)) 16 + 16*17 + O(17^10) >>> R(Integer(1), Integer(15)).lift_to_precision(Integer(10)) 1 + O(17^15) >>> R(Integer(1), Integer(15)).lift_to_precision(Integer(30)) Traceback (most recent call last): ... PrecisionError: precision higher than allowed by the precision cap >>> (R(-Integer(1), Integer(2)).lift_to_precision().precision_absolute() ... == R.precision_cap()) True >>> R = Zp(Integer(5)); c = R(Integer(17), Integer(3)); c.lift_to_precision(Integer(8)) # needs sage.rings.padics 2 + 3*5 + O(5^8) >>> c.lift_to_precision().precision_relative() == R.precision_cap() # needs sage.rings.padics True 
 - numerator()[source]¶
- Return the numerator of this element, normalized in such a way that \(x = x.numerator() / x.denominator()\) always holds true. - EXAMPLES: - sage: # needs sage.rings.padics sage: K = Qp(7, 5) sage: x = K(1/21) sage: x.numerator() 5 + 4*7 + 4*7^2 + 4*7^3 + 4*7^4 + O(7^5) sage: x == x.numerator() / x.denominator() True - >>> from sage.all import * >>> # needs sage.rings.padics >>> K = Qp(Integer(7), Integer(5)) >>> x = K(Integer(1)/Integer(21)) >>> x.numerator() 5 + 4*7 + 4*7^2 + 4*7^3 + 4*7^4 + O(7^5) >>> x == x.numerator() / x.denominator() True - Note that the numerator lives in the ring of integers: - sage: x.numerator().parent() # needs sage.rings.padics 7-adic Ring with capped relative precision 5 - >>> from sage.all import * >>> x.numerator().parent() # needs sage.rings.padics 7-adic Ring with capped relative precision 5 
 - valuation()[source]¶
- Return the valuation of this element. - EXAMPLES: - sage: R = Zp(7) # needs sage.rings.padics sage: x = R(7); x # needs sage.rings.padics 7 + O(7^21) sage: x.valuation() # needs sage.rings.padics 1 - >>> from sage.all import * >>> R = Zp(Integer(7)) # needs sage.rings.padics >>> x = R(Integer(7)); x # needs sage.rings.padics 7 + O(7^21) >>> x.valuation() # needs sage.rings.padics 1