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

r""" 

Classical Crystals 

""" 

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

# Copyright (C) 2010 Anne Schilling <anne at math.ucdavis.edu> 

# 

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

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

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

 

from sage.misc.cachefunc import cached_method 

from sage.categories.category_singleton import Category_singleton 

from sage.categories.crystals import Crystals 

from sage.categories.finite_crystals import FiniteCrystals 

from sage.categories.regular_crystals import RegularCrystals 

from sage.categories.highest_weight_crystals import HighestWeightCrystals 

from sage.categories.tensor import TensorProductsCategory 

 

class ClassicalCrystals(Category_singleton): 

""" 

The category of classical crystals, that is crystals of finite Cartan type. 

 

EXAMPLES:: 

 

sage: C = ClassicalCrystals() 

sage: C 

Category of classical crystals 

sage: C.super_categories() 

[Category of regular crystals, 

Category of finite crystals, 

Category of highest weight crystals] 

sage: C.example() 

Highest weight crystal of type A_3 of highest weight omega_1 

 

TESTS:: 

 

sage: TestSuite(C).run() 

sage: B = ClassicalCrystals().example() 

sage: TestSuite(B).run(verbose = True) 

running ._test_an_element() . . . pass 

running ._test_cardinality() . . . pass 

running ._test_category() . . . pass 

running ._test_elements() . . . 

Running the test suite of self.an_element() 

running ._test_category() . . . pass 

running ._test_eq() . . . pass 

running ._test_new() . . . pass 

running ._test_not_implemented_methods() . . . pass 

running ._test_pickling() . . . pass 

running ._test_stembridge_local_axioms() . . . pass 

pass 

running ._test_elements_eq_reflexive() . . . pass 

running ._test_elements_eq_symmetric() . . . pass 

running ._test_elements_eq_transitive() . . . pass 

running ._test_elements_neq() . . . pass 

running ._test_enumerated_set_contains() . . . pass 

running ._test_enumerated_set_iter_cardinality() . . . pass 

running ._test_enumerated_set_iter_list() . . . pass 

running ._test_eq() . . . pass 

running ._test_fast_iter() . . . pass 

running ._test_new() . . . pass 

running ._test_not_implemented_methods() . . . pass 

running ._test_pickling() . . . pass 

running ._test_some_elements() . . . pass 

running ._test_stembridge_local_axioms() . . . pass 

""" 

 

def super_categories(self): 

r""" 

EXAMPLES:: 

 

sage: ClassicalCrystals().super_categories() 

[Category of regular crystals, 

Category of finite crystals, 

Category of highest weight crystals] 

""" 

return [RegularCrystals(), FiniteCrystals(), HighestWeightCrystals()] 

 

def example(self, n = 3): 

""" 

Returns an example of highest weight crystals, as per 

:meth:`Category.example`. 

 

EXAMPLES:: 

 

sage: B = ClassicalCrystals().example(); B 

Highest weight crystal of type A_3 of highest weight omega_1 

""" 

return Crystals().example(n) 

 

def additional_structure(self): 

r""" 

Return ``None``. 

 

Indeed, the category of classical crystals defines no 

additional structure: it only states that its objects are 

`U_q(\mathfrak{g})`-crystals, where `\mathfrak{g}` is of 

finite type. 

 

.. SEEALSO:: :meth:`Category.additional_structure` 

 

EXAMPLES:: 

 

sage: ClassicalCrystals().additional_structure() 

""" 

return None 

 

 

class ParentMethods: 

 

def opposition_automorphism(self): 

r""" 

Deprecated in :trac:`15560`. Use the corresponding method in 

Cartan type. 

 

EXAMPLES:: 

 

sage: T = crystals.Tableaux(['A',5],shape=[1]) 

sage: T.opposition_automorphism() 

doctest:...: DeprecationWarning: opposition_automorphism is deprecated. 

Use opposition_automorphism from the Cartan type instead. 

See http://trac.sagemath.org/15560 for details. 

Finite family {1: 5, 2: 4, 3: 3, 4: 2, 5: 1} 

""" 

