@@ -11,82 +11,67 @@ Demonstration: Symmetric functions
11
11
12
12
::
13
13
14
- sage: SymmetricFunctions?
14
+ sage: SymmetricFunctions? # not tested
15
15
16
- ::
16
+ The ring of symmetric functions over the rational numbers ::
17
17
18
- sage: S = SymmetricFunctions(QQ) # The ring of symmetric functions over the rational numbers
18
+ sage: S = SymmetricFunctions(QQ)
19
19
20
+ Typing 'objectname.<tab>' gives a lot of information about what
21
+ you can do with the object::
20
22
21
- ::
23
+ sage: S. # not tested
22
24
23
- sage: # Typing 'objectname.<tab>' gives a lot of information about what
24
- sage: # you can do with the object
25
- sage: S.
25
+ The usual bases for symmetric functions::
26
26
27
- ::
28
-
29
- sage: # The usual bases for symmetric functions
30
27
sage: p = S.powersum(); s = S.schur(); m = S.monomial(); h = S.homogeneous(); e = S.elementary()
31
28
29
+ The 'forgotten basis' is dual to the elementary basis::
32
30
33
- ::
34
-
35
- sage: # The 'forgotten basis' is dual to the elementary basis
36
31
sage: f = e.dual_basis()
37
32
33
+ Different ways of entering symmetric functions::
38
34
39
- ::
40
-
41
- sage: # Different ways of entering symmetric functions
42
35
sage: p[2,1] == p([2,1]) and p[2,1] == p(Partition([2,1]))
43
36
True
44
37
45
- ::
38
+ Changing bases ::
46
39
47
- sage: # Changing bases
48
40
sage: p(s[2,1])
49
41
1/3*p[1, 1, 1] - 1/3*p[3]
50
42
51
- ::
43
+ Sums of different bases are automatically converted to a single basis ::
52
44
53
- sage: # Sums of different bases are automatically converted to a single basis
54
45
sage: h[3] + s[3] + e[3] + p[3]
55
46
2*h[1, 1, 1] - 5*h[2, 1] + 6*h[3]
56
47
57
- ::
48
+ Littlewood-Richardson coefficients are relatively fast ::
58
49
59
- sage: # Littlewood-Richardson coefficients are relatively fast
60
50
sage: timeit('s[10]^4')
61
- 5 loops, best of 3:..
51
+ 5 loops, best of 3:...
62
52
63
- ::
53
+ Changing bases ::
64
54
65
- sage: # Changing bases
66
- sage: time h(s[10]^4);
55
+ sage: h(s[10]^4);
67
56
h[10, 10, 10, 10]
68
- Time: CPU 1.07 s, Wall: 1.08 s
69
57
70
- ::
58
+ We get an arbitrary symmetric function to demonstrate some functionality ::
71
59
72
- sage: # We get an arbitrary symmetric function to demonstrate some functionality
73
- sage: foo = h.an_element()
60
+ sage: foo = 1/2*h([]) + 3*h([1, 1, 1]) + 2*h([2, 1, 1])
74
61
sage: foo
75
62
1/2*h[] + 3*h[1, 1, 1] + 2*h[2, 1, 1]
76
63
77
- ::
64
+ The omega involution ::
78
65
79
- sage: foo.omega() # The omega involution
66
+ sage: foo.omega()
80
67
1/2*h[] + 3*h[1, 1, 1] + 2*h[1, 1, 1, 1] - 2*h[2, 1, 1]
81
68
82
- ::
83
-
84
69
sage: e(foo.omega())
85
70
1/2*e[] + 3*e[1, 1, 1] + 2*e[2, 1, 1]
86
71
87
- ::
72
+ The Hall scalar product ::
88
73
89
- sage: foo.scalar(s[3,1]) # The Hall scalar product
74
+ sage: foo.scalar(s[3,1])
90
75
4
91
76
92
77
::
@@ -99,60 +84,44 @@ Demonstration: Symmetric functions
99
84
sage: foo.skew_by(e[2,1])
100
85
9*h[] + 10*h[1]
101
86
102
- ::
87
+ We can define skew partition directly ::
103
88
104
- sage: # We can define skew partition directly
105
89
sage: mu = Partition([3,2])/Partition([2,1])
106
90
sage: mu
107
- [[3, 2], [2, 1]]
108
-
109
- ::
91
+ [3, 2] / [2, 1]
110
92
111
93
sage: s(mu)
112
94
s[1, 1] + s[2]
113
95
114
- ::
96
+ We can expand a symmetric function in monomials ::
115
97
116
- sage: # We can expand a symmetric function in monomials
117
98
sage: s(mu).expand(3)
118
99
x0^2 + 2*x0*x1 + x1^2 + 2*x0*x2 + 2*x1*x2 + x2^2
119
100
120
- ::
101
+ Or we can choose our alphabet ::
121
102
122
- sage: # Or we can choose our alphabet
123
103
sage: s(mu).expand(3,alphabet=['a','b','c'])
124
104
a^2 + 2*a*b + b^2 + 2*a*c + 2*b*c + c^2
125
105
126
- ::
127
-
128
106
sage: mu = Partition([32,18,16,4,1])/Partition([14,3,2,1])
129
107
sage: la = Partition([33,19,17,4,1])/Partition([15,4,3,1])
130
108
131
-
132
- ::
133
-
134
109
sage: (s(la) - s(mu)).is_schur_positive()
135
110
True
136
111
137
- ::
138
-
139
112
sage: foo.kronecker_product(foo)
140
113
1/4*h[] + 54*h[1, 1, 1] + 20*h[1, 1, 1, 1] + 8*h[2, 1, 1]
141
114
142
- ::
143
-
144
115
sage: foo.plethysm(h[3])
145
116
1/2*h[] + 3*h[3, 3, 3] + 2*h[4, 3, 3, 2] - 2*h[5, 3, 3, 1] + 2*h[6, 3, 3]
146
117
147
118
::
148
119
149
- sage: foo.inner_plethysm?
150
-
120
+ sage: foo.inner_plethysm? # not tested
151
121
152
- ::
122
+ The transition matrix from the Schur basis to the power basis
123
+ Try s.transition_matrix? for more information::
153
124
154
- sage: # The transition matrix from the Schur basis to the power basis
155
- sage: # Try s.transition_matrix? for more information
156
125
sage: s.transition_matrix(m,5)
157
126
[1 1 1 1 1 1 1]
158
127
[0 1 1 2 2 3 4]
@@ -162,9 +131,8 @@ Demonstration: Symmetric functions
162
131
[0 0 0 0 0 1 4]
163
132
[0 0 0 0 0 0 1]
164
133
165
- ::
134
+ The sum of degree 6 Schur functions whose first part is even ::
166
135
167
- sage: # The sum of degree 6 Schur functions whose first part is even
168
136
sage: foo = sum([s[mu] for mu in Partitions(6) if mu[0]%2 == 0])
169
137
sage: foo
170
138
s[2, 1, 1, 1, 1] + s[2, 2, 1, 1] + s[2, 2, 2] + s[4, 1, 1] + s[4, 2] + s[6]
@@ -175,16 +143,13 @@ Demonstration: Symmetric functions
175
143
....: r""" Remove the last part from a partition """
176
144
....: return Partition(mu[:-1])
177
145
146
+ We can apply this map to all the partitions appearing in 'foo'::
178
147
179
- ::
180
-
181
- sage: # We can apply this map to all the partitions appearing in 'foo'
182
148
sage: foo.map_support(remove_last_part)
183
149
s[] + s[2, 1, 1, 1] + s[2, 2] + s[2, 2, 1] + s[4] + s[4, 1]
184
150
185
- ::
151
+ Warning! This gives different results depending on the basis in which foo is expressed ::
186
152
187
- sage: # Warning! This gives different results depending on the basis in which foo is expressed
188
153
sage: h(foo).map_support(remove_last_part)
189
154
3*h[] + h[2, 1, 1, 1] + h[2, 2] - 2*h[2, 2, 1] - 2*h[3, 1, 1] + 2*h[3, 2] - 2*h[4] + 4*h[4, 1] - 4*h[5]
190
155
@@ -193,62 +158,47 @@ Demonstration: Symmetric functions
193
158
sage: foo.map_support(remove_last_part) == h(foo).map_support(remove_last_part)
194
159
False
195
160
196
- ::
161
+ We can easily get specific coefficients ::
197
162
198
- sage: # We can easily get specific coefficients
199
163
sage: foo.coefficient([4,2])
200
164
1
201
165
202
- ::
203
-
204
- sage: # There are many forms of symmetric functions in sage.
205
- sage: # They do not (yet) all appear under 'SymmetricFunctions'
206
- sage: # These are the ~H[X;q,t] often called the 'modified Macdonald polynomials'
207
- sage: Ht = MacdonaldPolynomialsHt(QQ)
208
-
166
+ There are many forms of symmetric functions in sage.
167
+ These are the `~H[X;q,t] ` often called the 'modified Macdonald polynomials'::
209
168
169
+ sage: S = SymmetricFunctions(FractionField(QQ['q','t']))
170
+ sage: Ht = S.macdonald().Ht(); Ht
171
+ Symmetric Functions over Fraction Field of Multivariate Polynomial Ring in q, t over Rational Field in the Macdonald Ht basis
172
+ sage: p = S.powersum(); s = S.schur(); m = S.monomial(); h = S.homogeneous(); e = S.elementary();
210
173
::
211
174
212
175
sage: s(Ht([3,2]))
213
- Traceback (most recent call last):
214
- ...
215
- TypeError
176
+ q^4*t^2*s[1, 1, 1, 1, 1] + (q^4*t+q^3*t^2+q^3*t+q^2*t^2)*s[2, 1, 1, 1] + (q^4+q^3*t+q^2*t^2+q^2*t+q*t^2)*s[2, 2, 1] + (q^3*t+q^3+2*q^2*t+q*t^2+q*t)*s[3, 1, 1] + (q^3+q^2*t+q^2+q*t+t^2)*s[3, 2] + (q^2+q*t+q+t)*s[4, 1] + s[5]
216
177
217
178
::
218
179
219
180
sage: Ht.base_ring()
220
181
Fraction Field of Multivariate Polynomial Ring in q, t over Rational Field
221
182
222
- ::
223
-
224
- sage: S.base_ring()
225
- Rational Field
226
-
227
183
::
228
184
229
185
sage: q
230
186
Traceback (most recent call last):
231
187
...
232
188
NameError: name 'q' is not defined
233
189
234
- ::
190
+ The following is a shortcut notation (based on Magma).
191
+ It defines R to be the polynomial ring in the variables
192
+ 'q' and 't' over the rational numbers, and makes these variables
193
+ available for use::
235
194
236
- sage: # The following is a shortcut notation (based on Magma).
237
- sage: # It defines R to be the polynomial ring in the variables
238
- sage: # 'q' and 't' over the rational numbers, and makes these variables
239
- sage: # available for use
240
195
sage: R.<q,t> = Frac(ZZ['q','t'])
241
196
242
-
243
- ::
244
-
245
197
sage: S = SymmetricFunctions(R)
246
-
247
- ::
248
-
249
198
sage: p = S.powersum(); s = S.schur(); m = S.monomial(); h = S.homogeneous(); e = S.elementary();
250
- sage: Ht = MacdonaldPolynomialsHt(R)
251
199
200
+ sage: Ht = S.macdonald().Ht(); Ht
201
+ Symmetric Functions over Fraction Field of Multivariate Polynomial Ring in q, t over Integer Ring in the Macdonald Ht basis
252
202
253
203
::
254
204
@@ -258,80 +208,62 @@ Demonstration: Symmetric functions
258
208
::
259
209
260
210
sage: latex(_)
261
- q^{4} t^{2}s_{1,1,1,1,1} + \left(q^{4} t + q^{3} t^{2} + q^{3} t + q^{2} t^{2}\right)s_{2,1,1,1} + \left(q^{4} + q^{3} t + q^{2} t^{2} + q^{2} t + q t^{2}\right)s_{2,2,1} + \left(q^{3} t + q^{3} + 2 q^{2} t + q t^{2} + q t\right)s_{3,1,1} + \left(q^{3} + q^{2} t + q^{2} + q t + t^{2}\right)s_{3,2} + \left(q^{2} + q t + q + t\right)s_{4,1} + s_{5}
211
+ q^{4} t^{2} s_{1,1,1,1,1} + \left(q^{4} t + q^{3} t^{2} + q^{3} t + q^{2} t^{2}\right) s_{2,1,1,1} + \left(q^{4} + q^{3} t + q^{2} t^{2} + q^{2} t + q t^{2}\right) s_{2,2,1} + \left(q^{3} t + q^{3} + 2 q^{2} t + q t^{2} + q t\right) s_{3,1,1} + \left(q^{3} + q^{2} t + q^{2} + q t + t^{2}\right) s_{3,2} + \left(q^{2} + q t + q + t\right) s_{4,1} + s_{5}
262
212
263
213
::
264
214
265
215
sage: s(Ht([3,2])).coefficient([2,1,1,1]).subs({q:q^(-1), t:t^(-1)}) *q^5 * t^5
266
216
q^3*t^3 + q^2*t^4 + q^2*t^3 + q*t^4
267
217
268
- ::
218
+ We can also create the ring of Macdonald Polynomials
219
+ using different parameters::
269
220
270
- sage: # We can also create the ring of Macdonald Polynomials
271
- sage: # using different parameters
272
221
sage: A.<a,b> = QQ[]
273
- sage: P = MacdonaldPolynomialsP (FractionField(A),a,b )
274
- sage: sa = SymmetricFunctions(FractionField(A)) .schur()
275
-
222
+ sage: S = SymmetricFunctions (FractionField(A))
223
+ sage: sa = S .schur()
224
+ sage: P = S.macdonald(a,b).P()
276
225
277
226
::
278
227
279
228
sage: sa(P[2,1])
280
229
((a*b-b^2+a-b)/(-a*b^2+1))*s[1, 1, 1] + s[2, 1]
281
230
282
- ::
283
-
284
- sage: # Press <tab> after the following to see the different
285
- sage: # variants of Macdonald polynomials in sage
286
- sage: MacdonaldPolynomials
287
- Traceback (most recent call last):
288
- ...
289
- NameError: name 'MacdonaldPolynomials' is not defined
231
+ Press <tab> after the following to see the different
232
+ variants of Macdonald polynomials in sage
290
233
291
- ::
234
+ sage: Sym = SymmetricFunctions(FractionField(QQ['q',t']))
235
+ sage: J = Sym.macdonald()
236
+ sage: J.TAB # not tested
292
237
293
- sage: # Press <tab> after the following to see the different
294
- sage: # variants of Jack polynomials in sage
295
- sage: JackPolynomials
238
+ Press <tab> after the following to see the different variants of Jack polynomials in sage::
296
239
240
+ sage: Sym = SymmetricFunctions(FractionField(QQ['t']))
241
+ sage: J = Sym.jack()
242
+ sage: J.TAB # not tested
297
243
298
- ::
244
+ Press <tab> after the following to see the different
245
+ variants of Hall-Littlewood polynomials in sage
299
246
300
- sage: # Press <tab> after the following to see the different
301
- sage: # variants of Hall-Littlewood polynomials in sage
247
+ sage: Sym = SymmetricFunctions(FractionField(QQ['t']))
248
+ sage: H = Sym.hall_littlewood()
302
249
sage: HallLittlewood
303
250
251
+ Now some examples with `k `-Schur functions::
304
252
305
- ::
306
-
307
- sage: ks2 = kSchurFunctions(R,2,t=R(t))
308
- sage: s = SymmetricFunctions(R).schur()
309
-
253
+ sage: Sym = SymmetricFunctions(QQ['t'])
254
+ sage: KB = Sym.kBoundedSubspace(2)
255
+ sage: ks2 = KB.kschur()
256
+ sage: s = Sym.schur()
310
257
311
258
::
312
259
313
260
sage: s(ks2[2,2,1])
314
261
s[2, 2, 1] + t*s[3, 1, 1] + (t^2+t)*s[3, 2] + (t^3+t^2)*s[4, 1] + t^4*s[5]
315
262
316
- ::
317
-
318
263
sage: ks2(s[1])
319
264
ks2[1]
320
265
321
- ::
322
-
323
266
sage: ks2(s[3])
324
267
Traceback (most recent call last):
325
268
...
326
- ValueError: s[3] is not in the space spanned by k-Schur Functions at level 2 over Multivariate Polynomial Ring in q, t over Rational Field.
327
-
328
- ::
329
-
330
- sage: # Warning: Not well supported yet!
331
- sage: SchubertPolynomialRing
332
-
333
-
334
- ::
335
-
336
- sage: # Warning: Not well supported yet!
337
- sage: LLT
269
+ ValueError: s[3] is not in the image
0 commit comments