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

Commit 262bea1

Browse files
committed
Merge branch 'public/combinat/invol-nsym-2' of git://trac.sagemath.org/sage into nsym
2 parents 31271df + c98d300 commit 262bea1

File tree

10 files changed

+213
-177
lines changed

10 files changed

+213
-177
lines changed

src/sage/combinat/ncsf_qsym/generic_basis_code.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -1201,9 +1201,9 @@ def internal_product(self, other):
12011201
12021202
Explicit formulas can be given for internal products of
12031203
elements of the complete and the Psi bases. First, the formula
1204-
for the complete basis ([NCSF1]_ Proposition 5.1): If `I` and
1204+
for the Complete basis ([NCSF1]_ Proposition 5.1): If `I` and
12051205
`J` are two compositions of lengths `p` and `q`, respectively,
1206-
then the corresponding complete homogeneous non-commutative
1206+
then the corresponding Complete homogeneous non-commutative
12071207
symmetric functions `S^I` and `S^J` have internal product
12081208
12091209
.. MATH::
@@ -1225,7 +1225,7 @@ def internal_product(self, other):
12251225
The formula on the Psi basis ([NCSF2]_ Lemma 3.10) is more
12261226
complicated. Let `I` and `J` be two compositions of lengths
12271227
`p` and `q`, respectively, having the same size `|I| = |J|`.
1228-
We denote by `\Psi^K` the element of the Psi-basis
1228+
We denote by `\Psi^K` the element of the Psi basis
12291229
corresponding to any composition `K`.
12301230
12311231
- If `p > q`, then `\Psi^I * \Psi^J` is plainly `0`.
@@ -1242,11 +1242,11 @@ def internal_product(self, other):
12421242
composition `K = (k_1, k_2, \ldots, k_s)`, denote by
12431243
`\Gamma_K` the non-commutative symmetric function
12441244
`k_1 [\ldots [[\Psi_{k_1}, \Psi_{k_2}], \Psi_{k_3}],
1245-
\ldots \Psi_{k_s}]`. For any subset `S` of
1246-
`\{ 1, 2, \ldots, q \}`, let `J_S` be the composition
1245+
\ldots \Psi_{k_s}]`. For any subset `A` of
1246+
`\{ 1, 2, \ldots, q \}`, let `J_A` be the composition
12471247
obtained from `J` by removing the `r`-th parts for all
1248-
`r \notin S` (while keeping the `r`-th parts for all
1249-
`r \in S` in order). Then, `\Psi^I * \Psi^J` equals the
1248+
`r \notin A` (while keeping the `r`-th parts for all
1249+
`r \in A` in order). Then, `\Psi^I * \Psi^J` equals the
12501250
sum of `\Gamma_{J_{K_1}} \Gamma_{J_{K_2}} \cdots
12511251
\Gamma_{J_{K_p}}` over all ordered set partitions
12521252
`(K_1, K_2, \ldots, K_p)` of `\{ 1, 2, \ldots, q \}`

src/sage/combinat/ncsf_qsym/ncsf.py

+110-73
Large diffs are not rendered by default.

src/sage/combinat/ncsf_qsym/qsym.py

+11-15
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ def internal_coproduct(self):
968968
sage: def int_copr_on_F_via_M(I):
969969
....: result = tensor([F.zero(), F.zero()])
970970
....: w = M(F(I)).internal_coproduct()
971-
....: for lam, a in w.monomial_coefficients().items():
971+
....: for lam, a in w:
972972
....: (U, V) = lam
973973
....: result += a * tensor([F(M(U)), F(M(V))])
974974
....: return result
@@ -987,7 +987,7 @@ def internal_coproduct(self):
987987
sage: def int_copr_of_e_in_M(mu):
988988
....: result = tensor([M.zero(), M.zero()])
989989
....: w = e(mu).internal_coproduct()
990-
....: for lam, a in w.monomial_coefficients().items():
990+
....: for lam, a in w:
991991
....: (nu, kappa) = lam
992992
....: result += a * tensor([M(e(nu)), M(e(kappa))])
993993
....: return result
@@ -1011,7 +1011,7 @@ def internal_coproduct(self):
10111011
F = parent.realization_of().F()
10121012
from sage.categories.tensor import tensor
10131013
result = tensor([parent.zero(), parent.zero()])
1014-
for lam, a in F(self).internal_coproduct().monomial_coefficients().items():
1014+
for lam, a in F(self).internal_coproduct():
10151015
(I, J) = lam
10161016
result += a * tensor([parent(F(I)), parent(F(J))])
10171017
return result
@@ -1116,7 +1116,7 @@ def frobenius(self, n):
11161116
M = parent.realization_of().M()
11171117
C = parent._basis_keys
11181118
dct = {C(map(lambda i: n * i, I)): coeff
1119-
for (I, coeff) in M(self).monomial_coefficients().items()}
1119+
for (I, coeff) in M(self)}
11201120
result_in_M_basis = M._from_dict(dct)
11211121
return parent(result_in_M_basis)
11221122

@@ -1193,8 +1193,7 @@ def star_involution(self):
11931193
# involution componentwise, then convert back.
11941194
parent = self.parent()
11951195
M = parent.realization_of().M()
1196-
dct = {I.reversed(): coeff
1197-
for (I, coeff) in M(self).monomial_coefficients().items()}
1196+
dct = {I.reversed(): coeff for (I, coeff) in M(self)}
11981197
return parent(M._from_dict(dct))
11991198

12001199
def omega_involution(self):
@@ -1348,8 +1347,7 @@ def psi_involution(self):
13481347
# involution componentwise, then convert back.
13491348
parent = self.parent()
13501349
F = parent.realization_of().F()
1351-
dct = {I.complement(): coeff
1352-
for (I, coeff) in F(self).monomial_coefficients().items()}
1350+
dct = {I.complement(): coeff for (I, coeff) in F(self)}
13531351
return parent(F._from_dict(dct))
13541352

13551353
def expand(self, n, alphabet='x'):
@@ -1707,8 +1705,7 @@ def lambda_of_monomial(self, I, n):
17071705
for k in lam])
17081706
QQ_result *= (-1) ** n
17091707
# QQ_result is now \lambda^n(M_I) over QQ.
1710-
result = self.sum_of_terms([(J, ZZ(coeff)) for (J, coeff) in
1711-
QQ_result.monomial_coefficients().items()],
1708+
result = self.sum_of_terms([(J, ZZ(coeff)) for (J, coeff) in QQ_result],
17121709
distinct = True)
17131710
return result
17141711

@@ -2293,7 +2290,7 @@ def internal_coproduct(self):
22932290
result = F2.zero()
22942291
from sage.categories.tensor import tensor
22952292
from sage.combinat.permutation import Permutation
2296-
for I, a in self.monomial_coefficients().items():
2293+
for I, a in self:
22972294
# We must add a * \Delta^\times(F_I) to result.
22982295
from sage.combinat.permutation import descents_composition_last
22992296
pi = descents_composition_last(I)
@@ -2364,8 +2361,7 @@ def star_involution(self):
23642361
0
23652362
"""
23662363
parent = self.parent()
2367-
dct = {I.reversed(): coeff
2368-
for (I, coeff) in self.monomial_coefficients().items()}
2364+
dct = {I.reversed(): coeff for (I, coeff) in self}
23692365
return parent._from_dict(dct)
23702366

23712367
F = Fundamental
@@ -2558,7 +2554,7 @@ def _from_fundamental_on_basis(self, comp):
25582554
QS[1, 2, 1, 1] + QS[1, 3, 1] - QS[2, 2, 1]
25592555
"""
25602556
comp = Composition(comp)
2561-
if comp == []:
2557+
if not comp._list:
25622558
return self.one()
25632559
comps = compositions_order(comp.size())
25642560
T = self._from_fundamental_transition_matrix(comp.size())
@@ -2625,7 +2621,7 @@ def _to_Monomial_on_basis(self, J):
26252621
4*M[1, 1, 1, 1, 1] + 3*M[1, 1, 1, 2] + 2*M[1, 1, 2, 1] + M[1, 1, 3] + M[1, 2, 1, 1] + M[1, 2, 2] + M[2, 1, 1, 1] + M[2, 1, 2]
26262622
"""
26272623
M = self.realization_of().Monomial()
2628-
if J == []:
2624+
if not J._list:
26292625
return M([])
26302626
C = Compositions()
26312627
C_size = Compositions(J.size())

src/sage/combinat/partition.py

+18-16
Original file line numberDiff line numberDiff line change
@@ -1782,27 +1782,27 @@ def t_completion(self, t):
17821782
17831783
If `\lambda = (\lambda_1, \lambda_2, \lambda_3, \ldots)` is a
17841784
partition and `t` is an integer greater or equal to
1785-
`\left| \lambda \right| + \lambda_1`, then the *`t`-completion of
1786-
`\lambda`* is defined as the partition
1787-
`(t - \left| \lambda \right|, \lambda_1, \lambda_2, \lambda_3,
1788-
\ldots)` of `t`. This partition is denoted by `\lambda[t]` in
1789-
[BOR09]_, by `\lambda_{[t]}` in [BdVO12]_ and by `\lambda(t)` in
1790-
[CO10]_.
1785+
`\left\lvert \lambda \right\rvert + \lambda_1`, then the
1786+
`t`-*completion of* `\lambda` is defined as the partition
1787+
`(t - \left\lvert \lambda \right\rvert, \lambda_1, \lambda_2,
1788+
\lambda_3, \ldots)` of `t`. This partition is denoted by `\lambda[t]`
1789+
in [BOR09]_, by `\lambda_{[t]}` in [BdVO12]_, and by `\lambda(t)`
1790+
in[CO10]_.
17911791
17921792
REFERENCES:
17931793
1794-
.. [BOR09] Emmanuel Briand, Rosa Orellana, Mercedes Rosas,
1794+
.. [BOR09] Emmanuel Briand, Rosa Orellana, Mercedes Rosas.
17951795
*The stability of the Kronecker products of Schur
17961796
functions*.
17971797
:arxiv:`0907.4652v2`.
17981798
1799-
.. [CO10] Jonathan Comes, Viktor Ostrik,
1800-
*On blocks of Deligne's category
1801-
`\underline{\mathrm{Rep}}(S_t)`*.
1799+
.. [CO10] Jonathan Comes, Viktor Ostrik.
1800+
*On blocks of Deligne's category*
1801+
`\underline{\mathrm{Rep}}(S_t)`.
18021802
:arxiv:`0910.5695v2`,
18031803
http://pages.uoregon.edu/jcomes/blocks.pdf
18041804
1805-
.. [BdVO12] Christopher Bowman, Maud De Visscher, Rosa Orellana,
1805+
.. [BdVO12] Christopher Bowman, Maud De Visscher, Rosa Orellana.
18061806
*The partition algebra and the Kronecker coefficients*.
18071807
:arXiv:`1210.5579v6`.
18081808
@@ -1827,12 +1827,14 @@ def t_completion(self, t):
18271827
sage: Partition([4, 2, 2, 1]).t_completion(10)
18281828
Traceback (most recent call last):
18291829
...
1830-
ValueError: [1, 4, 2, 2, 1] is not an element of Partitions
1830+
ValueError: 5-completion is not defined
18311831
sage: Partition([4, 2, 2, 1]).t_completion(5)
18321832
Traceback (most recent call last):
18331833
...
1834-
ValueError: [-4, 4, 2, 2, 1] is not an element of Partitions
1834+
ValueError: 5-completion is not defined
18351835
"""
1836+
if not self._list and t <= self.size() + self._list[0]:
1837+
raise ValueError("{}-completion is not defined".format(t))
18361838
return Partition([t - self.size()] + self._list)
18371839

18381840
def larger_lex(self, rhs):
@@ -2002,17 +2004,17 @@ def to_dyck_word(self, n=None):
20022004
True
20032005
"""
20042006
from sage.combinat.dyck_word import DyckWord
2005-
if self == []:
2007+
if not self._list:
20062008
if n is None:
20072009
return DyckWord([])
2008-
return DyckWord([1 for _ in range(n)] + [0 for _ in range(n)])
2010+
return DyckWord([1]*n + [0]*n)
20092011
list_of_word = []
20102012
if n is None:
20112013
n = max(i + l + 1 for (i, l) in enumerate(self))
20122014
# This n is also max(i+j for (i,j) in self.cells()) + 2.
20132015
list_of_word.extend([1]*(n-self.length()))
20142016
copy_part = list(self)
2015-
while copy_part != []:
2017+
while copy_part:
20162018
c = copy_part.pop()
20172019
list_of_word.extend([0]*c)
20182020
for i in range(len(copy_part)):

src/sage/combinat/sf/dual.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -650,26 +650,27 @@ def omega(self):
650650
*omega involution*. It sends the power-sum symmetric function
651651
`p_k` to `(-1)^{k-1} p_k` for every positive integer `k`.
652652
653-
The images of some bases under the omega automorphism are given
654-
by
653+
The images of some bases under the omega automorphism are given by
655654
656655
.. MATH::
657656
658657
\omega(e_{\lambda}) = h_{\lambda}, \qquad
659658
\omega(h_{\lambda}) = e_{\lambda}, \qquad
660-
\omega(p_{\lambda}) = (-1)^{|\lambda| - \ell(\lambda)} p_{\lambda}, \qquad
659+
\omega(p_{\lambda}) = (-1)^{|\lambda| - \ell(\lambda)}
660+
p_{\lambda}, \qquad
661661
\omega(s_{\lambda}) = s_{\lambda^{\prime}},
662662
663663
where `\lambda` is any partition, where `\ell(\lambda)` denotes
664664
the length (:meth:`~sage.combinat.partition.Partition.length`)
665-
of the partition `\lambda`, where `\lambda^{\prime}' denotes the
665+
of the partition `\lambda`, where `\lambda^{\prime}` denotes the
666666
conjugate partition
667667
(:meth:`~sage.combinat.partition.Partition.conjugate`) of
668668
`\lambda`, and where the usual notations for bases are used
669669
(`e` = elementary, `h` = complete homogeneous, `p` = powersum,
670670
`s` = Schur).
671671
672-
``omega_involution`` is a synonym for the ``omega`` method.
672+
:meth:`omega_involution()` is a synonym for the :meth`omega()`
673+
method.
673674
674675
OUTPUT:
675676