from sage.misc.superseded import deprecation 

deprecation(15560, 'opposition_automorphism is deprecated. Use' 

' opposition_automorphism from the Cartan type instead.') 

return self.cartan_type().opposition_automorphism() 

 

def demazure_character(self, w, f = None): 

r""" 

Returns the Demazure character associated to ``w``. 

 

INPUT: 

 

- ``w`` -- an element of the ambient weight lattice 

realization of the crystal, or a reduced word, or an element 

in the associated Weyl group 

 

OPTIONAL: 

 

- ``f`` -- a function from the crystal to a module 

 

This is currently only supported for crystals whose underlying 

weight space is the ambient space. 

 

The Demazure character is obtained by applying the Demazure operator 

`D_w` (see :meth:`sage.categories.regular_crystals.RegularCrystals.ParentMethods.demazure_operator`) 

to the highest weight element of the classical crystal. The simple 

Demazure operators `D_i` (see 

:meth:`sage.categories.regular_crystals.RegularCrystals.ElementMethods.demazure_operator_simple`) 

do not braid on the level of crystals, but on the level of characters they do. 

That is why it makes sense to input ``w`` either as a weight, a reduced word, 

or as an element of the underlying Weyl group. 

 

EXAMPLES:: 

 

sage: T = crystals.Tableaux(['A',2], shape = [2,1]) 

sage: e = T.weight_lattice_realization().basis() 

sage: weight = e[0] + 2*e[2] 

sage: weight.reduced_word() 

[2, 1] 

sage: T.demazure_character(weight) 

x1^2*x2 + x1*x2^2 + x1^2*x3 + x1*x2*x3 + x1*x3^2 

 

sage: T = crystals.Tableaux(['A',3],shape=[2,1]) 

sage: T.demazure_character([1,2,3]) 

x1^2*x2 + x1*x2^2 + x1^2*x3 + x1*x2*x3 + x2^2*x3 

sage: W = WeylGroup(['A',3]) 

sage: w = W.from_reduced_word([1,2,3]) 

sage: T.demazure_character(w) 

x1^2*x2 + x1*x2^2 + x1^2*x3 + x1*x2*x3 + x2^2*x3 

 

sage: T = crystals.Tableaux(['B',2], shape = [2]) 

sage: e = T.weight_lattice_realization().basis() 

sage: weight = -2*e[1] 

sage: T.demazure_character(weight) 

x1^2 + x1*x2 + x2^2 + x1 + x2 + x1/x2 + 1/x2 + 1/x2^2 + 1 

 

sage: T = crystals.Tableaux("B2",shape=[1/2,1/2]) 

sage: b2=WeylCharacterRing("B2",base_ring=QQ).ambient() 

sage: T.demazure_character([1,2],f=lambda x:b2(x.weight())) 

b2(-1/2,1/2) + b2(1/2,-1/2) + b2(1/2,1/2) 

 

REFERENCES: 

 

- [De1974]_ 

 

- [Ma2009]_ 

""" 

from sage.misc.misc_c import prod 

from sage.rings.integer_ring import ZZ 

from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing 

if hasattr(w, 'reduced_word'): 

word = w.reduced_word() 

else: 

word = w 

n = self.weight_lattice_realization().n 

u = self.algebra(ZZ).sum_of_monomials(self.module_generators) 

u = self.demazure_operator(u, word) 

if f is None: 

x = ['x%s'%i for i in range(1,n+1)] 

P = PolynomialRing(ZZ, x) 

# TODO: use P.linear_combination when PolynomialRing will be a ModulesWithBasis 

return sum((coeff*prod((x[i]**(c.weight()[i]) for i in range(n)), P.one()) for c, coeff in u), P.zero()) 

else: 

return sum((coeff*f(c)) for c, coeff in u) 

 

def character(self, R=None): 

