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

Commit

Permalink
rather use rename
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Aug 22, 2022
1 parent eba9d16 commit c862151
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/sage/categories/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,9 +580,9 @@ def tensor_factors(self):
EXAMPLES::
sage: F = CombinatorialFreeModule(ZZ, [1,2])
sage: F.__custom_name = "F"
sage: F.rename("F")
sage: G = CombinatorialFreeModule(ZZ, [3,4])
sage: G.__custom_name = "G"
sage: G.rename("G")
sage: T = tensor([F, G]); T
F # G
sage: T.tensor_factors()
Expand Down
41 changes: 20 additions & 21 deletions src/sage/combinat/free_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -1159,8 +1159,8 @@ class CombinatorialFreeModule_Tensor(CombinatorialFreeModule):
We construct two free modules, assign them short names, and construct their tensor product::
sage: F = CombinatorialFreeModule(ZZ, [1,2]); F.__custom_name = "F"
sage: G = CombinatorialFreeModule(ZZ, [3,4]); G.__custom_name = "G"
sage: F = CombinatorialFreeModule(ZZ, [1,2]); F.rename("F")
sage: G = CombinatorialFreeModule(ZZ, [3,4]); G.rename("G")
sage: T = tensor([F, G]); T
F # G
Expand Down Expand Up @@ -1313,9 +1313,9 @@ def tensor_factors(self):
EXAMPLES::
sage: F = CombinatorialFreeModule(ZZ, [1,2])
sage: F.__custom_name = "F"
sage: F.rename("F")
sage: G = CombinatorialFreeModule(ZZ, [3,4])
sage: G.__custom_name = "G"
sage: G.rename("G")
sage: T = tensor([F, G]); T
F # G
sage: T.tensor_factors()
Expand Down Expand Up @@ -1447,8 +1447,8 @@ def tensor_constructor(self, modules):
EXAMPLES::
sage: F = CombinatorialFreeModule(ZZ, [1,2]); F.__custom_name = "F"
sage: G = CombinatorialFreeModule(ZZ, [3,4]); G.__custom_name = "G"
sage: F = CombinatorialFreeModule(ZZ, [1,2]); F.rename("F")
sage: G = CombinatorialFreeModule(ZZ, [3,4]); G.rename("G")
sage: H = CombinatorialFreeModule(ZZ, [5,6]); H.rename("H")
sage: f = F.monomial(1) + 2 * F.monomial(2)
Expand Down Expand Up @@ -1487,8 +1487,8 @@ def _tensor_of_elements(self, elements):
EXAMPLES::
sage: F = CombinatorialFreeModule(ZZ, [1,2]); F.__custom_name = "F"
sage: G = CombinatorialFreeModule(ZZ, [3,4]); G.__custom_name = "G"
sage: F = CombinatorialFreeModule(ZZ, [1,2]); F.rename("F")
sage: G = CombinatorialFreeModule(ZZ, [3,4]); G.rename("G")
sage: H = CombinatorialFreeModule(ZZ, [5,6]); H.rename("H")
sage: f = F.monomial(1) + 2 * F.monomial(2)
Expand Down Expand Up @@ -1622,9 +1622,9 @@ class CombinatorialFreeModule_CartesianProduct(CombinatorialFreeModule):
We construct two free modules, assign them short names, and construct their Cartesian product::
sage: F = CombinatorialFreeModule(ZZ, [4,5]); F.__custom_name = "F"
sage: G = CombinatorialFreeModule(ZZ, [4,6]); G.__custom_name = "G"
sage: H = CombinatorialFreeModule(ZZ, [4,7]); H.__custom_name = "H"
sage: F = CombinatorialFreeModule(ZZ, [4,5]); F.rename("F")
sage: G = CombinatorialFreeModule(ZZ, [4,6]); G.rename("G")
sage: H = CombinatorialFreeModule(ZZ, [4,7]); H.rename("H")
sage: S = cartesian_product([F, G])
sage: S
F (+) G
Expand Down Expand Up @@ -1696,7 +1696,7 @@ def _repr_(self):
sage: F = CombinatorialFreeModule(ZZ, [2,4,5])
sage: CP = cartesian_product([F, F]); CP # indirect doctest
Free module generated by {2, 4, 5} over Integer Ring (+) Free module generated by {2, 4, 5} over Integer Ring
sage: F.__custom_name = "F"; CP
sage: F.rename("F"); CP
F (+) F
"""
from sage.categories.cartesian_product import cartesian_product
Expand All @@ -1716,8 +1716,8 @@ def cartesian_embedding(self, i):
EXAMPLES::
sage: F = CombinatorialFreeModule(ZZ, [4,5]); F.__custom_name = "F"
sage: G = CombinatorialFreeModule(ZZ, [4,6]); G.__custom_name = "G"
sage: F = CombinatorialFreeModule(ZZ, [4,5]); F.rename("F")
sage: G = CombinatorialFreeModule(ZZ, [4,6]); G.rename("G")
sage: S = cartesian_product([F, G])
sage: phi = S.cartesian_embedding(0)
sage: phi(F.monomial(4) + 2 * F.monomial(5))
Expand Down Expand Up @@ -1750,8 +1750,8 @@ def cartesian_projection(self, i):
EXAMPLES::
sage: F = CombinatorialFreeModule(ZZ, [4,5]); F.__custom_name = "F"
sage: G = CombinatorialFreeModule(ZZ, [4,6]); G.__custom_name = "G"
sage: F = CombinatorialFreeModule(ZZ, [4,5]); F.rename("F")
sage: G = CombinatorialFreeModule(ZZ, [4,6]); G.rename("G")
sage: S = cartesian_product([F, G])
sage: x = S.monomial((0,4)) + 2 * S.monomial((0,5)) + 3 * S.monomial((1,6))
sage: S.cartesian_projection(0)(x)
Expand Down Expand Up @@ -1780,8 +1780,8 @@ def _cartesian_product_of_elements(self, elements):
EXAMPLES::
sage: F = CombinatorialFreeModule(ZZ, [4,5]); F.__custom_name = "F"
sage: G = CombinatorialFreeModule(ZZ, [4,6]); G.__custom_name = "G"
sage: F = CombinatorialFreeModule(ZZ, [4,5]); F.rename("F")
sage: G = CombinatorialFreeModule(ZZ, [4,6]); G.rename("G")
sage: S = cartesian_product([F, G])
sage: f = F.monomial(4) + 2 * F.monomial(5)
sage: g = 2*G.monomial(4) + G.monomial(6)
Expand Down Expand Up @@ -1819,12 +1819,11 @@ def cartesian_factors(self):
EXAMPLES::
sage: F = CombinatorialFreeModule(ZZ, [4,5]); F.__custom_name = "F"
sage: G = CombinatorialFreeModule(ZZ, [4,6]); G.__custom_name = "G"
sage: F = CombinatorialFreeModule(ZZ, [4,5]); F.rename("F")
sage: G = CombinatorialFreeModule(ZZ, [4,6]); G.rename("G")
sage: S = cartesian_product([F, G])
sage: S.cartesian_factors()
(F, G)
"""
return self._sets

Expand Down

0 comments on commit c862151

Please sign in to comment.