Skip to content

Commit ee35418

Browse files
committed
Merge branch 'public/rings/lazy_series_revert-34383' of trac.sagemath.org:sage into t/34413/implement_derivatives_of_lazy_series
2 parents 10cfc11 + 3d6d39f commit ee35418

File tree

8 files changed

+1246
-294
lines changed

8 files changed

+1246
-294
lines changed

src/sage/categories/commutative_algebras.py

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
# http://www.gnu.org/licenses/
1111
#******************************************************************************
1212

13+
from sage.misc.cachefunc import cached_method
1314
from sage.categories.category_with_axiom import CategoryWithAxiom_over_base_ring
1415
from sage.categories.algebras import Algebras
16+
from sage.categories.commutative_rings import CommutativeRings
17+
from sage.categories.tensor import TensorProductsCategory
1518

1619
class CommutativeAlgebras(CategoryWithAxiom_over_base_ring):
1720
"""
@@ -36,7 +39,7 @@ class CommutativeAlgebras(CategoryWithAxiom_over_base_ring):
3639
True
3740
sage: TestSuite(CommutativeAlgebras(ZZ)).run()
3841
39-
Todo:
42+
.. TODO::
4043
4144
- product ( = Cartesian product)
4245
- coproduct ( = tensor product over base ring)
@@ -58,3 +61,32 @@ def __contains__(self, A):
5861
"""
5962
return super().__contains__(A) or \
6063
(A in Algebras(self.base_ring()) and hasattr(A, "is_commutative") and A.is_commutative())
64+
65+
class TensorProducts(TensorProductsCategory):
66+
"""
67+
The category of commutative algebras constructed by tensor product of commutative algebras.
68+
"""
69+
70+
@cached_method
71+
def extra_super_categories(self):
72+
"""
73+
EXAMPLES::
74+
75+
sage: Algebras(QQ).Commutative().TensorProducts().extra_super_categories()
76+
[Category of commutative rings]
77+
sage: Algebras(QQ).Commutative().TensorProducts().super_categories()
78+
[Category of tensor products of algebras over Rational Field,
79+
Category of commutative algebras over Rational Field]
80+
81+
TESTS::
82+
83+
sage: X = algebras.Shuffle(QQ, 'ab')
84+
sage: Y = algebras.Shuffle(QQ, 'bc')
85+
sage: X in Algebras(QQ).Commutative()
86+
True
87+
sage: T = tensor([X, Y])
88+
sage: T in CommutativeRings()
89+
True
90+
"""
91+
return [CommutativeRings()]
92+

src/sage/categories/graded_algebras_with_basis.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,23 @@ def free_graded_module(self, generator_degrees, names=None):
126126
from sage.modules.fp_graded.free_module import FreeGradedModule
127127
return FreeGradedModule(self, generator_degrees, names=names)
128128

129+
def formal_series_ring(self):
130+
r"""
131+
Return the completion of all formal linear combinations of
132+
``self`` with finite linear combinations in each homogeneous
133+
degree (computed lazily).
134+
135+
EXAMPLES::
136+
137+
sage: NCSF = NonCommutativeSymmetricFunctions(QQ)
138+
sage: S = NCSF.Complete()
139+
sage: L = S.formal_series_ring()
140+
sage: L
141+
Lazy completion of Non-Commutative Symmetric Functions over
142+
the Rational Field in the Complete basis
143+
"""
144+
from sage.rings.lazy_series_ring import LazyCompletionGradedAlgebra
145+
return LazyCompletionGradedAlgebra(self)
129146

130147
class ElementMethods:
131148
pass

src/sage/combinat/partition.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,20 @@ def __truediv__(self, p):
10571057

10581058
return SkewPartition([self[:], p])
10591059

1060+
def stretch(self, k):
1061+
"""
1062+
Return the partition obtained by multiplying each part with the
1063+
given number.
1064+
1065+
EXAMPLES::
1066+
1067+
sage: p = Partition([4,2,2,1,1])
1068+
sage: p.stretch(3)
1069+
[12,6,6,3,3]
1070+
1071+
"""
1072+
return _Partitions([k * p for p in self])
1073+
10601074
def power(self, k):
10611075
r"""
10621076
Return the cycle type of the `k`-th power of any permutation

src/sage/combinat/sf/powersum.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,8 @@ def frobenius(self, n):
476476
477477
:meth:`~sage.combinat.sf.sfa.SymmetricFunctionAlgebra_generic_Element.plethysm`
478478
"""
479-
dct = {Partition([n * i for i in lam]): coeff
480-
for (lam, coeff) in self.monomial_coefficients().items()}
479+
dct = {lam.stretch(n): coeff
480+
for lam, coeff in self.monomial_coefficients().items()}
481481
return self.parent()._from_dict(dct)
482482

483483
adams_operation = frobenius

0 commit comments

Comments
 (0)