""" 

Returns the character of this crystal. 

 

INPUT: 

 

- ``R`` -- a :class:`WeylCharacterRing` 

(default: the default :class:`WeylCharacterRing` for this Cartan type) 

 

Returns the character of ``self`` as an element of ``R``. 

 

EXAMPLES:: 

 

sage: C = crystals.Tableaux("A2", shape=[2,1]) 

sage: chi = C.character(); chi 

A2(2,1,0) 

 

sage: T = crystals.TensorProduct(C,C) 

sage: chiT = T.character(); chiT 

A2(2,2,2) + 2*A2(3,2,1) + A2(3,3,0) + A2(4,1,1) + A2(4,2,0) 

sage: chiT == chi^2 

True 

 

One may specify an alternate :class:`WeylCharacterRing`:: 

 

sage: R = WeylCharacterRing("A2", style="coroots") 

sage: chiT = T.character(R); chiT 

A2(0,0) + 2*A2(1,1) + A2(0,3) + A2(3,0) + A2(2,2) 

sage: chiT in R 

True 

 

It should have the same Cartan type and use the same 

realization of the weight lattice as ``self``:: 

 

sage: R = WeylCharacterRing("A3", style="coroots") 

sage: T.character(R) 

Traceback (most recent call last): 

... 

ValueError: Weyl character ring does not have the right Cartan type 

 

""" 

from sage.combinat.root_system.weyl_characters import WeylCharacterRing 

if R is None: 

R = WeylCharacterRing(self.cartan_type()) 

if not R.cartan_type() == self.cartan_type(): 

raise ValueError("Weyl character ring does not have the right Cartan type") 

assert R.basis().keys() == self.weight_lattice_realization() 

 

return R.sum_of_monomials( x.weight() for x in self.highest_weight_vectors() ) 

 

def __iter__(self): 

