Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

287

288

289

290

291

292

293

294

295

296

297

298

299

300

301

302

303

304

305

306

307

308

309

310

311

312

313

314

315

316

317

318

319

320

321

322

323

324

325

326

327

328

329

330

331

332

333

334

335

336

337

338

339

340

341

342

343

344

345

346

347

348

349

350

351

352

353

354

355

356

357

358

359

360

361

362

363

364

365

366

367

368

369

370

371

372

373

374

375

376

377

378

379

380

381

382

383

384

385

386

387

388

389

390

391

392

393

394

395

396

397

398

399

400

401

402

403

404

405

406

407

408

409

410

411

412

413

414

415

416

417

418

419

420

421

422

423

424

425

426

427

428

429

430

431

432

433

434

435

436

437

438

439

440

441

442

443

444

445

446

447

448

449

450

451

452

453

454

455

456

457

458

459

460

461

462

463

464

465

466

467

468

469

470

471

472

473

474

475

476

477

478

479

480

481

482

483

484

485

486

487

488

489

490

491

492

493

494

495

496

497

498

499

""" 

Characters of the symmetric group as bases of the symmetric functions 

 

Just as the Schur functions are the irreducible characters of `Gl_n` 

and form a basis of the symmetric functions, the irreducible 

symmetric group character basis are the irreducible characters of 

of `S_n` when the group is realized as the permutation matrices. 

 

REFERENCES: 

 

.. [OZ2015] \R. Orellana, M. Zabrocki, *Symmetric group characters 

as symmetric functions*, :arxiv:`1510.00438`. 

""" 

 

#***************************************************************************** 

# Copyright (C) 2015 Mike Zabrocki <zabrocki@mathstat.yorku.ca 

# 

# Distributed under the terms of the GNU General Public License (GPL) 

# 

# This code is distributed in the hope that it will be useful, 

# but WITHOUT ANY WARRANTY; without even the implied warranty of 

# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 

# General Public License for more details. 

# 

# The full text of the GPL is available at: 

# 

# http://www.gnu.org/licenses/ 

#***************************************************************************** 

 

from sage.combinat.sf.sfa import SymmetricFunctionAlgebra_generic as SFA_generic 

from sage.misc.cachefunc import cached_method 

from sage.categories.homset import Hom 

from sage.categories.morphism import SetMorphism 

from sage.combinat.partition import Partition 

from sage.arith.all import divisors, moebius 

from sage.functions.other import binomial 

from sage.rings.integer import Integer 

 

import six 

 

 

class generic_character(SFA_generic): 

def _my_key(self, la): 

r""" 

A rank function for partitions. 

 

The leading term of a homogeneous expression will 

be the partition with the largest key value. 

 

This key value is `|\lambda|^2 + \lambda_0` and 

using the ``max`` function on a list of Partitions. 

 

Of course it is possible that this rank function 

is equal for some partitions, but the leading 

term should be any one of these partitions. 

 

INPUT: 

 

- ``la`` -- a partition 

 

OUTPUT: 

 

- an integer 

 

EXAMPLES:: 

 

sage: Sym = SymmetricFunctions(QQ) 

sage: ht = SymmetricFunctions(QQ).ht() 

sage: ht._my_key(Partition([2,1,1])) 

18 

sage: ht._my_key(Partition([2,2])) 

18 

sage: ht._my_key(Partition([3,1])) 

19 

sage: ht._my_key(Partition([1,1,1,1])) 

17 

""" 

if la: 

return la.size()**2 + la[0] 

else: 

return 0 

 

def _other_to_self(self, sexpr): 