src/sage/combinat/sf/elementary.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -108,26 +108,27 @@ def omega(self):
108108
*omega involution*. It sends the power-sum symmetric function
109109
`p_k` to `(-1)^{k-1} p_k` for every positive integer `k`.
110110
111-
The images of some bases under the omega automorphism are given
112-
by
111+
The images of some bases under the omega automorphism are given by
113112
114113
.. MATH::
115114
116115
\omega(e_{\lambda}) = h_{\lambda}, \qquad
117116
\omega(h_{\lambda}) = e_{\lambda}, \qquad
118-
\omega(p_{\lambda}) = (-1)^{|\lambda| - \ell(\lambda)} p_{\lambda}, \qquad
117+
\omega(p_{\lambda}) = (-1)^{|\lambda| - \ell(\lambda)}
118+
p_{\lambda}, \qquad
119119
\omega(s_{\lambda}) = s_{\lambda^{\prime}},
120120
121121
where `\lambda` is any partition, where `\ell(\lambda)` denotes
122122
the length (:meth:`~sage.combinat.partition.Partition.length`)
123-
of the partition `\lambda`, where `\lambda^{\prime}' denotes the
123+
of the partition `\lambda`, where `\lambda^{\prime}` denotes the
124124
conjugate partition
125125
(:meth:`~sage.combinat.partition.Partition.conjugate`) of
126126
`\lambda`, and where the usual notations for bases are used
127127
(`e` = elementary, `h` = complete homogeneous, `p` = powersum,
128128
`s` = Schur).
129129
130-
``omega_involution`` is a synonym for the ``omega`` method.
130+
:meth:`omega_involution()` is a synonym for the :meth`omega()`
131+
method.
131132
132133
EXAMPLES::
133134

src/sage/combinat/sf/homogeneous.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -129,26 +129,27 @@ def omega(self):
129129
*omega involution*. It sends the power-sum symmetric function
130130
`p_k` to `(-1)^{k-1} p_k` for every positive integer `k`.
131131
132-
The images of some bases under the omega automorphism are given
133-
by
132+
The images of some bases under the omega automorphism are given by
134133
135134
.. MATH::
136135
137136
\omega(e_{\lambda}) = h_{\lambda}, \qquad
138137
\omega(h_{\lambda}) = e_{\lambda}, \qquad
139-
\omega(p_{\lambda}) = (-1)^{|\lambda| - \ell(\lambda)} p_{\lambda}, \qquad
138+
\omega(p_{\lambda}) = (-1)^{|\lambda| - \ell(\lambda)}
139+
p_{\lambda}, \qquad
140140
\omega(s_{\lambda}) = s_{\lambda^{\prime}},
141141
142142
where `\lambda` is any partition, where `\ell(\lambda)` denotes
143143
the length (:meth:`~sage.combinat.partition.Partition.length`)
144-
of the partition `\lambda`, where `\lambda^{\prime}' denotes the
144+
of the partition `\lambda`, where `\lambda^{\prime}` denotes the
145145
conjugate partition
146146
(:meth:`~sage.combinat.partition.Partition.conjugate`) of
147147
`\lambda`, and where the usual notations for bases are used
148148
(`e` = elementary, `h` = complete homogeneous, `p` = powersum,
149149
`s` = Schur).
150150
151-
``omega_involution`` is a synonym for the ``omega`` method.
151+
:meth:`omega_involution()` is a synonym for the :meth:`omega()`
152+
method.
152153
153154
OUTPUT:
154155