r""" 

Returns an iterator over the elements of this crystal. 

 

This iterator uses little memory, storing only one element 

of the crystal at a time. For details on the complexity, see 

:class:`sage.combinat.crystals.crystals.CrystalBacktracker`. 

 

EXAMPLES:: 

 

sage: C = crystals.Letters(['A',5]) 

sage: [x for x in C] 

[1, 2, 3, 4, 5, 6] 

 

TESTS:: 

 

sage: C = crystals.Letters(['D',4]) 

sage: D = crystals.SpinsPlus(['D',4]) 

sage: E = crystals.SpinsMinus(['D',4]) 

sage: T = crystals.TensorProduct(D,E,generators=[[D.list()[0],E.list()[0]]]) 

sage: U = crystals.TensorProduct(C,E,generators=[[C(1),E.list()[0]]]) 

sage: T.cardinality() 

56 

 

sage: TestSuite(T).run(verbose = True) 

running ._test_an_element() . . . pass 

running ._test_cardinality() . . . pass 

running ._test_category() . . . pass 

running ._test_elements() . . . 

Running the test suite of self.an_element() 

running ._test_category() . . . pass 

running ._test_eq() . . . pass 

running ._test_new() . . . pass 

running ._test_not_implemented_methods() . . . pass 

running ._test_pickling() . . . pass 

running ._test_stembridge_local_axioms() . . . pass 

pass 

running ._test_elements_eq_reflexive() . . . pass 

running ._test_elements_eq_symmetric() . . . pass 

running ._test_elements_eq_transitive() . . . pass 

running ._test_elements_neq() . . . pass 

running ._test_enumerated_set_contains() . . . pass 

running ._test_enumerated_set_iter_cardinality() . . . pass 

running ._test_enumerated_set_iter_list() . . . pass 

running ._test_eq() . . . pass 

running ._test_fast_iter() . . . pass 

running ._test_new() . . . pass 

running ._test_not_implemented_methods() . . . pass 

running ._test_pickling() . . . pass 

running ._test_some_elements() . . . pass 

running ._test_stembridge_local_axioms() . . . pass 

 

sage: TestSuite(U).run(verbose = True) 

running ._test_an_element() . . . pass 

running ._test_cardinality() . . . pass 

running ._test_category() . . . pass 

running ._test_elements() . . . 

Running the test suite of self.an_element() 

running ._test_category() . . . pass 

running ._test_eq() . . . pass 

running ._test_new() . . . pass 

running ._test_not_implemented_methods() . . . pass 

running ._test_pickling() . . . pass 

running ._test_stembridge_local_axioms() . . . pass 

pass 

running ._test_elements_eq_reflexive() . . . pass 

running ._test_elements_eq_symmetric() . . . pass 

running ._test_elements_eq_transitive() . . . pass 

running ._test_elements_neq() . . . pass 

running ._test_enumerated_set_contains() . . . pass 

running ._test_enumerated_set_iter_cardinality() . . . pass 

running ._test_enumerated_set_iter_list() . . . pass 

running ._test_eq() . . . pass 

running ._test_fast_iter() . . . pass 

running ._test_new() . . . pass 

running ._test_not_implemented_methods() . . . pass 

running ._test_pickling() . . . pass 

running ._test_some_elements() . . . pass 

running ._test_stembridge_local_axioms() . . . pass 

 

Bump's systematic tests:: 

 

sage: fa3 = lambda a,b,c: crystals.Tableaux(['A',3],shape=[a+b+c,b+c,c]) 

sage: fb3 = lambda a,b,c: crystals.Tableaux(['B',3],shape=[a+b+c,b+c,c]) 

sage: fc3 = lambda a,b,c: crystals.Tableaux(['C',3],shape=[a+b+c,b+c,c]) 

sage: fb4 = lambda a,b,c,d: crystals.Tableaux(['B',4],shape=[a+b+c+d,b+c+d,c+d,d]) 

sage: fd4 = lambda a,b,c,d: crystals.Tableaux(['D',4],shape=[a+b+c+d,b+c+d,c+d,d]) 

sage: fd5 = lambda a,b,c,d,e: crystals.Tableaux(['D',5],shape=[a+b+c+d+e,b+c+d+e,c+d+e,d+e,e]) 

sage: def fd4spinplus(a,b,c,d): 

....: C = crystals.Tableaux(['D',4],shape=[a+b+c+d,b+c+d,c+d,d]) 

....: D = crystals.SpinsPlus(['D',4]) 

....: return crystals.TensorProduct(C,D,generators=[[C[0],D[0]]]) 

sage: def fb3spin(a,b,c): 

....: C = crystals.Tableaux(['B',3],shape=[a+b+c,b+c,c]) 

....: D = crystals.Spins(['B',3]) 

....: return crystals.TensorProduct(C,D,generators=[[C[0],D[0]]]) 

 

.. TODO:: 

 

Choose a good panel of values for `a,b,c ...` both for 

basic systematic tests and for conditionally run, 

computationally involved tests. 

 

:: 

 

sage: TestSuite(fb4(1,0,1,0)).run(verbose = True) # long time (8s on sage.math, 2011) 

running ._test_an_element() . . . pass 

running ._test_cardinality() . . . pass 

running ._test_category() . . . pass 

running ._test_elements() . . . 

Running the test suite of self.an_element() 

running ._test_category() . . . pass 

running ._test_eq() . . . pass 

running ._test_new() . . . pass 

running ._test_not_implemented_methods() . . . pass 

running ._test_pickling() . . . pass 

running ._test_stembridge_local_axioms() . . . pass 

pass 

running ._test_elements_eq_reflexive() . . . pass 

running ._test_elements_eq_symmetric() . . . pass 

running ._test_elements_eq_transitive() . . . pass 

running ._test_elements_neq() . . . pass 

running ._test_enumerated_set_contains() . . . pass 

running ._test_enumerated_set_iter_cardinality() . . . pass 

running ._test_enumerated_set_iter_list() . . . pass 

running ._test_eq() . . . pass 

running ._test_fast_iter() . . . pass 

running ._test_new() . . . pass 

running ._test_not_implemented_methods() . . . pass 

running ._test_pickling() . . . pass 

running ._test_some_elements() . . . pass 

running ._test_stembridge_local_axioms() . . . pass 

 

:: 

 

#sage: fb4(1,1,1,1).check() # expensive: the crystal is of size 297297 

#True 

""" 