r""" 

Convert an expression the target basis to the character-basis. 

 

We use triangularity to determine the expansion 

by subtracting off the leading term. The target basis 

is specified by the method ``self._other``. 

 

INPUT: 

 

- ``sexpr`` -- an element of ``self._other`` basis 

 

EXAMPLES:: 

 

sage: Sym = SymmetricFunctions(QQ) 

sage: ht = SymmetricFunctions(QQ).ht() 

sage: h = Sym.h() 

sage: ht._other_to_self(h[2] + h([])) 

ht[] + ht[1] + ht[2] 

sage: st = SymmetricFunctions(QQ).st() 

sage: s = Sym.s() 

sage: st._other_to_self(s[1] + s([])) 

2*st[] + st[1] 

sage: 7 * st[[]] * st[[]] 

7*st[] 

""" 

if sexpr == 0: 

return self(0) 

if sexpr.support() == [[]]: 

return self._from_dict({self.one_basis(): sexpr.coefficient([])}, 

remove_zeros=False) 

out = self.zero() 

while sexpr: 

mup = max(sexpr.support(), key=self._my_key) 

out += sexpr.coefficient(mup) * self(mup) 

sexpr -= sexpr.coefficient(mup) * self._self_to_other_on_basis(mup) 

return out 

 

 

class character_basis(generic_character): 

r""" 

General code for a character basis (irreducible and induced trivial). 

 

This is a basis of the symmetric functions that has the 

property that ``self(la).character_to_frobenius_image(n)`` 

is equal to ``other([n-sum(la)]+la)``. 

 

It should also have the property that the (outer) structure 

constants are the analogue of the stable Kronecker 

coefficients on the ``other`` basis (where ``other`` is either the 

Schur or homogeneous bases). 

 

These bases are introduced in [OZ2015]_. 

 

EXAMPLES:: 

 

sage: Sym = SymmetricFunctions(QQ) 

sage: s = Sym.s() 

sage: h = Sym.h() 

sage: ht = SymmetricFunctions(QQ).ht() 

sage: st = SymmetricFunctions(QQ).st() 

sage: ht(s[2,1]) 

ht[1, 1] + ht[2, 1] - ht[3] 

sage: s(ht[2,1]) 

s[1] - 2*s[1, 1] - 2*s[2] + s[2, 1] + s[3] 

sage: ht(h[2,1]) 

ht[1] + 2*ht[1, 1] + ht[2, 1] 

sage: h(ht[2,1]) 

h[1] - 2*h[1, 1] + h[2, 1] 

sage: st(ht[2,1]) 

st[] + 2*st[1] + st[1, 1] + 2*st[2] + st[2, 1] + st[3] 

sage: ht(st[2,1]) 

ht[1] - ht[1, 1] + ht[2, 1] - ht[3] 

sage: ht[2]*ht[1,1] 

ht[1, 1] + 2*ht[1, 1, 1] + ht[2, 1, 1] 

sage: h[4,2].kronecker_product(h[4,1,1]) 

h[2, 2, 1, 1] + 2*h[3, 1, 1, 1] + h[4, 1, 1] 

sage: s(st[2,1]) 

3*s[1] - 2*s[1, 1] - 2*s[2] + s[2, 1] 

sage: st(s[2,1]) 

st[] + 3*st[1] + 2*st[1, 1] + 2*st[2] + st[2, 1] 

sage: st[2]*st[1] 

st[1] + st[1, 1] + st[2] + st[2, 1] + st[3] 

sage: s[4,2].kronecker_product(s[5,1]) 

s[3, 2, 1] + s[3, 3] + s[4, 1, 1] + s[4, 2] + s[5, 1] 

""" 

def __init__(self, Sym, other_basis, bname, pfix): 

r""" 

Initialize the basis and register coercions. 

 

The coercions are set up between the ``other_basis``. 

 

INPUT: 

 

- ``Sym`` -- an instance of the symmetric function algebra 

- ``other_basis`` -- a basis of Sym 

- ``bname`` -- the name for this basis (convention: ends in "character") 

- ``pfix`` -- a prefix to use for the basis 

 

EXAMPLES:: 

 

sage: Sym = SymmetricFunctions(QQ) 

sage: ht = SymmetricFunctions(QQ).ht(); ht 

Symmetric Functions over Rational Field in the induced trivial character basis 

sage: st = SymmetricFunctions(QQ).st(); st 

Symmetric Functions over Rational Field in the irreducible symmetric group character basis 

sage: TestSuite(ht).run() 

""" 