src/sage/combinat/sf/powersum.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -179,26 +179,27 @@ def omega(self):
179179
*omega involution*. It sends the power-sum symmetric function
180180
`p_k` to `(-1)^{k-1} p_k` for every positive integer `k`.
181181
182-
The images of some bases under the omega automorphism are given
183-
by
182+
The images of some bases under the omega automorphism are given by
184183
185184
.. MATH::
186185
187186
\omega(e_{\lambda}) = h_{\lambda}, \qquad
188187
\omega(h_{\lambda}) = e_{\lambda}, \qquad
189-
\omega(p_{\lambda}) = (-1)^{|\lambda| - \ell(\lambda)} p_{\lambda}, \qquad
188+
\omega(p_{\lambda}) = (-1)^{|\lambda| - \ell(\lambda)}
189+
p_{\lambda}, \qquad
190190
\omega(s_{\lambda}) = s_{\lambda^{\prime}},
191191
192192
where `\lambda` is any partition, where `\ell(\lambda)` denotes
193193
the length (:meth:`~sage.combinat.partition.Partition.length`)
194-
of the partition `\lambda`, where `\lambda^{\prime}' denotes the
194+
of the partition `\lambda`, where `\lambda^{\prime}` denotes the
195195
conjugate partition
196196
(:meth:`~sage.combinat.partition.Partition.conjugate`) of
197197
`\lambda`, and where the usual notations for bases are used
198198
(`e` = elementary, `h` = complete homogeneous, `p` = powersum,
199199
`s` = Schur).
200200
201-
``omega_involution`` is a synonym for the ``omega`` method.
201+
:meth:`omega_involution()` is a synonym for the :meth:`omega()`
202+
method.
202203
203204
OUTPUT:
204205

src/sage/combinat/sf/schur.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -209,30 +209,31 @@ def omega(self):
209209
*omega involution*. It sends the power-sum symmetric function
210210
`p_k` to `(-1)^{k-1} p_k` for every positive integer `k`.
211211
212-
The images of some bases under the omega automorphism are given
213-
by
212+
The images of some bases under the omega automorphism are given by
214213
215214
.. MATH::
216215
217216
\omega(e_{\lambda}) = h_{\lambda}, \qquad
218217
\omega(h_{\lambda}) = e_{\lambda}, \qquad
219-
\omega(p_{\lambda}) = (-1)^{|\lambda| - \ell(\lambda)} p_{\lambda}, \qquad
218+
\omega(p_{\lambda}) = (-1)^{|\lambda| - \ell(\lambda)}
219+
p_{\lambda}, \qquad
220220
\omega(s_{\lambda}) = s_{\lambda^{\prime}},
221221
222222
where `\lambda` is any partition, where `\ell(\lambda)` denotes
223223
the length (:meth:`~sage.combinat.partition.Partition.length`)
224-
of the partition `\lambda`, where `\lambda^{\prime}' denotes the
224+
of the partition `\lambda`, where `\lambda^{\prime}` denotes the
225225
conjugate partition
226226
(:meth:`~sage.combinat.partition.Partition.conjugate`) of
227227
`\lambda`, and where the usual notations for bases are used
228228
(`e` = elementary, `h` = complete homogeneous, `p` = powersum,
229229
`s` = Schur).
230230
231-
``omega_involution`` is a synonym for the ``omega`` method.
231+
:meth:`omega_involution()` is a synonym for the :meth:`omega()`
232+
method.
232233
233234
OUTPUT:
234235
235-
- the image of ``self`` under omega as an element of the Schur basis
236+
- the image of ``self`` under the omega automorphism
236237
237238
EXAMPLES::
238239

0 commit comments

Comments
 (0)