Skip to content

Commit

Permalink
Trac #34470: categories of lazy series
Browse files Browse the repository at this point in the history
We should check the categories of our lazy rings:
{{{
sage: L = LazyTaylorSeriesRing(QQ, "x, y") ; L in DiscreteValuationRings
True
sage: L in PrincipalIdealDomains
True
}}}
is wrong.  It is not even a 'valuation ring' , see
https://en.wikipedia.org/wiki/Valuation_ring, because neither `x/y` not
`y/x` is in `L`.  I doubt it should be in `UniqueFactorizationDomains`,
because this category is reserved for constructive UFD's.

In the univariate case, the uniformizer is the generator "x", but this
is not yet implemented:
{{{
sage: L = LazyTaylorSeriesRing(QQ, "x")
sage: L.uniformizer()
...
NotImplementedError: <abstract method uniformizer at 0x7ff26e85acb0>
}}}

Similarly, we have
{{{
sage: LazySymmetricFunctions(SymmetricFunctions(QQ).p()) in
DiscreteValuationRings
True
sage: LazySymmetricFunctions(SymmetricFunctions(QQ).p()) in
PrincipalIdealDomains
True
}}}
which is also wrong.

URL: https://trac.sagemath.org/34470
Reported by: mantepse
Ticket author(s): Martin Rubey
Reviewer(s): Travis Scrimshaw
  • Loading branch information
Release Manager committed Oct 11, 2022
2 parents 77c6eed + 56cef07 commit 87626b0
Show file tree
Hide file tree
Showing 6 changed files with 1,162 additions and 126 deletions.
18 changes: 18 additions & 0 deletions src/sage/combinat/sf/sfa.py
Original file line number Diff line number Diff line change
Expand Up @@ -1722,6 +1722,24 @@ def degree_zero_coefficient(self):
"""
return self.coefficient([])

def is_unit(self):
"""
Return whether this element is a unit in the ring.
EXAMPLES::
sage: m = SymmetricFunctions(ZZ).monomial()
sage: (2*m[2,1] + m[[]]).is_unit()
False
sage: m = SymmetricFunctions(QQ).monomial()
sage: (3/2*m([])).is_unit()
True
"""
m = self.monomial_coefficients(copy=False)
return len(m) <= 1 and self.coefficient([]).is_unit()


#SymmetricFunctionsBases.Filtered = FilteredSymmetricFunctionsBases
#SymmetricFunctionsBases.Graded = GradedSymmetricFunctionsBases

Expand Down
16 changes: 12 additions & 4 deletions src/sage/combinat/species/generating_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,11 @@ def __init__(self, base_ring):
TESTS::
sage: from sage.combinat.species.generating_series import OrdinaryGeneratingSeriesRing
sage: OrdinaryGeneratingSeriesRing.options.halting_precision(15)
sage: R = OrdinaryGeneratingSeriesRing(QQ)
sage: TestSuite(R).run(skip=["_test_associativity", "_test_distributivity", "_test_elements"])
sage: TestSuite(R).run()
sage: OrdinaryGeneratingSeriesRing.options._reset() # reset options
"""
super().__init__(base_ring, names="z")

Expand Down Expand Up @@ -264,8 +267,11 @@ def __init__(self, base_ring):
TESTS::
sage: from sage.combinat.species.generating_series import ExponentialGeneratingSeriesRing
sage: ExponentialGeneratingSeriesRing.options.halting_precision(15)
sage: R = ExponentialGeneratingSeriesRing(QQ)
sage: TestSuite(R).run(skip=["_test_associativity", "_test_distributivity", "_test_elements"])
sage: TestSuite(R).run()
sage: ExponentialGeneratingSeriesRing.options._reset() # reset options
"""
super().__init__(base_ring, names="z")

Expand Down Expand Up @@ -546,8 +552,11 @@ def __init__(self, base_ring, sparse=True):
TESTS::
sage: from sage.combinat.species.generating_series import CycleIndexSeriesRing
sage: CycleIndexSeriesRing.options.halting_precision(12)
sage: R = CycleIndexSeriesRing(QQ)
sage: TestSuite(R).run(skip=["_test_elements", "_test_quo_rem"])
sage: TestSuite(R).run()
sage: CycleIndexSeriesRing.options._reset() # reset options
"""
p = SymmetricFunctions(base_ring).power()
super().__init__(p)
Expand Down Expand Up @@ -659,4 +668,3 @@ def LogarithmCycleIndexSeries(R=QQ):
"""
CIS = CycleIndexSeriesRing(R)
return CIS(_cl_term)

Loading

0 comments on commit 87626b0

Please sign in to comment.