SFA_generic.__init__(self, Sym, basis_name=bname, prefix=pfix, graded=False) 

self._other = other_basis 

self.module_morphism(self._self_to_other_on_basis, 

codomain=self._other).register_as_coercion() 

self.register_coercion(SetMorphism(Hom(self._other, self), 

self._other_to_self)) 

 

@cached_method 

def _self_to_other_on_basis(self, lam): 

r""" 

Convert a character-basis element to the ``self._other`` basis. 

 

This is a recursive procedure that is calculated 

by the assumption that the leading term of ``self(lam)`` 

is ``other(lam)`` and 

``evalsf(self(lam),n) == other([n-sum(lam)]+lam)``. 

 

INPUT: 

 

- ``lam`` -- a partition 

 

OUTPUT: 

 

- an expression in the ``self._other`` basis 

 

EXAMPLES:: 

 

sage: Sym = SymmetricFunctions(QQ) 

sage: ht = SymmetricFunctions(QQ).ht() 

sage: ht._self_to_other_on_basis(Partition([2,1])) 

h[1] - 2*h[1, 1] + h[2, 1] 

sage: st = SymmetricFunctions(QQ).st() 

sage: st._self_to_other_on_basis(Partition([2,1])) 

3*s[1] - 2*s[1, 1] - 2*s[2] + s[2, 1] 

 

TESTS:: 

 

sage: h = SymmetricFunctions(QQ).h() 

sage: ht = SymmetricFunctions(QQ).ht() 

sage: st = SymmetricFunctions(QQ).st() 

sage: all(ht(h(ht[la])) == ht[la] for i in range(5) for la in Partitions(i)) 

True 

sage: all(h(ht(h[la])) == h[la] for i in range(5) for la in Partitions(i)) 

True 

sage: all(st(h(st[la])) == st[la] for i in range(5) for la in Partitions(i)) 

True 

sage: all(h(st(h[la])) == h[la] for i in range(5) for la in Partitions(i)) 

True 

""" 

if not lam: 

return self._other([]) 

n = sum(lam) + lam[0] 

sim = self._other(self._other(lam).character_to_frobenius_image(n)) 

return self._other(lam) - sum(c*self._self_to_other_on_basis(Partition(mu[1:])) 

for (mu,c) in sim if mu[1:] != lam) 

 

class irreducible_character_basis(generic_character): 

r""" 

The irreducible symmetric group character basis of 

the symmetric functions. 

 

This is a basis of the symmetric functions that has the 

property that ``self(la).character_to_frobenius_image(n)`` 

is equal to ``s([n-sum(la)]+la)``. 

 

It should also have the property that the (outer) structure 

constants are the analogue of the stable kronecker 

coefficients on the Schur basis (where ``other`` is either the 

Schur or homogeneous bases). 

 

This basis is introduced in [OZ2015]_. 

 

EXAMPLES:: 

 

sage: Sym = SymmetricFunctions(QQ) 

sage: s = Sym.s() 

sage: h = Sym.h() 

sage: ht = SymmetricFunctions(QQ).ht() 

sage: st = SymmetricFunctions(QQ).st() 

sage: st(ht[2,1]) 

st[] + 2*st[1] + st[1, 1] + 2*st[2] + st[2, 1] + st[3] 

sage: ht(st[2,1]) 

ht[1] - ht[1, 1] + ht[2, 1] - ht[3] 

sage: s(st[2,1]) 

3*s[1] - 2*s[1, 1] - 2*s[2] + s[2, 1] 

sage: st(s[2,1]) 

st[] + 3*st[1] + 2*st[1, 1] + 2*st[2] + st[2, 1] 

sage: st[2]*st[1] 

st[1] + st[1, 1] + st[2] + st[2, 1] + st[3] 

sage: s[4,2].kronecker_product(s[5,1]) 

s[3, 2, 1] + s[3, 3] + s[4, 1, 1] + s[4, 2] + s[5, 1] 

sage: st[1,1,1].counit() 

-1 

sage: all(sum(c*st(la)*st(mu).antipode() for 

....: ((la,mu),c) in st(ga).coproduct())==st(st(ga).counit()) 

....: for ga in Partitions(3)) 

True 

 

TESTS:: 

 

sage: TestSuite(st).run() 

""" 

