Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge branch 'u/mantepse/categories_of_lazy_series' of https://github…
Browse files Browse the repository at this point in the history
….com/sagemath/sagetrac-mirror into u/tscrim/categories_lazy_series-34470
  • Loading branch information
tscrim committed Sep 18, 2022
2 parents 3d5b8cf + cdf821a commit aa593b5
Show file tree
Hide file tree
Showing 5 changed files with 634 additions and 107 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
22 changes: 18 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,13 @@ 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()
Options are remembered across doctests::
sage: OrdinaryGeneratingSeriesRing.options.halting_precision(None)
"""
super().__init__(base_ring, names="z")

Expand Down Expand Up @@ -264,8 +269,13 @@ 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()
Options are remembered across doctests::
sage: ExponentialGeneratingSeriesRing.options.halting_precision(None)
"""
super().__init__(base_ring, names="z")

Expand Down Expand Up @@ -546,8 +556,13 @@ def __init__(self, base_ring, sparse=True):
TESTS::
sage: from sage.combinat.species.generating_series import CycleIndexSeriesRing
sage: CycleIndexSeriesRing.options.halting_precision(15)
sage: R = CycleIndexSeriesRing(QQ)
sage: TestSuite(R).run(skip=["_test_elements", "_test_quo_rem"])
sage: TestSuite(R).run()
Options are remembered across doctests::
sage: CycleIndexSeriesRing.options.halting_precision(None)
"""
p = SymmetricFunctions(base_ring).power()
super().__init__(p)
Expand Down Expand Up @@ -659,4 +674,3 @@ def LogarithmCycleIndexSeries(R=QQ):
"""
CIS = CycleIndexSeriesRing(R)
return CIS(_cl_term)

Loading

0 comments on commit aa593b5

Please sign in to comment.