from sage.combinat.crystals.crystals import CrystalBacktracker 

return iter(CrystalBacktracker(self)) 

 

def _test_fast_iter(self, **options): 

r""" 

Tests whether the elements returned by :meth:`.__iter__` 

and ``Crystal.list(self)`` are the same (the two 

algorithms are different). 

 

EXAMPLES:: 

 

sage: C = crystals.Letters(['A', 5]) 

sage: C._test_fast_iter() 

""" 

tester = self._tester(**options) 

S = list(self) 

SS = list(Crystals().parent_class.__iter__(self)) 

tester.assertTrue( len(S) == len(SS) ) 

tester.assertTrue( len(S) == len(set(S))) 

tester.assertTrue( set(S) == set(SS) ) 

 

def cardinality(self): 

r""" 

Returns the number of elements of the crystal, using Weyl's 

dimension formula on each connected component. 

 

EXAMPLES:: 

 

sage: C = ClassicalCrystals().example(5) 

sage: C.cardinality() 

6 

""" 

return sum(self.weight_lattice_realization().weyl_dimension(x.weight()) 

for x in self.highest_weight_vectors()) 

 

class ElementMethods: 

 

def lusztig_involution(self): 

r""" 

Return the Lusztig involution on the classical highest weight 

crystal ``self``. 

 

The Lusztig involution on a finite-dimensional highest weight 

crystal `B(\lambda)` of highest weight `\lambda` maps the 

highest weight vector to the lowest weight vector and the 

Kashiwara operator `f_i` to `e_{i^*}`, where `i^*` is defined as 

`\alpha_{i^*} = -w_0(\alpha_i)`. Here `w_0` is the longest element 

of the Weyl group acting on the `i`-th simple root `\alpha_i`. 

 

EXAMPLES:: 

 

sage: B = crystals.Tableaux(['A',3],shape=[2,1]) 

sage: b = B(rows=[[1,2],[4]]) 

sage: b.lusztig_involution() 

[[1, 4], [3]] 

sage: b.to_tableau().schuetzenberger_involution(n=4) 

[[1, 4], [3]] 

 

sage: all(b.lusztig_involution().to_tableau() == b.to_tableau().schuetzenberger_involution(n=4) for b in B) 

True 

 

sage: B = crystals.Tableaux(['D',4],shape=[1]) 

sage: [[b,b.lusztig_involution()] for b in B] 

[[[[1]], [[-1]]], [[[2]], [[-2]]], [[[3]], [[-3]]], [[[4]], [[-4]]], [[[-4]], 

[[4]]], [[[-3]], [[3]]], [[[-2]], [[2]]], [[[-1]], [[1]]]] 

 

sage: B = crystals.Tableaux(['D',3],shape=[1]) 

sage: [[b,b.lusztig_involution()] for b in B] 

[[[[1]], [[-1]]], [[[2]], [[-2]]], [[[3]], [[3]]], [[[-3]], [[-3]]], 

[[[-2]], [[2]]], [[[-1]], [[1]]]] 

 

sage: C = CartanType(['E',6]) 

sage: La = C.root_system().weight_lattice().fundamental_weights() 

sage: T = crystals.HighestWeight(La[1]) 

sage: t = T[3]; t 

[(-4, 2, 5)] 

sage: t.lusztig_involution() 

[(-2, -3, 4)] 

""" 

hw = self.to_highest_weight()[1] 

hw.reverse() 

A = self.parent().cartan_type().opposition_automorphism() 

hw = [A[i] for i in hw] 

return self.to_lowest_weight()[0].e_string(hw) 

 

class TensorProducts(TensorProductsCategory): 

""" 

The category of classical crystals constructed by tensor 

product of classical crystals. 

""" 

@cached_method 

def extra_super_categories(self): 

""" 

EXAMPLES:: 

 

sage: ClassicalCrystals().TensorProducts().extra_super_categories() 

[Category of classical crystals] 

""" 

return [self.base_category()]