def __init__(self, Sym, pfix): 

r""" 

Initialize the basis and register coercions. 

 

The coercions are set up between the ``other_basis`` 

 

INPUT: 

 

- ``Sym`` -- an instance of the symmetric function algebra 

- ``pfix`` -- a prefix to use for the basis 

 

EXAMPLES:: 

 

sage: Sym = SymmetricFunctions(QQ) 

sage: ht = SymmetricFunctions(QQ).ht(); ht 

Symmetric Functions over Rational Field in the induced trivial 

character basis 

sage: st = SymmetricFunctions(QQ).st(); st 

Symmetric Functions over Rational Field in the irreducible 

symmetric group character basis 

""" 

SFA_generic.__init__(self, Sym, 

basis_name="irreducible symmetric group character", 

prefix=pfix, graded=False) 

self._other = Sym.Schur() 

self._p = Sym.powersum() 

 

self.module_morphism(self._self_to_power_on_basis, 

codomain=Sym.powersum()).register_as_coercion() 

from sage.categories.morphism import SetMorphism 

self.register_coercion(SetMorphism(Hom(self._other, self), 

self._other_to_self)) 

 

def _b_power_k(self, k): 

r""" 

An expression involving moebius inversion in the powersum generators. 

 

For a positive value of ``k``, this expression is 

 

.. MATH:: 

 

\frac{1}{k} \sum_{d|k} \mu(d/k) p_d. 

 

INPUT: 

 

- ``k`` -- a positive integer 

 

OUTPUT: 

 

- an expression in the powersum basis of the symmetric functions 

 

EXAMPLES:: 

 

sage: st = SymmetricFunctions(QQ).st() 

sage: st._b_power_k(1) 

p[1] 

sage: st._b_power_k(2) 

-1/2*p[1] + 1/2*p[2] 

sage: st._b_power_k(6) 

1/6*p[1] - 1/6*p[2] - 1/6*p[3] + 1/6*p[6] 

 

""" 

if k == 1: 

return self._p([1]) 

if k > 0: 

return ~k * self._p.sum(moebius(k/d)*self._p([d]) 

for d in divisors(k)) 

 

def _b_power_k_r(self, k, r): 

r""" 

An expression involving moebius inversion in the powersum generators. 

 

For a positive value of ``k``, this expression is 

 

.. MATH:: 

 

\sum_{j=0}^r (-1)^{r-j}k^j\binom{r,j} \left( 

\frac{1}{k} \sum_{d|k} \mu(d/k) p_d \right)_k. 

 

INPUT: 

 

- ``k``, ``r`` -- positive integers 

 

OUTPUT: 

 

- an expression in the powersum basis of the symmetric functions 

 

EXAMPLES:: 

 

sage: st = SymmetricFunctions(QQ).st() 

sage: st._b_power_k_r(1,1) 

-p[] + p[1] 

sage: st._b_power_k_r(2,2) 

p[] + 4*p[1] + p[1, 1] - 4*p[2] - 2*p[2, 1] + p[2, 2] 

sage: st._b_power_k_r(3,2) 

p[] + 5*p[1] + p[1, 1] - 5*p[3] - 2*p[3, 1] + p[3, 3] 

 

""" 

p = self._p 

return p.sum( (-1)**(r-j) * k**j * binomial(r,j) 

* p.prod(self._b_power_k(k) - i*p.one() for i in range(j)) 

for j in range(r+1) ) 

 

def _b_power_gamma(self, gamma): 

r""" 

An expression involving moebius inversion in the powersum generators. 

 

For a partition `\gamma = (1^{m_1}, 2^{m_2}, \ldots r^{m_r})`, 

this expression is 

 

.. MATH:: 

 

{\mathbf p}_{\ga} = \sum_{k \geq 1} {\mathbf p}_{k^{m_k}}, 

 

where 

 

.. MATH:: 

 

{\mathbf p}_{k^r} = \sum_{j=0}^r (-1)^{r-j}k^j\binom{r,j} 

\left( \frac{1}{k} \sum_{d|k} \mu(d/k) p_d \right)_k~. 

 

INPUT: 

 

- ``gamma`` -- a partition 

 

OUTPUT: 

 

- an expression in the powersum basis of the symmetric functions 

 

EXAMPLES:: 

 

sage: st = SymmetricFunctions(QQ).st() 

sage: st._b_power_k_r(1,1) 

-p[] + p[1] 

sage: st._b_power_k_r(2,2) 

p[] + 4*p[1] + p[1, 1] - 4*p[2] - 2*p[2, 1] + p[2, 2] 

sage: st._b_power_k_r(3,2) 

p[] + 5*p[1] + p[1, 1] - 5*p[3] - 2*p[3, 1] + p[3, 3] 

 

""" 

return self._p.prod( self._b_power_k_r(Integer(k),Integer(r)) 

for (k,r) in six.iteritems(gamma.to_exp_dict()) ) 

 

def _self_to_power_on_basis(self, lam): 

r""" 

An expansion of the irreducible character in the powersum basis. 

 

The formula for the irreducible character basis indexed by the 

partition ``lam`` is given by the formula 

 

.. MATH:: 

 

\sum_{\gamma} \chi^{\lambda}(\gamma) 

\frac{{\mathbf p}_\gamma}{z_\gamma}, 

 

where `\chi^{\lambda}(\gamma)` is the irreducible character 

indexed by the partition `\lambda` and evaluated at an element 

of cycle structure `\gamma` and `{\mathbf p}_\gamma` is the 

power sum expression calculated in the method 

:meth:`_b_power_gamma`. 

 

INPUT: 

 

- ``lam`` -- a partition 

 

OUTPUT: 

 

- an expression in the power sum basis 

 

EXAMPLES:: 

 

sage: st = SymmetricFunctions(QQ).st() 

sage: st._self_to_power_on_basis([2,1]) 

3*p[1] - 2*p[1, 1] + 1/3*p[1, 1, 1] - 1/3*p[3] 

sage: st._self_to_power_on_basis([1,1]) 

p[] - p[1] + 1/2*p[1, 1] - 1/2*p[2] 

 

""" 

return self._p.sum( c*self._b_power_gamma(ga) 

for (ga, c) in self._p(self._other(lam)) ) 

 

@cached_method 

def _self_to_other_on_basis(self, lam): 

r""" 

An expansion of the irreducible character basis in the Schur basis. 

 

Compute the Schur expansion by first computing it in the 

powersum basis and the coercing to the Schur basis. 

 

INPUT: 

 

- ``lam`` -- a partition 

 

OUTPUT: 

 

- an expression in the Schur basis 

 

EXAMPLES:: 

 

sage: st = SymmetricFunctions(QQ).st() 

sage: st._self_to_other_on_basis(Partition([1,1])) 

s[] - s[1] + s[1, 1] 

sage: st._self_to_other_on_basis(Partition([2,1])) 

3*s[1] - 2*s[1, 1] - 2*s[2] + s[2, 1] 

""" 

return self._other(self._self_to_power_on_basis(lam))