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

500

501

502

503

504

505

506

507

508

509

510

511

512

513

514

515

516

517

518

519

520

521

522

523

524

525

526

527

528

529

530

531

532

533

534

535

536

537

538

539

540

541

542

543

544

545

546

547

548

549

550

551

552

553

554

555

556

557

558

559

560

561

562

563

564

565

566

567

568

569

570

571

572

573

574

575

576

577

578

579

580

581

582

583

584

585

586

587

588

589

590

591

592

593

594

595

596

597

598

599

600

601

602

603

604

605

606

607

608

609

610

611

612

613

614

615

616

617

618

619

620

621

622

623

624

625

626

627

628

629

630

631

632

633

634

635

636

637

638

639

640

641

642

643

644

645

646

647

648

649

650

651

652

653

654

655

656

657

658

659

660

661

662

663

664

665

666

667

668

669

670

671

672

673

674

675

676

677

678

679

680

681

682

683

684

685

686

687

688

689

690

691

692

693

694

695

696

697

698

699

700

701

702

703

704

705

706

707

708

709

710

711

712

713

714

715

716

717

718

719

720

721

722

723

724

725

726

727

728

729

730

731

732

733

734

735

736

737

738

739

740

741

742

743

744

745

746

747

748

749

750

751

752

753

754

755

756

757

758

759

760

761

762

763

764

765

766

767

768

769

770

771

772

773

774

775

776

777

778

779

780

781

782

783

784

785

786

787

788

789

790

791

792

793

794

795

796

797

798

799

800

801

802

803

804

805

806

807

808

809

810

811

812

813

814

815

816

817

818

819

820

821

822

823

824

825

826

827

828

829

830

831

832

833

834

835

836

837

838

839

840

841

842

843

844

845

846

847

848

849

850

851

852

853

854

855

856

857

858

859

860

861

862

863

864

865

866

867

868

869

870

871

872

873

874

875

876

877

878

879

880

881

882

883

884

885

886

887

888

889

890

891

892

893

894

895

896

897

898

899

900

901

902

903

904

905

906

907

908

909

910

911

912

913

914

915

916

917

918

919

920

921

922

923

924

925

926

927

928

929

930

931

932

933

934

935

936

937

938

939

940

941

942

943

944

945

946

947

948

949

950

951

952

953

954

955

956

957

958

959

960

961

962

963

964

965

966

967

968

969

970

971

972

973

974

975

976

977

978

979

980

981

982

983

984

985

986

987

988

989

990

991

992

993

994

995

996

997

998

999

1000

1001

1002

1003

1004

1005

1006

1007

1008

1009

1010

1011

1012

1013

1014

1015

1016

1017

1018

1019

1020

1021

1022

1023

1024

1025

1026

1027

1028

1029

1030

1031

1032

1033

1034

1035

1036

1037

1038

1039

1040

1041

1042

1043

1044

1045

1046

1047

1048

1049

1050

1051

1052

1053

1054

1055

1056

1057

1058

1059

1060

1061

1062

1063

1064

1065

1066

1067

1068

1069

1070

1071

1072

1073

1074

1075

1076

1077

1078

1079

1080

1081

1082

1083

1084

1085

1086

1087

1088

1089

1090

1091

1092

1093

1094

1095

1096

1097

1098

1099

1100

1101

1102

1103

1104

1105

1106

1107

1108

1109

1110

1111

1112

1113

1114

1115

1116

1117

1118

1119

1120

1121

1122

1123

1124

1125

1126

1127

1128

1129

1130

1131

1132

1133

1134

1135

1136

1137

1138

1139

1140

1141

1142

1143

1144

1145

1146

1147

1148

1149

1150

1151

1152

1153

1154

1155

1156

1157

1158

1159

1160

1161

1162

1163

1164

1165

1166

1167

1168

1169

1170

1171

1172

1173

1174

1175

1176

1177

1178

1179

1180

1181

1182

1183

1184

1185

1186

1187

1188

1189

1190

1191

1192

1193

1194

1195

1196

1197

1198

1199

1200

1201

1202

1203

1204

1205

1206

1207

1208

1209

1210

1211

1212

1213

1214

1215

1216

1217

1218

1219

1220

1221

1222

1223

1224

1225

1226

1227

1228

1229

1230

1231

1232

1233

1234

1235

1236

1237

1238

1239

1240

1241

1242

1243

1244

1245

1246

1247

1248

1249

1250

1251

1252

1253

1254

1255

1256

1257

1258

1259

1260

1261

1262

1263

1264

1265

1266

1267

1268

1269

1270

1271

1272

1273

1274

1275

1276

1277

1278

1279

1280

1281

1282

1283

1284

1285

1286

1287

1288

1289

1290

1291

1292

1293

1294

1295

1296

1297

1298

1299

1300

1301

1302

1303

1304

1305

1306

1307

1308

1309

1310

1311

1312

1313

1314

1315

1316

1317

1318

1319

1320

1321

1322

1323

1324

1325

1326

1327

1328

1329

1330

1331

1332

1333

1334

1335

1336

1337

1338

1339

1340

1341

1342

1343

1344

1345

1346

1347

1348

1349

1350

1351

1352

1353

1354

1355

1356

1357

1358

1359

1360

1361

1362

1363

1364

1365

1366

1367

1368

1369

1370

1371

1372

1373

1374

1375

1376

1377

1378

1379

1380

1381

1382

1383

1384

1385

1386

1387

1388

1389

1390

1391

1392

1393

1394

1395

1396

1397

1398

1399

1400

1401

1402

1403

1404

1405

1406

1407

1408

1409

1410

1411

1412

1413

1414

1415

1416

1417

1418

1419

1420

1421

1422

1423

1424

1425

1426

1427

1428

1429

1430

1431

1432

1433

1434

1435

1436

1437

1438

1439

1440

1441

1442

1443

1444

1445

1446

1447

1448

1449

1450

1451

1452

1453

1454

1455

1456

1457

1458

1459

1460

1461

1462

1463

1464

1465

1466

1467

1468

1469

1470

1471

1472

1473

1474

1475

1476

1477

1478

1479

1480

1481

1482

1483

1484

1485

1486

1487

1488

1489

1490

1491

1492

1493

1494

1495

1496

1497

1498

1499

1500

1501

1502

1503

1504

1505

1506

1507

1508

1509

1510

1511

1512

1513

1514

1515

1516

1517

1518

1519

1520

1521

1522

1523

1524

1525

1526

1527

1528

1529

1530

1531

1532

1533

1534

1535

1536

1537

1538

1539

1540

1541

1542

1543

1544

1545

1546

1547

1548

1549

1550

1551

1552

1553

1554

1555

1556

1557

1558

1559

1560

1561

1562

1563

1564

1565

1566

1567

1568

1569

1570

1571

1572

1573

1574

1575

1576

1577

1578

1579

1580

1581

1582

1583

1584

1585

1586

1587

1588

1589

1590

1591

1592

1593

1594

1595

1596

1597

1598

1599

1600

1601

1602

1603

1604

1605

1606

1607

1608

1609

1610

1611

1612

1613

1614

1615

1616

1617

1618

1619

1620

1621

1622

1623

1624

1625

1626

1627

1628

1629

1630

1631

1632

1633

1634

1635

1636

1637

1638

1639

1640

1641

1642

1643

1644

1645

1646

1647

1648

1649

1650

1651

1652

1653

1654

1655

1656

1657

1658

1659

1660

1661

1662

1663

1664

1665

1666

1667

1668

1669

1670

1671

1672

1673

1674

1675

1676

1677

1678

1679

1680

1681

1682

1683

1684

1685

1686

1687

1688

1689

1690

1691

1692

1693

1694

1695

1696

1697

1698

1699

1700

1701

1702

1703

1704

1705

1706

1707

1708

1709

1710

1711

1712

1713

1714

1715

1716

1717

1718

1719

1720

1721

1722

1723

1724

1725

1726

1727

1728

1729

1730

1731

1732

1733

1734

1735

1736

1737

1738

1739

1740

1741

1742

1743

1744

1745

1746

1747

1748

1749

1750

1751

1752

1753

1754

1755

1756

1757

1758

1759

1760

1761

1762

1763

1764

1765

1766

1767

1768

1769

1770

1771

1772

1773

1774

1775

1776

1777

1778

1779

1780

1781

1782

1783

1784

1785

1786

1787

1788

1789

1790

1791

1792

1793

1794

1795

1796

1797

1798

1799

1800

1801

1802

1803

1804

1805

1806

1807

1808

1809

1810

1811

1812

1813

1814

1815

1816

1817

1818

1819

1820

1821

1822

1823

1824

1825

r""" 

Nonsymmetric Macdonald polynomials 

 

AUTHORS: 

 

- Anne Schilling and Nicolas M. Thiery (2013): initial version 

 

ACKNOWLEDGEMENTS: 

 

The initial version of this code (together with :class:`.root_lattice_realization_algebras.Algebras` 

and :class:`.hecke_algebra_representation.HeckeAlgebraRepresentation`) was written by 

Anne Schilling and Nicolas M. Thiery during the ICERM Semester Program on "Automorphic Forms, 

Combinatorial Representation Theory and Multiple Dirichlet Series" (January 28, 2013 - May 3, 2013) 

with the help of Dan Bump, Ben Brubaker, Bogdan Ion, Dan Orr, Arun Ram, Siddhartha Sahi, and Mark Shimozono. 

Special thanks go to Bogdan Ion and Mark Shimozono for their patient explanations and hand computations 

to check the code. 

""" 

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

# Copyright (C) 2013 Nicolas M. Thiery <nthiery at users.sf.net> 

# 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.misc.lazy_attribute import lazy_attribute 

from sage.rings.integer_ring import ZZ 

from sage.combinat.free_module import CombinatorialFreeModule 

from sage.combinat.root_system.hecke_algebra_representation import CherednikOperatorsEigenvectors 

 

 

class NonSymmetricMacdonaldPolynomials(CherednikOperatorsEigenvectors): 

r""" 

Nonsymmetric Macdonald polynomials 

 

INPUT: 

 

- ``KL`` -- an affine Cartan type or the group algebra of a 

realization of the affine weight lattice 

- ``q``, ``q1``, ``q2`` -- parameters in the base ring of the group algebra (default: ``q``, ``q1``, ``q2``) 

- ``normalized`` -- a boolean (default: ``True``) 

whether to normalize the result to have leading coefficient 1 

 

This implementation covers all reduced affine root systems. 

The polynomials are constructed recursively by the application 

of intertwining operators. 

 

.. TODO:: 

 

- Non-reduced case (Koornwinder polynomials). 

- Non-equal parameters for the affine Hecke algebra. 

- Choice of convention (dominant/anti-dominant, ...). 

- More uniform implementation of the `T_0^\vee` operator. 

- Optimizations, in particular in the calculation of the 

eigenvalues for the recursion. 

 

EXAMPLES: 

 

We construct the family of nonsymmetric Macdonald polynomials in 

three variables in type `A`:: 

 

sage: E = NonSymmetricMacdonaldPolynomials(["A",2,1]) 

 

They are constructed as elements of the group algebra of the 

classical weight lattice `L_0` (or one of its realizations, such as 

the ambient space, which is used here) and indexed by elements of `L_0`:: 

 

sage: L0 = E.keys(); L0 

Ambient space of the Root system of type ['A', 2] 

 

Here is the nonsymmetric Macdonald polynomial with leading term 

`[2,0,1]`:: 

 

sage: E[L0([2,0,1])] 

((-q*q1-q*q2)/(-q*q1-q2))*B[(1, 1, 1)] + ((-q1-q2)/(-q*q1-q2))*B[(2, 1, 0)] + B[(2, 0, 1)] 

 

It can be seen as a polynomial (or in general a Laurent 

polynomial) by interpreting each term as an exponent vector. The 

parameter `q` is the exponential of the null (co)root, whereas 

`q_1` and `q_2` are the two eigenvalues of each generator 

`T_i` of the affine Hecke algebra (see the background section for 

details). 

 

By setting `q_1=t`, `q_2=-1` and using the 

:meth:`.root_lattice_realization_algebras.Algebras.ElementMethods.expand` 

method, we recover the nonsymmetric Macdonald polynomial as 

computed by [HHL06]_'s combinatorial formula:: 

 

sage: K = QQ['q,t'].fraction_field() 

sage: q,t = K.gens() 

sage: E = NonSymmetricMacdonaldPolynomials(["A",2,1], q=q, q1=t, q2=-1) 

sage: vars = K['x0,x1,x2'].gens() 

sage: E[L0([2,0,1])].expand(vars) 

((-t + 1)/(-q*t + 1))*x0^2*x1 + x0^2*x2 + ((-q*t + q)/(-q*t + 1))*x0*x1*x2 

 

sage: from sage.combinat.sf.ns_macdonald import E 

sage: E([2,0,1]) 

((-t + 1)/(-q*t + 1))*x0^2*x1 + x0^2*x2 + ((-q*t + q)/(-q*t + 1))*x0*x1*x2 

 

Here is a type `G_2^{(1)}` nonsymmetric Macdonald polynomial:: 

 

sage: E = NonSymmetricMacdonaldPolynomials(["G",2,1]) 

sage: L0 = E.keys() 

sage: omega = L0.fundamental_weights() 

sage: E[ omega[2]-omega[1] ] 

((-q*q1^3*q2-q*q1^2*q2^2)/(q*q1^4-q2^4))*B[(0, 0, 0)] + B[(1, -1, 0)] + ((-q1*q2^3-q2^4)/(q*q1^4-q2^4))*B[(1, 0, -1)] 

 

Many more examples are given after the background section. 

 

.. SEEALSO:: 

 

- :func:`sage.combinat.sf.ns_macdonald.E` 

- :meth:`SymmetricFunctions.macdonald` 

 

.. RUBRIC:: Background 

 

.. RUBRIC:: The polynomial module 

 

The nonsymmetric Macdonald polynomials are a distinguished basis of the "polynomial" module 

of the affine Hecke algebra. Given:: 

 

- a ground ring `K`, which contains the input parameters `q, q_1, q_2` 

- an affine root system, specified by a Cartan type `C` 

- a realization `L` of the weight lattice of type `C` 

 

the polynomial module is the group algebra `K[L_0]` of the classical 

weight lattice `L_0` with coefficients in `K`. It is isomorphic to the 

Laurent polynomial ring over `K` generated by the formal exponentials 

of any basis of `L_0`. 

 

In our running example `L` is the ambient space of type `C_2^{(1)}`:: 

 

sage: K = QQ['q,q1,q2'].fraction_field() 

sage: q, q1, q2 = K.gens() 

sage: C = CartanType(["C",2,1]) 

sage: L = RootSystem(C).ambient_space(); L 

Ambient space of the Root system of type ['C', 2, 1] 

 

sage: L.simple_roots() 

Finite family {0: -2*e[0] + e['delta'], 1: e[0] - e[1], 2: 2*e[1]} 

sage: omega = L.fundamental_weights(); omega 

Finite family {0: e['deltacheck'], 1: e[0] + e['deltacheck'], 2: e[0] + e[1] + e['deltacheck']} 

 

sage: L0 = L.classical(); L0 

Ambient space of the Root system of type ['C', 2] 

sage: KL0 = L0.algebra(K); KL0 

Algebra of the Ambient space of the Root system of type ['C', 2] 

over Fraction Field of Multivariate Polynomial Ring in q, q1, q2 over Rational Field 

 

.. RUBRIC:: Affine Hecke algebra 

 

The affine Hecke algebra is generated by elements `T_i` for ``i`` in the 

set of affine Dynkin nodes. They satisfy the same braid relations 

as the simple reflections `s_i` of the affine Weyl group. 

The `T_i` satisfy the quadratic relation 

 

.. MATH:: 

 

(T_i-q_1)\circ(T_i-q_2) = 0 

 

where `q_1` and `q_2` are the input parameters. Some of the 

representation theory requires that `q_1` and `q_2` satisfy 

additional relations; typically one uses the specializations 

`q_1=u` and `q_2=-1/u` or `q_1=t` and `q_2=-1`). This can be 

achieved by constructing an appropriate field and passing `q_1` 

and `q_2` appropriately; see the examples. In principle, the 

parameter(s) could further depend on ``i``; this is not yet 

implemented but the code has been designed in such a way that this 

feature is easy to add. 

 

.. RUBRIC:: Demazure-Lusztig operators 

 

The ``i``-th Demazure-Lusztig operator is an operator on `K[L]` 

which interpolates between the reflection `s_i` and the Demazure operator `\pi_i` 

(see :meth:`.root_lattice_realization.RootLatticeRealization.Algebras.ParentMethods.demazure_lusztig_operators`).:: 

 

sage: KL = L.algebra(K); KL 

Algebra of the Ambient space of the Root system of type ['C', 2, 1] 

over Fraction Field of Multivariate Polynomial Ring in q, q1, q2 over Rational Field 

sage: T = KL.demazure_lusztig_operators(q1, q2) 

sage: x = KL.monomial(omega[1]); x 

B[e[0] + e['deltacheck']] 

sage: T[2](x) 

q1*B[e[0] + e['deltacheck']] 

sage: T[1](x) 

(q1+q2)*B[e[0] + e['deltacheck']] + q1*B[e[1] + e['deltacheck']] 

sage: T[0](x) 

q1*B[e[0] + e['deltacheck']] 

 

The affine Hecke algebra acts on `K[L]` by letting the generators `T_i` act by 

the Demazure-Lusztig operators. The class 

:class:`sage.combinat.root_system.hecke_algebra_representation.HeckeAlgebraRepresentation` 

implements some simple generic features for representations of affine Hecke algebras 

defined by the action of their `T`-generators.:: 

 

sage: T 

A representation of the (q1, q2)-Hecke algebra of type ['C', 2, 1] on Algebra of the Ambient space of the Root system of type ['C', 2, 1] over Fraction Field of Multivariate Polynomial Ring in q, q1, q2 over Rational Field 

sage: type(T) 

<class 'sage.combinat.root_system.hecke_algebra_representation.HeckeAlgebraRepresentation'> 

sage: T._test_relations() # long time (1.3s) 

 

Here we construct the operator `q_1 T_2^{-1}\circ T_1^{-1}T_0` 

from a signed reduced word:: 

 

sage: T.Tw([0,1,2],[1,-1,-1], q1^2) 

Generic endomorphism of Algebra of the Ambient space of the Root system of type ['C', 2, 1] 

over Fraction Field of Multivariate Polynomial Ring in q, q1, q2 over Rational Field 

 

(note the reversal of the word). Inverses are computed using the 

quadratic relation. 

 

.. RUBRIC:: Cherednik operators 

 

The affine Hecke algebra contains elements `Y_\lambda` indexed by 

the coroot lattice. Their action on `K[L]` is implemented in Sage:: 

 

sage: Y = T.Y(); Y 

Lazy family (...)_{i in Coroot lattice of the Root system of type ['C', 2, 1]} 

sage: alphacheck = Y.keys().simple_roots() 

sage: Y1 = Y[alphacheck[1]] 

sage: Y1(x) 

((q1^3+q1^2*q2)/(-q2^3))*B[-e[0] - 2*e[1] - e['delta'] + e['deltacheck']] 

+ ((q1^3+2*q1^2*q2+q1*q2^2)/(-q2^3))*B[-e[0] - e['delta'] + e['deltacheck']] 

+ ((q1^3+q1^2*q2)/(-q2^3))*B[e[0] - 2*e[1] - 2*e['delta'] + e['deltacheck']] 

+ ((q1^3+q1^2*q2)/(-q2^3))*B[e[0] - 2*e[1] - e['delta'] + e['deltacheck']] 

+ ((q1^3+2*q1^2*q2+q1*q2^2)/(-q2^3))*B[e[0] - 2*e['delta'] + e['deltacheck']] 

+ ((q1^3+q1^2*q2)/(-q2^3))*B[e[0] - e['delta'] + e['deltacheck']] + ((q1^2+2*q1*q2+q2^2)/(-q1*q2))*B[e[0] + e['deltacheck']] 

+ ((q1^3+q1^2*q2)/(-q2^3))*B[2*e[0] - e[1] - 2*e['delta'] + e['deltacheck']] 

+ ((-q1^2-q1*q2)/(-q2^2))*B[2*e[0] - e[1] - e['delta'] + e['deltacheck']] + (q1^3/(-q2^3))*B[3*e[0] - 2*e[1] - 3*e['delta'] + e['deltacheck']] 

+ ((q1^3+q1^2*q2)/(-q2^3))*B[3*e[0] - 3*e['delta'] + e['deltacheck']] 

+ ((q1^3+2*q1^2*q2+q1*q2^2)/(-q2^3))*B[-e[1] - e['delta'] + e['deltacheck']] 

+ ((-q1^2-2*q1*q2-q2^2)/(-q2^2))*B[-e[1] + e['deltacheck']] + ((q1+q2)/(-q2))*B[e[1] + e['deltacheck']] 

 

The Cherednik operators span a Laurent polynomial ring inside the 

affine Hecke algebra; namely `\lambda\mapsto Y_\lambda` is a group 

isomorphism from the classical root lattice (viewed additively) to 

the affine Hecke algebra (viewed multiplicatively). In practice, 

`Y_\lambda` is constructed by computing combinatorially its signed 

reduced word (and an overall scalar factor) using the periodic 

orientation of the alcove model in the coweight lattice (see 

:meth:`.hecke_algebra_representation.HeckeAlgebraRepresentation.Y_lambdacheck`):: 

 

sage: Lcheck = L.root_system.coweight_lattice() 

sage: w = Lcheck.reduced_word_of_translation(Lcheck(alphacheck[1])); w 

[0, 2, 1, 0, 2, 1] 

sage: Lcheck.signs_of_alcovewalk(w) 

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

 

.. RUBRIC:: Level zero representation of the affine Hecke algebra 

 

The action of the affine Hecke algebra on `K[L]` induces 

an action on `K[L_0]`: the action of `T_i` on `X^\lambda` for `\lambda` a 

classical weight in `L_0` is obtained by embedding the weight at 

level zero in the affine weight lattice (see 

:meth:`.weight_lattice_realizations.WeightLatticeRealizations.ParentMethods.embed_at_level`) 

applying the Demazure-Lusztig operator there, and projecting from `K[L]\to K[L_0]` 

mapping the exponential of `\delta` to `q` (see 

:meth:`.root_lattice_realization_algebras.Algebras.ParentMethods.q_project`). This is implemented in 

:meth:`.root_lattice_realization_algebras.Algebras.ParentMethods.demazure_lusztig_operators_on_classical`:: 

 

sage: T = KL.demazure_lusztig_operators_on_classical(q, q1,q2) 

sage: omega = L0.fundamental_weights() 

sage: x = KL0.monomial(omega[1]) 

sage: T[0](x) 

(-q*q2)*B[(-1, 0)] 

 

For classical nodes these are the usual Demazure-Lusztig operators:: 

 

sage: T[1](x) 

(q1+q2)*B[(1, 0)] + q1*B[(0, 1)] 

 

.. RUBRIC:: Nonsymmetric Macdonald polynomials 

 

We can now finally define the nonsymmetric Macdonald polynomials. 

Because the Cherednik operators commute (and there is no radical), 

they can be simultaneously diagonalized; namely, `K[L_0]` admits a 

`K`-basis of joint eigenvectors for the `Y_\lambda`. For `\mu \in 

L_0`, the nonsymmetric Macdonald polynomial `E_\mu` is the unique 

eigenvector of the family of Cherednik operators `Y_\lambda` 

having `\mu` as leading term:: 

 

sage: E = NonSymmetricMacdonaldPolynomials(KL, q, q1, q2); E 

The family of the Macdonald polynomials of type ['C', 2, 1] with parameters q, q1, q2 

 

Or for short:: 

 

sage: E = NonSymmetricMacdonaldPolynomials(C) 

 

.. RUBRIC:: Recursive construction of the nonsymmetric Macdonald polynomials 

 

The generators `T_i` of the affine Hecke algebra almost skew 

commute with the Cherednik operators. More precisely, one 

can deform them into the so-called intertwining operators: 

 

.. MATH:: \tau_i = T_i - (q_1+q_2) \frac{Y_i^{a-1}}{1-Y_i^a}\,. 

 

(where `a=1` except for `i=0` in type `BC` where `a=a_0=2`) which 

satisfy the following skew commutation relations: 

 

.. MATH:: \tau_i Y_\lambda = \tau_i Y_{s_i\lambda} \,. 

 

If `s_i \mu \ne \mu`, applying `\tau_i` on an eigenvector `E_\mu` 

produces a new eigenvector (essentially `E_{s_i\mu}`) with a 

distinct eigenvalue. It follows that the eigenvectors indexed by 

an affine Weyl orbit of weights, may be recursively computed from 

a single weight in the orbit. 

 

In the case at hand, there is a little complication: namely, the 

simple reflections `s_i` acting at level 0 do not act transitively 

on classical weights; in fact the orbits for the classical Weyl 

group and for the affine Weyl group are the same. Thus, one can 

construct the nonsymmetric Macdonald polynomials for all weights 

from those for the classical dominant weights, but one is lacking 

a creation operator to construct the nonsymmetric Macdonald 

polynomials for dominant weights. 

 

.. RUBRIC:: Twisted Demazure-Lusztig operators 

 

To compensate for this, one needs to consider another affinization 

of the action of the classical Demazure-Lusztig operators 

`T_1,\dots,T_n`, which gives rise to the double affine Hecke algebra. 

Following Cherednik, one adds another operator `T_0^\vee` implemented in: 

:meth:`.root_lattice_realization_algebras.Algebras.ParentMethods.T0_check_on_basis`. 

See also: 

:meth:`.root_lattice_realization_algebras.Algebras.ParentMethods.twisted_demazure_lusztig_operators`. 

 

Depending on the type (untwisted or not), this is a representation 

of the affine Hecke algebra for another affinization of the 

classical Cartan type. The corresponding action of the affine Weyl 

group -- which is used to compute the recursion on `\mu` -- occurs 

in the corresponding weight lattice realization:: 

 

sage: E.L() 

Ambient space of the Root system of type ['C', 2, 1] 

sage: E.L_prime() 

Coambient space of the Root system of type ['B', 2, 1] 

sage: E.L_prime().classical() 

Ambient space of the Root system of type ['C', 2] 

 

See :meth:`L_prime` and 

:meth:`.cartan_type.CartanType_affine.other_affinization`. 

 

REFERENCES: 

 

.. [HaimanICM] \M. Haiman, Cherednik algebras, Macdonald polynomials and combinatorics, 

Proceedings of the International Congress of Mathematicians, 

Madrid 2006, Vol. III, 843-872. 

 

.. [HHL06] \J. Haglund, M. Haiman and N. Loehr, 

A combinatorial formula for nonsymmetric Macdonald polynomials, 

Amer. J. Math. 130, No. 2 (2008), 359-383. 

 

.. [LNSSS12] \C. Lenart, S. Naito, D. Sagaki, A. Schilling, M. Shimozono, 

A uniform model for Kirillov-Reshetikhin crystals I: Lifting 

the parabolic quantum Bruhat graph, preprint arXiv.1211.2042 

[math.QA] 

 

.. RUBRIC:: More examples 

 

We show how to create the nonsymmetric Macdonald polynomials in 

two different ways and check that they are the same:: 

 

sage: K = QQ['q,u'].fraction_field() 

sage: q, u = K.gens() 

sage: E = NonSymmetricMacdonaldPolynomials(['D',3,1], q, u, -1/u) 

sage: omega = E.keys().fundamental_weights() 

sage: E[omega[1]+omega[3]] 

((-q*u^2+q)/(-q*u^4+1))*B[(1/2, -1/2, 1/2)] + ((-q*u^2+q)/(-q*u^4+1))*B[(1/2, 1/2, -1/2)] + B[(3/2, 1/2, 1/2)] 

 

sage: KL = RootSystem(["D",3,1]).ambient_space().algebra(K) 

sage: P = NonSymmetricMacdonaldPolynomials(KL, q, u, -1/u) 

sage: E[omega[1]+omega[3]] == P[omega[1]+omega[3]] 

True 

sage: E[E.keys()((0,1,-1))] 

((-q*u^2+q)/(-q*u^2+1))*B[(0, 0, 0)] + ((-u^2+1)/(-q*u^2+1))*B[(1, 1, 0)] 

+ ((-u^2+1)/(-q*u^2+1))*B[(1, 0, -1)] + B[(0, 1, -1)] 

 

In type `A`, there is also a combinatorial implementation of the 

nonsymmetric Macdonald polynomials in terms of augmented diagram 

fillings as in [HHL06]_. See 

:func:`sage.combinat.sf.ns_macdonald.E`. First we check that 

these polynomials are indeed eigenvectors of the Cherednik 

operators:: 

 

sage: K = QQ['q,t'].fraction_field() 

sage: q,t = K.gens() 

sage: q1 = t; q2 = -1 

sage: KL = RootSystem(["A",2,1]).ambient_space().algebra(K) 

sage: KL0 = KL.classical() 

sage: E = NonSymmetricMacdonaldPolynomials(KL,q, q1, q2) 

sage: omega = E.keys().fundamental_weights() 

sage: w = omega[1] 

sage: import sage.combinat.sf.ns_macdonald as NS 

sage: p = NS.E([1,0,0]); p 

x0 

sage: pp = KL0.from_polynomial(p) 

sage: E.eigenvalues(KL0.from_polynomial(p)) 

[t, (-1)/(-q*t^2), t] 

 

sage: def eig(l): return E.eigenvalues(KL0.from_polynomial(NS.E(l))) 

 

sage: eig([1,0,0]) 

[t, (-1)/(-q*t^2), t] 

sage: eig([2,0,0]) 

[q*t, (-1)/(-q^2*t^2), t] 

sage: eig([3,0,0]) 

[q^2*t, (-1)/(-q^3*t^2), t] 

sage: eig([2,0,4]) 

[(-1)/(-q^3*t), 1/(q^2*t), q^4*t^2] 

 

Next we check explicitly that they agree with the current implementation:: 

 

sage: K = QQ['q','t'].fraction_field() 

sage: q,t = K.gens() 

sage: KL = RootSystem(["A",1,1]).ambient_lattice().algebra(K) 

sage: E = NonSymmetricMacdonaldPolynomials(KL,q, t, -1) 

sage: L0 = E.keys() 

sage: KL0 = KL.classical() 

sage: P = K['x0,x1'] 

sage: def EE(weight): return E[L0(weight)].expand(P.gens()) 

sage: import sage.combinat.sf.ns_macdonald as NS 

sage: EE([0,0]) 

1 

sage: NS.E([0,0]) 

1 

sage: EE([1,0]) 

x0 

sage: NS.E([1,0]) 

x0 

sage: EE([0,1]) 

((-t + 1)/(-q*t + 1))*x0 + x1 

sage: NS.E([0,1]) 

((-t + 1)/(-q*t + 1))*x0 + x1 

 

sage: NS.E([2,0]) 

x0^2 + ((-q*t + q)/(-q*t + 1))*x0*x1 

sage: EE([2,0]) 

x0^2 + ((-q*t + q)/(-q*t + 1))*x0*x1 

 

The same, directly in the ambient lattice with several shifts:: 

 

sage: E[L0([2,0])] 

((-q*t+q)/(-q*t+1))*B[(1, 1)] + B[(2, 0)] 

sage: E[L0([1,-1])] 

((-q*t+q)/(-q*t+1))*B[(0, 0)] + B[(1, -1)] 

sage: E[L0([0,-2])] 

((-q*t+q)/(-q*t+1))*B[(-1, -1)] + B[(0, -2)] 

 

Systematic checks with Sage's implementation of [HHL06]_:: 

 

sage: assert all(EE([x,y]) == NS.E([x,y]) for d in range(5) for x,y in IntegerVectors(d,2)) 

 

With the current implementation, we can compute nonsymmetric 

Macdonald polynomials for any type, for example for type `E_6^{(1)}`:: 

 

sage: K=QQ['q,u'].fraction_field() 

sage: q, u = K.gens() 

sage: KL = RootSystem(["E",6,1]).weight_space(extended=True).algebra(K) 

sage: E = NonSymmetricMacdonaldPolynomials(KL,q,u,-1/u) 

sage: L0 = E.keys() 

 

sage: E[L0.fundamental_weight(1).weyl_action([2,4,3,2,1])] 

((-u^2+1)/(-q*u^16+1))*B[-Lambda[1] + Lambda[3]] + ((-u^2+1)/(-q*u^16+1))*B[Lambda[1]] 

+ B[-Lambda[2] + Lambda[5]] + ((-u^2+1)/(-q*u^16+1))*B[Lambda[2] - Lambda[4] + Lambda[5]] 

+ ((-u^2+1)/(-q*u^16+1))*B[-Lambda[3] + Lambda[4]] 

 

sage: E[L0.fundamental_weight(2).weyl_action([2,5,3,4,2])] # long time (6s) 

((-q^2*u^20+q^2*u^18+q*u^2-q)/(-q^2*u^32+2*q*u^16-1))*B[0] 

+ B[Lambda[1] - Lambda[3] + Lambda[4] - Lambda[5] + Lambda[6]] 

+ ((-u^2+1)/(-q*u^16+1))*B[Lambda[1] - Lambda[3] + Lambda[5]] 

+ ((-q*u^20+q*u^18+u^2-1)/(-q^2*u^32+2*q*u^16-1))*B[-Lambda[2] + Lambda[4]] 

+ ((-q*u^20+q*u^18+u^2-1)/(-q^2*u^32+2*q*u^16-1))*B[Lambda[2]] 

+ ((u^4-2*u^2+1)/(q^2*u^32-2*q*u^16+1))*B[Lambda[3] - Lambda[4] + Lambda[5]] 

+ ((-u^2+1)/(-q*u^16+1))*B[Lambda[3] - Lambda[5] + Lambda[6]] 

 

sage: E[L0.fundamental_weight(1)+L0.fundamental_weight(6)] # long time (13s) 

((q^2*u^10-q^2*u^8-q^2*u^2+q^2)/(q^2*u^26-q*u^16-q*u^10+1))*B[0] 

+ ((-q*u^2+q)/(-q*u^10+1))*B[Lambda[1] - Lambda[2] + Lambda[6]] 

+ ((-q*u^2+q)/(-q*u^10+1))*B[Lambda[1] + Lambda[2] - Lambda[4] + Lambda[6]] 

+ ((-q*u^2+q)/(-q*u^10+1))*B[Lambda[1] - Lambda[3] + Lambda[4] - Lambda[5] + Lambda[6]] 

+ ((-q*u^2+q)/(-q*u^10+1))*B[Lambda[1] - Lambda[3] + Lambda[5]] + B[Lambda[1] + Lambda[6]] 

+ ((-q*u^2+q)/(-q*u^10+1))*B[-Lambda[2] + Lambda[4]] + ((-q*u^2+q)/(-q*u^10+1))*B[Lambda[2]] 

+ ((-q*u^2+q)/(-q*u^10+1))*B[Lambda[3] - Lambda[4] + Lambda[5]] 

+ ((-q*u^2+q)/(-q*u^10+1))*B[Lambda[3] - Lambda[5] + Lambda[6]] 

 

We test various other types:: 

 

sage: K=QQ['q,u'].fraction_field() 

sage: q, u = K.gens() 

sage: KL = RootSystem(["A",5,2]).ambient_space().algebra(K) 

sage: E = NonSymmetricMacdonaldPolynomials(KL, q, u, -1/u) 

sage: L0 = E.keys() 

sage: E[L0.fundamental_weight(2)] 

((-q*u^2+q)/(-q*u^8+1))*B[(0, 0, 0)] + B[(1, 1, 0)] 

sage: E[L0((0,-1,1))] # long time (1.5s) 

((-q^2*u^10+q^2*u^8-q*u^6+q*u^4+q*u^2+u^2-q-1)/(-q^3*u^12+q^2*u^8+q*u^4-1))*B[(0, 0, 0)] 

+ ((-u^2+1)/(-q*u^4+1))*B[(1, -1, 0)] 

+ ((u^6-u^4-u^2+1)/(q^3*u^12-q^2*u^8-q*u^4+1))*B[(1, 1, 0)] 

+ ((u^4-2*u^2+1)/(q^3*u^12-q^2*u^8-q*u^4+1))*B[(1, 0, -1)] 

+ ((q^2*u^12-q^2*u^10-u^2+1)/(q^3*u^12-q^2*u^8-q*u^4+1))*B[(1, 0, 1)] + B[(0, -1, 1)] 

+ ((-u^2+1)/(-q^2*u^8+1))*B[(0, 1, -1)] + ((-u^2+1)/(-q^2*u^8+1))*B[(0, 1, 1)] 

 

sage: K=QQ['q,u'].fraction_field() 

sage: q, u = K.gens() 

sage: KL = RootSystem(["E",6,2]).ambient_space().algebra(K) 

sage: E = NonSymmetricMacdonaldPolynomials(KL,q,u,-1/u) 

sage: L0 = E.keys() 

sage: E[L0.fundamental_weight(4)] # long time (5s) 

((-q^3*u^20+q^3*u^18+q^2*u^2-q^2)/(-q^3*u^28+q^2*u^22+q*u^6-1))*B[(0, 0, 0, 0)] 

+ ((-q*u^2+q)/(-q*u^6+1))*B[(1/2, 1/2, -1/2, -1/2)] + ((-q*u^2+q)/(-q*u^6+1))*B[(1/2, 1/2, -1/2, 1/2)] 

+ ((-q*u^2+q)/(-q*u^6+1))*B[(1/2, 1/2, 1/2, -1/2)] + ((-q*u^2+q)/(-q*u^6+1))*B[(1/2, 1/2, 1/2, 1/2)] 

+ ((q*u^2-q)/(q*u^6-1))*B[(1, 0, 0, 0)] + B[(1, 1, 0, 0)] + ((-q*u^2+q)/(-q*u^6+1))*B[(0, 1, 0, 0)] 

sage: E[L0((1,-1,0,0))] # long time (23s) 

((q^3*u^18-q^3*u^16+q*u^4-q^2*u^2-2*q*u^2+q^2+q)/(q^3*u^18-q^2*u^12-q*u^6+1))*B[(0, 0, 0, 0)] 

+ ((-q^3*u^18+q^3*u^16+q*u^2-q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(1/2, -1/2, -1/2, -1/2)] 

+ ((-q^3*u^18+q^3*u^16+q*u^2-q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(1/2, -1/2, -1/2, 1/2)] 

+ ((q^3*u^18-q^3*u^16-q*u^2+q)/(q^3*u^18-q^2*u^12-q*u^6+1))*B[(1/2, -1/2, 1/2, -1/2)] 

+ ((q^3*u^18-q^3*u^16-q*u^2+q)/(q^3*u^18-q^2*u^12-q*u^6+1))*B[(1/2, -1/2, 1/2, 1/2)] 

+ ((q*u^8-q*u^6-q*u^2+q)/(q^3*u^18-q^2*u^12-q*u^6+1))*B[(1/2, 1/2, -1/2, -1/2)] 

+ ((q*u^8-q*u^6-q*u^2+q)/(q^3*u^18-q^2*u^12-q*u^6+1))*B[(1/2, 1/2, -1/2, 1/2)] 

+ ((-q*u^8+q*u^6+q*u^2-q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(1/2, 1/2, 1/2, -1/2)] 

+ ((-q*u^8+q*u^6+q*u^2-q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(1/2, 1/2, 1/2, 1/2)] 

+ ((-q^2*u^18+q^2*u^16-q*u^8+q*u^6+q*u^2+u^2-q-1)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(1, 0, 0, 0)] 

+ B[(1, -1, 0, 0)] + ((-u^2+1)/(-q^2*u^12+1))*B[(1, 1, 0, 0)] + ((-u^2+1)/(-q^2*u^12+1))*B[(1, 0, -1, 0)] 

+ ((u^2-1)/(q^2*u^12-1))*B[(1, 0, 1, 0)] + ((-u^2+1)/(-q^2*u^12+1))*B[(1, 0, 0, -1)] 

+ ((-u^2+1)/(-q^2*u^12+1))*B[(1, 0, 0, 1)] + ((-q*u^2+q)/(-q*u^6+1))*B[(0, -1, 0, 0)] 

+ ((-q*u^4+2*q*u^2-q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(0, 1, 0, 0)] 

+ ((-q*u^4+2*q*u^2-q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(0, 0, -1, 0)] 

+ ((-q*u^4+2*q*u^2-q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(0, 0, 1, 0)] 

+ ((-q*u^4+2*q*u^2-q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(0, 0, 0, -1)] 

+ ((-q*u^4+2*q*u^2-q)/(-q^3*u^18+q^2*u^12+q*u^6-1))*B[(0, 0, 0, 1)] 

 

Next we test a twisted type (checked against Maple computation by 

Bogdan Ion for `q_1=t^2` and `q_2=-1`):: 

 

sage: E = NonSymmetricMacdonaldPolynomials(["A",5,2]) 

sage: omega = E.keys() 

 

sage: E[omega[1]] 

B[(1, 0, 0)] 

 

sage: E[-omega[1]] 

B[(-1, 0, 0)] + ((-q*q1^6-q*q1^5*q2-q1*q2^5-q2^6)/(-q^3*q1^6-q^2*q1^5*q2-q*q1*q2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*q1^2-q2^2))*B[(1, 0, -1)] 

+ ((q1*q2+q2^2)/(-q*q1^2+q2^2))*B[(1, 0, 1)] 

 

sage: E[omega[3]] 

((-q1*q2^2-q2^3)/(-q*q1^3-q2^3))*B[(1, 0, 0)] + ((-q1*q2^2-q2^3)/(-q*q1^3-q2^3))*B[(0, 1, 0)] + B[(0, 0, 1)] 

 

sage: E[-omega[3]] 

((q*q1^4*q2+q*q1^3*q2^2-q1*q2^4-q2^5)/(-q^2*q1^5-q2^5))*B[(1, 0, 0)] + ((q*q1^4*q2+q*q1^3*q2^2-q1*q2^4-q2^5)/(-q^2*q1^5-q2^5))*B[(0, 1, 0)] 

+ B[(0, 0, -1)] + ((-q1*q2^4-q2^5)/(-q^2*q1^5-q2^5))*B[(0, 0, 1)] 

 

.. RUBRIC:: Comparison with the energy function of crystals 

 

Next we test that the nonsymmetric Macdonald polynomials at `t=0` 

match with the one-dimensional configuration sums involving 

Kirillov-Reshetikhin crystals for various types. See 

[LNSSS12]_:: 

 

sage: K = QQ['q,t'].fraction_field() 

sage: q,t = K.gens() 

sage: KL = RootSystem(["A",5,2]).ambient_space().algebra(K) 

sage: E = NonSymmetricMacdonaldPolynomials(KL, q, t, -1) 

sage: omega = E.keys().fundamental_weights() 

sage: E[-omega[1]].map_coefficients(lambda x:x.subs(t=0)) 

B[(-1, 0, 0)] + B[(1, 0, 0)] + B[(0, -1, 0)] + B[(0, 1, 0)] + B[(0, 0, -1)] + B[(0, 0, 1)] 

sage: E[-omega[2]].map_coefficients(lambda x:x.subs(t=0)) # long time (3s) 

(q+2)*B[(0, 0, 0)] + B[(-1, -1, 0)] + B[(-1, 1, 0)] + B[(-1, 0, -1)] 

+ B[(-1, 0, 1)] + B[(1, -1, 0)] + B[(1, 1, 0)] + B[(1, 0, -1)] + B[(1, 0, 1)] 

+ B[(0, -1, -1)] + B[(0, -1, 1)] + B[(0, 1, -1)] + B[(0, 1, 1)] 

 

:: 

 

sage: KL = RootSystem(["C",3,1]).ambient_space().algebra(K) 

sage: E = NonSymmetricMacdonaldPolynomials(KL,q, t,-1) 

sage: omega = E.keys().fundamental_weights() 

sage: E[-omega[2]].map_coefficients(lambda x:x.subs(t=0)) # long time (5s) 

2*B[(0, 0, 0)] + B[(-1, -1, 0)] + B[(-1, 1, 0)] + B[(-1, 0, -1)] 

+ B[(-1, 0, 1)] + B[(1, -1, 0)] + B[(1, 1, 0)] + B[(1, 0, -1)] + B[(1, 0, 1)] 

+ B[(0, -1, -1)] + B[(0, -1, 1)] + B[(0, 1, -1)] + B[(0, 1, 1)] 

 

:: 

 

sage: R = RootSystem(['C',3,1]) 

sage: KL = R.weight_lattice(extended=True).algebra(K) 

sage: E = NonSymmetricMacdonaldPolynomials(KL,q, t,-1) 

sage: omega = E.keys().fundamental_weights() 

sage: La = R.weight_space().basis() 

sage: LS = crystals.ProjectedLevelZeroLSPaths(2*La[1]) 

sage: E[-2*omega[1]].map_coefficients(lambda x:x.subs(t=0)) == LS.one_dimensional_configuration_sum(q) # long time (15s) 

True 

sage: LS = crystals.ProjectedLevelZeroLSPaths(La[1]+La[2]) 

sage: E[-omega[1]-omega[2]].map_coefficients(lambda x:x.subs(t=0)) == LS.one_dimensional_configuration_sum(q) # long time (45s) 

True 

 

:: 

 

sage: R = RootSystem(['C',2,1]) 

sage: KL = R.weight_lattice(extended=True).algebra(K) 

sage: E = NonSymmetricMacdonaldPolynomials(KL,q, t,-1) 

sage: omega = E.keys().fundamental_weights() 

sage: La = R.weight_space().basis() 

sage: for d in range(1,3): # long time (10s) 

....: for x,y in IntegerVectors(d,2): 

....: weight = x*La[1]+y*La[2] 

....: weight0 = -x*omega[1]-y*omega[2] 

....: LS = crystals.ProjectedLevelZeroLSPaths(weight) 

....: assert E[weight0].map_coefficients(lambda x:x.subs(t=0)) == LS.one_dimensional_configuration_sum(q) 

 

:: 

 

sage: R = RootSystem(['B',3,1]) 

sage: KL = R.weight_lattice(extended=True).algebra(K) 

sage: E = NonSymmetricMacdonaldPolynomials(KL,q, t,-1) 

sage: omega = E.keys().fundamental_weights() 

sage: La = R.weight_space().basis() 

sage: LS = crystals.ProjectedLevelZeroLSPaths(2*La[1]) 

sage: E[-2*omega[1]].map_coefficients(lambda x:x.subs(t=0)) == LS.one_dimensional_configuration_sum(q) # long time (23s) 

True 

sage: B = crystals.KirillovReshetikhin(['B',3,1],1,1) 

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

sage: T.one_dimensional_configuration_sum(q) == LS.one_dimensional_configuration_sum(q) # long time (2s) 

True 

 

:: 

 

sage: R = RootSystem(['BC',3,2]) 

sage: KL = R.weight_lattice(extended=True).algebra(K) 

sage: E = NonSymmetricMacdonaldPolynomials(KL,q, t,-1) 

sage: omega = E.keys().fundamental_weights() 

sage: La = R.weight_space().basis() 

sage: LS = crystals.ProjectedLevelZeroLSPaths(2*La[1]) 

sage: E[-2*omega[1]].map_coefficients(lambda x:x.subs(t=0)) == LS.one_dimensional_configuration_sum(q) # long time (21s) 

True 

 

:: 

 

sage: R = RootSystem(CartanType(['BC',3,2]).dual()) 

sage: KL = R.weight_space(extended=True).algebra(K) 

sage: E = NonSymmetricMacdonaldPolynomials(KL,q, t,-1) 

sage: omega = E.keys().fundamental_weights() 

sage: La = R.weight_space().basis() 

sage: LS = crystals.ProjectedLevelZeroLSPaths(2*La[1]) 

sage: g = E[-2*omega[1]].map_coefficients(lambda x:x.subs(t=0)) # long time (30s) 

sage: f = LS.one_dimensional_configuration_sum(q) # long time (1.5s) 

sage: P = g.support()[0].parent() # long time 

sage: B = P.algebra(q.parent()) # long time 

sage: sum(p[1]*B(P(p[0])) for p in f) == g # long time 

True 

 

:: 

 

sage: C = CartanType(['G',2,1]) 

sage: R = RootSystem(C.dual()) 

sage: K = QQ['q,t'].fraction_field() 

sage: q,t = K.gens() 

sage: KL = R.weight_lattice(extended=True).algebra(K) 

sage: E = NonSymmetricMacdonaldPolynomials(KL, q, t,-1) 

sage: omega = E.keys().fundamental_weights() 

sage: La = R.weight_space().basis() 

sage: LS = crystals.ProjectedLevelZeroLSPaths(2*La[1]) 

sage: E[-2*omega[1]].map_coefficients(lambda x:x.subs(t=0)) == LS.one_dimensional_configuration_sum(q) # long time (149s) 

True 

sage: LS = crystals.ProjectedLevelZeroLSPaths(La[1]+La[2]) 

sage: E[-omega[1]-omega[2]].map_coefficients(lambda x:x.subs(t=0)) == LS.one_dimensional_configuration_sum(q) # long time (23s) 

True 

 

The next test breaks if the energy is not scaled by the 

translation factor for dual type `G_2^{(1)}`:: 

 

sage: LS = crystals.ProjectedLevelZeroLSPaths(2*La[1]+La[2]) 

sage: E[-2*omega[1]-omega[2]].map_coefficients(lambda x:x.subs(t=0)) == LS.one_dimensional_configuration_sum(q) # long time 

True 

 

sage: R = RootSystem(['D',4,1]) 

sage: KL = R.weight_lattice(extended=True).algebra(K) 

sage: E = NonSymmetricMacdonaldPolynomials(KL, q, t,-1) 

sage: omega = E.keys().fundamental_weights() 

sage: La = R.weight_space().basis() 

sage: for d in range(1,2): # long time (41s) 

....: for a,b,c,d in IntegerVectors(d,4): 

....: weight = a*La[1]+b*La[2]+c*La[3]+d*La[4] 

....: weight0 = -a*omega[1]-b*omega[2]-c*omega[3]-d*omega[4] 

....: LS = crystals.ProjectedLevelZeroLSPaths(weight) 

....: assert E[weight0].map_coefficients(lambda x:x.subs(t=0)) == LS.one_dimensional_configuration_sum(q) 

 

TESTS: 

 

Calculations checked with Bogdan Ion 2013/04/18:: 

 

sage: K = QQ['q,t'].fraction_field() 

sage: q,t=K.gens() 

sage: E = NonSymmetricMacdonaldPolynomials(["B",2,1], q=q,q1=t,q2=-1/t) 

sage: L0 = E.keys() 

sage: omega = L0.fundamental_weights() 

 

sage: E[omega[1]] 

((-q*t^4+q*t^2)/(-q*t^6+1))*B[(0, 0)] + B[(1, 0)] 

sage: E[omega[2]] 

B[(1/2, 1/2)] 

sage: E[-omega[1]] 

((-q^2*t^8+q^2*t^6-q*t^6+2*q*t^4-q*t^2+t^2-1)/(-q^3*t^8+q^2*t^6+q*t^2-1))*B[(0, 0)] + B[(-1, 0)] + ((-q*t^8+q*t^6+t^2-1)/(-q^3*t^8+q^2*t^6+q*t^2-1))*B[(1, 0)] + ((-t^2+1)/(-q*t^2+1))*B[(0, -1)] + ((t^2-1)/(q*t^2-1))*B[(0, 1)] 

sage: E[L0([0,1])] 

((-q*t^4+q*t^2)/(-q*t^4+1))*B[(0, 0)] + ((-t^2+1)/(-q*t^4+1))*B[(1, 0)] + B[(0, 1)] 

sage: E[L0([1,1])] 

((q*t^2-q)/(q*t^2-1))*B[(0, 0)] + ((-q*t^2+q)/(-q*t^2+1))*B[(1, 0)] + B[(1, 1)] + ((-q*t^2+q)/(-q*t^2+1))*B[(0, 1)] 

 

sage: E = NonSymmetricMacdonaldPolynomials(["A",2,1], q=q,q1=t,q2=-1/t) 

sage: L0 = E.keys() 

sage: factor(E[L0([-1,0,1])][L0.zero()]) 

(t - 1) * (t + 1) * (q*t^2 - 1)^-3 * (q*t^2 + 1)^-1 * (q^3*t^6 + 2*q^2*t^6 - 3*q^2*t^4 - 2*q*t^2 - t^2 + q + 2) 

 

Checking step by step calculations in type `BC` with Bogdan Ion 2013/04/18:: 

 

sage: K = QQ['q,t'].fraction_field() 

sage: q,t=K.gens() 

sage: E = NonSymmetricMacdonaldPolynomials(["BC",1,2], q=q,q1=t,q2=-1/t) 

sage: KL0 = E.domain() 

sage: L0 = E.keys() 

sage: omega = L0.fundamental_weights() 

sage: e = L0.basis() 

sage: E._T_Y[1] ( KL0.monomial(e[0]) ) 

1/t*B[(-1)] 

sage: E._T_Y[0] ( KL0.monomial(L0.zero()) ) 

t*B[(0)] 

sage: E._T_Y[0] ( KL0.monomial(-e[0])) 

((-t^2+1)/(q*t))*B[(0)] + 1/(q^2*t)*B[(1)] 

 

sage: Y = E.Y() 

sage: alphacheck = Y.keys().simple_roots() 

sage: Y0 = Y[alphacheck[0]] 

sage: Y1 = Y[alphacheck[1]] 

sage: Y0 

Generic endomorphism of Algebra of the Ambient space of the Root system of type ['C', 1] 

over Fraction Field of Multivariate Polynomial Ring in q, t over Rational Field 

sage: Y0.word, Y0.signs, Y0.scalar 

((0, 1), (-1, -1), 1/q) 

sage: Y1.word, Y1.signs, Y1.scalar 

((1, 0), (1, 1), 1) 

 

sage: T0_check = E._T[0] 

 

Comparing with Bogdan Ion's hand calculations for type `BC`, 2013/05/13: 

 

.. TODO:: add his notes in latex 

 

:: 

 

sage: K = QQ['q,q1,q2'].fraction_field() 

sage: q,q1,q2=K.gens() 

sage: L = RootSystem(["A",4,2]).ambient_space() 

sage: L.cartan_type() 

['BC', 2, 2] 

sage: L.null_root() 

2*e['delta'] 

sage: L.simple_roots() 

Finite family {0: -e[0] + e['delta'], 1: e[0] - e[1], 2: 2*e[1]} 

sage: KL = L.algebra(K) 

sage: KL0 = KL.classical() 

sage: L0 = L.classical() 

sage: L0.cartan_type() 

['C', 2] 

 

sage: E = NonSymmetricMacdonaldPolynomials(KL, q=q,q1=q1,q2=q2) 

sage: E.keys() 

Ambient space of the Root system of type ['C', 2] 

sage: E.keys().simple_roots() 

Finite family {1: (1, -1), 2: (0, 2)} 

sage: omega = E.keys().fundamental_weights() 

 

sage: E[0*omega[1]] 

B[(0, 0)] 

sage: E[omega[1]] 

((-q*q1*q2^3-q*q2^4)/(q^2*q1^4-q2^4))*B[(0, 0)] + B[(1, 0)] 

 

sage: E[2*omega[2]] # long time # not checked against Bogdan's notes, but a good self-consistency test 

((-q^12*q1^6-q^12*q1^5*q2+2*q^10*q1^5*q2+5*q^10*q1^4*q2^2+3*q^10*q1^3*q2^3+2*q^8*q1^5*q2+4*q^8*q1^4*q2^2+q^8*q1^3*q2^3-q^8*q1^2*q2^4+q^8*q1*q2^5+q^8*q2^6-q^6*q1^3*q2^3+q^6*q1^2*q2^4+4*q^6*q1*q2^5+2*q^6*q2^6+q^4*q1^3*q2^3+3*q^4*q1^2*q2^4+4*q^4*q1*q2^5+2*q^4*q2^6)/(-q^12*q1^6-q^10*q1^5*q2-q^8*q1^3*q2^3+q^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+q^4*q2^2+q^2*q1*q2+q^2*q2^2)/(-q^6*q1^2+q2^2))*B[(2, 0)] + ((q^3*q1*q2+q^3*q2^2)/(-q^6*q1^2+q2^2))*B[(2, -1)] + ((-q^5*q1^2-q^5*q1*q2+q^3*q1*q2+q^3*q2^2+q*q1*q2+q*q2^2)/(-q^6*q1^2+q2^2))*B[(2, 1)] + B[(2, 2)] + ((-q^7*q1^2*q2-2*q^7*q1*q2^2-q^7*q2^3-q^5*q1^2*q2-2*q^5*q1*q2^2-q^5*q2^3)/(q^8*q1^3+q^6*q1^2*q2-q^2*q1*q2^2-q2^3))*B[(0, -1)] + ((q^7*q1^3+q^7*q1^2*q2-q^7*q1*q2^2-q^7*q2^3-2*q^5*q1^2*q2-4*q^5*q1*q2^2-2*q^5*q2^3-2*q^3*q1^2*q2-4*q^3*q1*q2^2-2*q^3*q2^3)/(q^8*q1^3+q^6*q1^2*q2-q^2*q1*q2^2-q2^3))*B[(0, 1)] + ((-q^6*q1^2-q^6*q1*q2+q^4*q1*q2+q^4*q2^2+q^2*q1*q2+q^2*q2^2)/(-q^6*q1^2+q2^2))*B[(0, 2)] 

sage: E.recursion(2*omega[2]) 

[0, 1, 0, 2, 1, 0, 2, 1, 0] 

 

Some tests that the `T` s are implemented properly by hand 

defining the `Y` s in terms of them:: 

 

sage: T = E._T_Y 

sage: Ye1 = T.Tw((1,2,1,0), scalar = (-1/(q1*q2))^2) 

sage: Ye2 = T.Tw((2,1,0,1), signs = (1,1,1,-1), scalar = (-1/(q1*q2))) 

sage: Yalpha0 = T.Tw((0,1,2,1), signs = (-1,-1,-1,-1), scalar = q^-1*(-q1*q2)^2) 

sage: Yalpha1 = T.Tw((1,2,0,1,2,0), signs=(1,1,-1,1,-1,1), scalar = -1/(q1*q2)) 

sage: Yalpha2 = T.Tw((2,1,0,1,2,1,0,1), signs = (1,1,1,-1,1,1,1,-1), scalar = (1/(q1*q2))^2) 

 

sage: Ye1(KL0.one()) 

q1^2/q2^2*B[(0, 0)] 

sage: Ye2(KL0.one()) 

((-q1)/q2)*B[(0, 0)] 

 

sage: Yalpha0(KL0.one()) 

q2^2/(q*q1^2)*B[(0, 0)] 

sage: Yalpha1(KL0.one()) 

((-q1)/q2)*B[(0, 0)] 

sage: Yalpha2(KL0.one()) 

q1^2/q2^2*B[(0, 0)] 

 

Testing the `Y` s directly:: 

 

sage: Y = E.Y() 

sage: Y.keys() 

Coroot lattice of the Root system of type ['BC', 2, 2] 

sage: alpha = Y.keys().simple_roots() 

sage: L(alpha[0]) 

-2*e[0] + e['deltacheck'] 

sage: L(alpha[1]) 

e[0] - e[1] 

sage: L(alpha[2]) 

e[1] 

 

sage: Y[alpha[0]].word 

(0, 1, 2, 1) 

sage: Y[alpha[0]].signs 

(-1, -1, -1, -1) 

sage: Y[alpha[0]].scalar # mind that Sage's q is the usual q^{1/2} 

q1^2*q2^2/q 

sage: Y[alpha[0]](KL0.one()) 

q2^2/(q*q1^2)*B[(0, 0)] 

 

sage: Y[alpha[1]].word 

(1, 2, 0, 1, 2, 0) 

sage: Y[alpha[1]].signs 

(1, 1, -1, 1, -1, 1) 

sage: Y[alpha[1]].scalar 

1/(-q1*q2) 

 

sage: Y[alpha[2]].word # Bogdan says it should be the square of that; do we need to take translation factors into account or not? 

(2, 1, 0, 1) 

sage: Y[alpha[2]].signs 

(1, 1, 1, -1) 

sage: Y[alpha[2]].scalar 

1/(-q1*q2) 

 

Checking the provided nonsymmetric Macdonald polynomial:: 

 

sage: E10 = KL0.monomial(L0((1,0))) + KL0( q*(1-(-q1/q2)) / (1-q^2*(-q1/q2)^4) ) 

sage: E10 == E[omega[1]] 

True 

sage: E.eigenvalues(E10) # not checked 

[q*q1^2/q2^2, q2^3/(-q^2*q1^3), q1/(-q2)] 

 

Checking T0check:: 

 

sage: T0check_on_basis = KL.T0_check_on_basis(q1,q2, convention="dominant") 

sage: T0check_on_basis.phi # note: this is in fact a0 phi 

(2, 0) 

sage: T0check_on_basis.v # what to match it with? 

(1,) 

sage: T0check_on_basis.j # what to match it with? 

2 

sage: T0check_on_basis(KL0.basis().keys().zero()) 

((-q1^2)/q2)*B[(1, 0)] 

 

sage: T0check = E._T[0] 

sage: T0check(KL0.one()) 

((-q1^2)/q2)*B[(1, 0)] 

 

 

Systematic tests of nonsymmetric Macdonald polynomials in type 

`A_1^{(1)}`, in the weight lattice. Each time, we specify the 

eigenvalues for the action of `Y_{\alpha_0}`, and `Y_{\alpha_1}`:: 

 

sage: K = QQ['q','t'].fraction_field() 

sage: q,t = K.gens() 

sage: KL = RootSystem(["A",1,1]).weight_lattice(extended=True).algebra(K) 

sage: E = NonSymmetricMacdonaldPolynomials(KL,q, t, -1) 

sage: omega = E.keys().fundamental_weights() 

 

sage: x = E[0*omega[1]]; x 

B[0] 

sage: E.eigenvalues(x) 

[1/(q*t), t] 

sage: x.is_one() 

True 

sage: x.parent() 

Algebra of the Weight lattice of the Root system of type ['A', 1] 

over Fraction Field of Multivariate Polynomial Ring in q, t over Rational Field 

 

sage: E[omega[1]] 

B[Lambda[1]] 

sage: E.eigenvalues(_) 

[t, 1/(q*t)] 

sage: E[2*omega[1]] 

((-q*t+q)/(-q*t+1))*B[0] + B[2*Lambda[1]] 

sage: E.eigenvalues(_) 

[q*t, 1/(q^2*t)] 

sage: E[3*omega[1]] 

((-q^2*t+q^2)/(-q^2*t+1))*B[-Lambda[1]] + ((-q^2*t+q^2-q*t+q)/(-q^2*t+1))*B[Lambda[1]] + B[3*Lambda[1]] 

sage: E.eigenvalues(_) 

[q^2*t, 1/(q^3*t)] 

sage: E[4*omega[1]] 

((q^5*t^2-q^5*t+q^4*t^2-2*q^4*t+q^3*t^2+q^4-2*q^3*t+q^3-q^2*t+q^2)/(q^5*t^2-q^3*t-q^2*t+1))*B[0] + ((-q^3*t+q^3)/(-q^3*t+1))*B[-2*Lambda[1]] + ((-q^3*t+q^3-q^2*t+q^2-q*t+q)/(-q^3*t+1))*B[2*Lambda[1]] + B[4*Lambda[1]] 

sage: E.eigenvalues(_) 

[q^3*t, 1/(q^4*t)] 

sage: E[6*omega[1]] 

((-q^12*t^3+q^12*t^2-q^11*t^3+2*q^11*t^2-2*q^10*t^3-q^11*t+4*q^10*t^2-2*q^9*t^3-2*q^10*t+5*q^9*t^2-2*q^8*t^3-4*q^9*t+6*q^8*t^2-q^7*t^3+q^9-5*q^8*t+5*q^7*t^2-q^6*t^3+q^8-6*q^7*t+4*q^6*t^2+2*q^7-5*q^6*t+2*q^5*t^2+2*q^6-4*q^5*t+q^4*t^2+2*q^5-2*q^4*t+q^4-q^3*t+q^3)/(-q^12*t^3+q^9*t^2+q^8*t^2+q^7*t^2-q^5*t-q^4*t-q^3*t+1))*B[0] + ((-q^5*t+q^5)/(-q^5*t+1))*B[-4*Lambda[1]] + ((q^9*t^2-q^9*t+q^8*t^2-2*q^8*t+q^7*t^2+q^8-2*q^7*t+q^6*t^2+q^7-2*q^6*t+q^5*t^2+q^6-2*q^5*t+q^5-q^4*t+q^4)/(q^9*t^2-q^5*t-q^4*t+1))*B[-2*Lambda[1]] + ((q^9*t^2-q^9*t+q^8*t^2-2*q^8*t+2*q^7*t^2+q^8-3*q^7*t+2*q^6*t^2+q^7-4*q^6*t+2*q^5*t^2+2*q^6-4*q^5*t+q^4*t^2+2*q^5-3*q^4*t+q^3*t^2+2*q^4-2*q^3*t+q^3-q^2*t+q^2)/(q^9*t^2-q^5*t-q^4*t+1))*B[2*Lambda[1]] + ((q^5*t-q^5+q^4*t-q^4+q^3*t-q^3+q^2*t-q^2+q*t-q)/(q^5*t-1))*B[4*Lambda[1]] + B[6*Lambda[1]] 

sage: E.eigenvalues(_) 

[q^5*t, 1/(q^6*t)] 

sage: E[-omega[1]] 

B[-Lambda[1]] + ((-t+1)/(-q*t+1))*B[Lambda[1]] 

sage: E.eigenvalues(_) 

[(-1)/(-q^2*t), q*t] 

 

As expected, `e^{-\omega}` is not an eigenvector:: 

 

sage: E.eigenvalues(KL.classical().monomial(-omega[1])) 

Traceback (most recent call last): 

... 

AssertionError 

 

We proceed by comparing against the examples from the appendix of 

[HHL06]_ in type `A_2^{(1)}`:: 

 

sage: K = QQ['q','t'].fraction_field() 

sage: q,t = K.gens() 

sage: KL = RootSystem(["A",2,1]).ambient_space().algebra(K) 

sage: E = NonSymmetricMacdonaldPolynomials(KL,q, t, -1) 

sage: L0 = E.keys() 

sage: omega = L0.fundamental_weights() 

sage: P = K['x1,x2,x3'] 

sage: def EE(weight): return E[L0(weight)].expand(P.gens()) 

 

sage: EE([0,0,0]) 

1 

sage: EE([1,0,0]) 

x1 

sage: EE([0,1,0]) 

((-t + 1)/(-q*t^2 + 1))*x1 + x2 

sage: EE([0,0,1]) 

((-t + 1)/(-q*t + 1))*x1 + ((-t + 1)/(-q*t + 1))*x2 + x3 

sage: EE([1,1,0]) 

x1*x2 

sage: EE([1,0,1]) 

((-t + 1)/(-q*t^2 + 1))*x1*x2 + x1*x3 

sage: EE([0,1,1]) 

((-t + 1)/(-q*t + 1))*x1*x2 + ((-t + 1)/(-q*t + 1))*x1*x3 + x2*x3 

sage: EE([2,0,0]) 

x1^2 + ((-q*t + q)/(-q*t + 1))*x1*x2 + ((-q*t + q)/(-q*t + 1))*x1*x3 

 

sage: EE([0,2,0]) 

((-t + 1)/(-q^2*t^2 + 1))*x1^2 + ((-q^2*t^3 + q^2*t^2 - q*t^2 + 2*q*t - q + t - 1)/(-q^3*t^3 + q^2*t^2 + q*t - 1))*x1*x2 + x2^2 + ((q*t^2 - 2*q*t + q)/(q^3*t^3 - q^2*t^2 - q*t + 1))*x1*x3 + ((-q*t + q)/(-q*t + 1))*x2*x3 

 

Systematic checks with Sage's implementation of [HHL06]_:: 

 

sage: import sage.combinat.sf.ns_macdonald as NS 

sage: assert all(EE([x,y,z]) == NS.E([x,y,z]) for d in range(5) for x,y,z in IntegerVectors(d,3)) # long time (9s) 

 

We check that we get eigenvectors for generic `q_1`, `q_2`:: 

 

sage: K = QQ['q,q1,q2'].fraction_field() 

sage: q,q1,q2 = K.gens() 

sage: KL = RootSystem(["A",2,1]).ambient_space().algebra(K) 

sage: E = NonSymmetricMacdonaldPolynomials(KL,q, q1, q2) 

sage: L0 = E.keys() 

sage: omega = L0.fundamental_weights() 

sage: E[2*omega[2]] 

((q*q1+q*q2)/(q*q1+q2))*B[(1, 2, 1)] + ((q*q1+q*q2)/(q*q1+q2))*B[(2, 1, 1)] + B[(2, 2, 0)] 

sage: for d in range(4): # long time (9s) 

....: for weight in IntegerVectors(d,3).map(list).map(L0): 

....: eigenvalues = E.eigenvalues(E[L0(weight)]) 

 

Some type `C` calculations:: 

 

sage: K = QQ['q','t'].fraction_field() 

sage: q, t = K.gens() 

sage: KL = RootSystem(["C",2,1]).ambient_space().algebra(K) 

sage: E = NonSymmetricMacdonaldPolynomials(KL,q, t, -1) 

sage: L0 = E.keys() 

sage: omega = L0.fundamental_weights() 

sage: E[0*omega[1]] 

B[(0, 0)] 

sage: E.eigenvalues(_) # checked for i=0 with previous calculation 

[1/(q*t^3), t, t] 

sage: E[omega[1]] 

B[(1, 0)] 

sage: E.eigenvalues(_) # not checked 

[t, 1/(q*t^3), t] 

 

sage: E[-omega[1]] # consistent with before refactoring 

B[(-1, 0)] + ((-t+1)/(-q*t+1))*B[(1, 0)] + ((-t+1)/(-q*t+1))*B[(0, -1)] + ((t-1)/(q*t-1))*B[(0, 1)] 

sage: E.eigenvalues(_) # not checked 

[(-1)/(-q^2*t^3), q*t, t] 

sage: E[-omega[1]+omega[2]] # consistent with before refactoring 

((-t+1)/(-q*t^3+1))*B[(1, 0)] + B[(0, 1)] 

sage: E.eigenvalues(_) # not checked 

[t, q*t^3, (-1)/(-q*t^2)] 

sage: E[omega[1]-omega[2]] # consistent with before refactoring 

((-t+1)/(-q*t^2+1))*B[(1, 0)] + B[(0, -1)] + ((-t+1)/(-q*t^2+1))*B[(0, 1)] 

sage: E.eigenvalues(_) # not checked 

[1/(q^2*t^3), 1/(q*t), q*t^2] 

 

sage: E[-omega[2]] 

((-q^2*t^4+q^2*t^3-q*t^3+2*q*t^2-q*t+t-1)/(-q^3*t^4+q^2*t^3+q*t-1))*B[(0, 0)] + B[(-1, -1)] + ((-t+1)/(-q*t+1))*B[(-1, 1)] + ((t-1)/(q*t-1))*B[(1, -1)] + ((-q*t^4+q*t^3+t-1)/(-q^3*t^4+q^2*t^3+q*t-1))*B[(1, 1)] 

sage: E.eigenvalues(_) # not checked # long time (1s) 

[1/(q^3*t^3), t, q*t] 

sage: E[-omega[2]].map_coefficients(lambda c: c.subs(t=0)) # checking againsts crystals 

B[(0, 0)] + B[(-1, -1)] + B[(-1, 1)] + B[(1, -1)] + B[(1, 1)] 

 

sage: E[2*omega[2]] 

((-q^6*t^7+q^6*t^6-q^5*t^6+2*q^5*t^5-q^4*t^5-q^5*t^3+3*q^4*t^4-3*q^4*t^3+q^3*t^4+q^4*t^2-2*q^3*t^2+q^3*t-q^2*t+q^2)/(-q^6*t^7+q^5*t^6+q^4*t^4+q^3*t^4-q^3*t^3-q^2*t^3-q*t+1))*B[(0, 0)] + ((-q^3*t^2+q^3*t)/(-q^3*t^3+1))*B[(-1, -1)] + ((-q^3*t^3+2*q^3*t^2-q^3*t)/(-q^4*t^4+q^3*t^3+q*t-1))*B[(-1, 1)] + ((-q^3*t^3+2*q^3*t^2-q^3*t)/(-q^4*t^4+q^3*t^3+q*t-1))*B[(1, -1)] + ((-q^4*t^4+q^4*t^3-q^3*t^3+2*q^3*t^2-q^2*t^3-q^3*t+2*q^2*t^2-q^2*t+q*t-q)/(-q^4*t^4+q^3*t^3+q*t-1))*B[(1, 1)] + ((q*t-q)/(q*t-1))*B[(2, 0)] + B[(2, 2)] + ((-q*t+q)/(-q*t+1))*B[(0, 2)] 

sage: E.eigenvalues(_) # not checked 

[q^3*t^3, t, (-1)/(-q^2*t^2)] 

 

The following computations were calculated by hand:: 

 

sage: KL0 = KL.classical() 

sage: E11 = KL0.sum_of_terms([[L0([1,1]), 1], [L0([0,0]), (-q*t^2 + q*t)/(1-q*t^3)]]) 

sage: E11 == E[omega[2]] 

True 

sage: E.eigenvalues(E11) 

[q*t^3, t, (-1)/(-q*t^2)] 

 

sage: E1m1 = KL0.sum_of_terms([[L0([1,-1]), 1], [L0([1,1]), (1-t)/(1-q*t^2)], [L0([0,0]), q*t*(1-t)/(1-q*t^2)] ]) 

sage: E1m1 == E[2*omega[1]-omega[2]] 

True 

sage: E.eigenvalues(E1m1) 

[1/(q*t), 1/(q^2*t^3), q*t^2] 

 

Now we present an example for a twisted affine root system. The 

results are eigenvectors:: 

 

sage: K = QQ['q','t'].fraction_field() 

sage: q, t = K.gens() 

sage: KL = RootSystem("C2~*").ambient_space().algebra(K) 

sage: E = NonSymmetricMacdonaldPolynomials(KL,q, t, -1) 

sage: omega = E.keys().fundamental_weights() 

sage: E[0*omega[1]] 

B[(0, 0)] 

sage: E.eigenvalues(_) 

[1/(q*t^2), t, t] 

sage: E[omega[1]] 

((-q*t+q)/(-q*t^2+1))*B[(0, 0)] + B[(1, 0)] 

sage: E.eigenvalues(_) 

[q*t^2, 1/(q^2*t^3), t] 

 

sage: E[-omega[1]] 

((-q*t+q-t+1)/(-q^2*t+1))*B[(0, 0)] + B[(-1, 0)] + ((-t+1)/(-q^2*t+1))*B[(1, 0)] + ((-t+1)/(-q^2*t+1))*B[(0, -1)] + ((t-1)/(q^2*t-1))*B[(0, 1)] 

sage: E.eigenvalues(_) 

[(-1)/(-q^3*t^2), q^2*t, t] 

sage: E[-omega[1]+omega[2]] 

B[(-1/2, 1/2)] + ((-t+1)/(-q^2*t^3+1))*B[(1/2, -1/2)] + ((-q*t^3+q*t^2-t+1)/(-q^2*t^3+1))*B[(1/2, 1/2)] 

sage: E.eigenvalues(_) 

[(-1)/(-q^2*t^2), q^2*t^3, (-1)/(-q*t)] 

sage: E[omega[1]-omega[2]] 

B[(1/2, -1/2)] + ((-t+1)/(-q*t^2+1))*B[(1/2, 1/2)] 

sage: E.eigenvalues(_) 

[t, 1/(q^2*t^3), q*t^2] 

 

Type BC, comparison with calculations with Maple by Bogdan Ion:: 

 

sage: K = QQ['q','t'].fraction_field() 

sage: q,t = K.gens() 

sage: def to_SR(x): return x.expand([SR.var('x%s'%i) for i in range(1,x.parent().basis().keys().dimension()+1)]).subs(q=SR.var('q'), t=SR.var('t')) 

sage: var('x1,x2,x3') 

(x1, x2, x3) 

 

sage: E = NonSymmetricMacdonaldPolynomials(["BC",2,2], q=q, q1=t^2,q2=-1) 

sage: omega=E.keys().fundamental_weights() 

sage: expected = (t-1)*(t+1)*(2+q^4+2*q^2-2*t^2-2*q^2*t^2-t^4*q^2-q^4*t^4+t^4-3*q^6*t^6-2*q^4*t^6+2*q^6*t^8+2*q^4*t^8+t^10*q^8)*q^4/((q^2*t^3-1)*(q^2*t^3+1)*(t*q-1)*(t*q+1)*(t^2*q^3+1)*(t^2*q^3-1))+(t-1)^2*(t+1)^2*(2*q^2+q^4+2+q^4*t^2)*q^3*x1/((t^2*q^3+1)*(t^2*q^3-1)*(t*q-1)*(t*q+1))+(t-1)^2*(t+1)^2*(q^2+1)*q^5/((t^2*q^3+1)*(t^2*q^3-1)*(t*q-1)*(t*q+1)*x1)+(t-1)^2*(t+1)^2*(q^2+1)*q^4*x2/((t^2*q^3+1)*(t^2*q^3-1)*(t*q-1)*(t*q+1)*x1)+(t-1)^2*(t+1)^2*(2*q^2+q^4+2+q^4*t^2)*q^3*x2/((t^2*q^3+1)*(t^2*q^3-1)*(t*q-1)*(t*q+1))+(t-1)^2*(t+1)^2*(q^2+1)*q^5/((t^2*q^3+1)*(t^2*q^3-1)*(t*q-1)*(t*q+1)*x2)+x1^2*x2^2+(t-1)*(t+1)*(-2*q^2-q^4-2+2*q^2*t^2+t^2+q^6*t^4+q^4*t^4)*q^2*x2*x1/((t^2*q^3+1)*(t^2*q^3-1)*(t*q-1)*(t*q+1))+(t-1)*(t+1)*(q^2+1+q^4*t^2)*q*x2^2*x1/((t^2*q^3-1)*(t^2*q^3+1))+(t-1)*(t+1)*q^3*x1^2/((t^2*q^3-1)*(t^2*q^3+1)*x2)+(t-1)*(t+1)*(q^2+1+q^4*t^2)*q*x2*x1^2/((t^2*q^3-1)*(t^2*q^3+1))+(t-1)*(t+1)*q^6/((t^2*q^3+1)*(t^2*q^3-1)*x1*x2)+(t-1)*(t+1)*(q^2+1+q^4*t^2)*q^2*x1^2/((t^2*q^3-1)*(t^2*q^3+1))+(t-1)*(t+1)*(q^2+1+q^4*t^2)*q^2*x2^2/((t^2*q^3-1)*(t^2*q^3+1))+(t-1)*(t+1)*q^3*x2^2/((t^2*q^3-1)*(t^2*q^3+1)*x1)+(t-1)^2*(t+1)^2*(q^2+1)*q^4*x1/((t^2*q^3+1)*(t^2*q^3-1)*(t*q-1)*(t*q+1)*x2) 

sage: to_SR(E[2*omega[2]]) - expected # long time (3.5s) 

0 

 

sage: E = NonSymmetricMacdonaldPolynomials(["BC",3,2], q=q, q1=t^2,q2=-1) 

sage: omega=E.keys().fundamental_weights() 

sage: mu = -3*omega[1] + 3*omega[2] - omega[3]; mu 

(-1, 2, -1) 

sage: expected = (t-1)^2*(t+1)^2*(3*q^2+q^4+1+t^2*q^4+q^2*t^2-3*t^4*q^2-5*t^6*q^4+2*t^8*q^4-4*t^8*q^6-q^8*t^10+2*t^10*q^6-2*q^8*t^12+t^14*q^8-t^14*q^10+q^10*t^16+q^8*t^16+q^10*t^18+t^18*q^12)*x2*x1/((q^3*t^5+1)*(q^3*t^5-1)*(t*q-1)*(t*q+1)*(t^3*q^2+1)*(t^3*q^2-1)*(t^2*q-1)*(t^2*q+1))+(t-1)^2*(t+1)^2*(q^2*t^6+2*t^6*q^4-q^4*t^4+t^4*q^2-q^2*t^2+t^2-2-q^2)*q^2*x1/((t^3*q^2-1)*(t^3*q^2+1)*(t*q+1)*(t*q-1)*(q^3*t^5-1)*(q^3*t^5+1)*x2)+(t-1)^2*(t+1)^2*(-q^2-1+t^4*q^2-q^4*t^4+2*t^6*q^4)*x1^2/((t^3*q^2-1)*(t^3*q^2+1)*(t*q+1)*(t*q-1)*(q^3*t^5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sage: to_SR(E[mu]) - expected # long time (20s) 

0 

 

sage: E = NonSymmetricMacdonaldPolynomials(["BC",1,2], q=q, q1=t^2,q2=-1) 

sage: omega=E.keys().fundamental_weights() 

sage: mu = -4*omega[1]; mu 

(-4) 

sage: expected = (t-1)*(t+1)*(-1+q^2*t^2-q^2-3*q^10-7*q^26*t^8+5*t^2*q^6-q^16-3*q^4+4*t^10*q^30-4*t^6*q^22-10*q^20*t^6+2*q^32*t^10-3*q^6-4*q^8+q^34*t^10-4*t^8*q^24-2*q^12-q^14+2*q^22*t^10+4*q^26*t^10+4*q^28*t^10+t^6*q^30-2*q^32*t^8-2*t^8*q^22+2*q^24*t^10-q^20*t^2-2*t^6*q^12+t^8*q^14+2*t^4*q^24-4*t^8*q^30+2*t^8*q^20-9*t^6*q^16+3*q^26*t^6+q^28*t^6+3*t^2*q^4+2*q^18*t^8-6*t^6*q^14+4*t^4*q^22-2*q^24*t^6+3*t^2*q^12+7*t^4*q^20-t^2*q^16+11*q^18*t^4-2*t^2*q^18+9*q^16*t^4-t^4*q^6+6*q^8*t^2+5*q^10*t^2-6*q^28*t^8+q^12*t^4+8*t^4*q^14-10*t^6*q^18-q^4*t^4+q^16*t^8-2*t^4*q^8)/((t*q^4-1)*(t*q^4+1)*(q^7*t^2-1)*(q^7*t^2+1)*(t*q^3-1)*(t*q^3+1)*(q^5*t^2+1)*(q^5*t^2-1))+(q^2+1)*(q^4+1)*(t-1)*(t+1)*(-1+q^2*t^2-q^2+t^2*q^6-q^4+t^6*q^22+3*q^10*t^4+t^2-q^8-2*t^8*q^24+q^22*t^10+q^26*t^10-2*t^8*q^22+q^24*t^10-4*t^6*q^12-2*t^8*q^20-3*t^6*q^16+2*t^2*q^4-t^6*q^10-2*t^6*q^14+t^8*q^12-t^2*q^12+2*q^16*t^4+q^8*t^2-q^10*t^2+3*q^12*t^4+2*t^4*q^14+t^6*q^18-2*q^4*t^4+q^16*t^8+q^20*t^10)*q*x1/((t*q^4-1)*(t*q^4+1)*(q^7*t^2-1)*(q^7*t^2+1)*(t*q^3-1)*(t*q^3+1)*(q^5*t^2+1)*(q^5*t^2-1))+(q^2+1)*(q^4+1)*(t-1)*(t+1)*(1+q^8+q^4+q^2-q^8*t^2-2*t^2*q^4-t^2*q^6+t^2*q^12-t^2+t^4*q^6-2*q^16*t^4-t^4*q^14-2*q^12*t^4+t^6*q^12+t^6*q^16+t^6*q^18+t^6*q^14)*q/((t*q^4-1)*(t*q^4+1)*(q^7*t^2-1)*(q^7*t^2+1)*(t*q^3-1)*(t*q^3+1)*x1)+(t-1)*(t+1)*(-1-q^2-q^6-q^4-q^8+t^2*q^4-t^2*q^14+t^2*q^6-q^10*t^2+q^8*t^2-t^2*q^12+q^12*t^4+q^10*t^4+q^16*t^4+2*t^4*q^14)*(q^4+1)/((q^7*t^2+1)*(q^7*t^2-1)*(t*q^4-1)*(t*q^4+1)*x1^2)+(t-1)*(t+1)*(q^4+1)*(q^2+1)*q/((t*q^4-1)*(t*q^4+1)*x1^3)+(q^4+1)*(t-1)*(t+1)*(1+q^6+q^8+q^2+q^4-q^2*t^2-3*t^2*q^4+q^10*t^2+t^2*q^12-2*t^2*q^6-q^8*t^2-2*q^16*t^4+q^4*t^4+t^4*q^6-q^10*t^4-2*q^12*t^4-2*t^4*q^14+t^6*q^12+t^6*q^18+2*t^6*q^16+t^6*q^14)*x1^2/((t*q^4-1)*(t*q^4+1)*(q^7*t^2-1)*(q^7*t^2+1)*(t*q^3-1)*(t*q^3+1))+(t-1)*(t+1)*(-1-t^2*q^6+t^2+t^4*q^8)*(q^4+1)*(q^2+1)*q*x1^3/((q^7*t^2+1)*(q^7*t^2-1)*(t*q^4-1)*(t*q^4+1))+1/x1^4+(t-1)*(t+1)*x1^4/((t*q^4-1)*(t*q^4+1)) 

sage: to_SR(E[mu]) - expected 

0 

 

Type `BC` dual, comparison with hand calculations by Bogdan Ion:: 

 

sage: K = QQ['q,q1,q2'].fraction_field() 

sage: q,q1,q2 = K.gens() 

sage: ct = CartanType(["BC",2,2]).dual() 

sage: E = NonSymmetricMacdonaldPolynomials(ct, q=q, q1=q1, q2=q2) 

sage: KL = E.domain(); KL 

Algebra of the Ambient space of the Root system of type ['B', 2] 

over Fraction Field of Multivariate Polynomial Ring in q, q1, q2 over Rational Field 

sage: alpha = E.keys().simple_roots(); alpha 

Finite family {1: (1, -1), 2: (0, 1)} 

sage: omega=E.keys().fundamental_weights(); omega 

Finite family {1: (1, 0), 2: (1/2, 1/2)} 

sage: epsilon = E.keys().basis(); epsilon 

Finite family {0: (1, 0), 1: (0, 1)} 

 

Note: Sage's `q` is the usual `q^2`:: 

 

sage: E.L().null_root() 

e['delta'] 

sage: E.L().null_coroot() 

2*e['deltacheck'] 

 

Some eigenvectors:: 

 

sage: E[0*omega[1]] 

B[(0, 0)] 

sage: E[omega[1]] 

((-q^2*q1^3*q2-q^2*q1^2*q2^2)/(q^2*q1^4-q2^4))*B[(0, 0)] + B[(1, 0)] 

sage: Eomega1 = KL.one() * (q^2*(-q1/q2)^2*(1-(-q1/q2))) / (1-q^2*(-q1/q2)^4) + KL.monomial(omega[1]) 

sage: E[omega[1]] == Eomega1 

True 

 

Checking the `Y` s:: 

 

sage: Y = E.Y() 

sage: alphacheck = Y.keys().simple_roots() 

sage: Y0 = Y[alphacheck[0]] 

sage: Y1 = Y[alphacheck[1]] 

sage: Y2 = Y[alphacheck[2]] 

 

sage: Y0.word, Y0.signs, Y0.scalar 

((0, 1, 2, 1, 0, 1, 2, 1), (-1, -1, -1, -1, -1, -1, -1, -1), q1^4*q2^4/q^2) 

sage: Y1.word, Y1.signs, Y1.scalar 

((1, 2, 0, 1, 2, 0), (1, 1, -1, 1, -1, 1), 1/(-q1*q2)) 

sage: Y2.word, Y2.signs, Y2.scalar 

((2, 1, 0, 1), (1, 1, 1, -1), 1/(-q1*q2)) 

 

sage: E.eigenvalues(0*omega[1]) 

[q2^4/(q^2*q1^4), q1/(-q2), q1/(-q2)] 

 

Checking the `T` and `T^{-1}` s:: 

 

sage: T = E._T_Y 

sage: Tinv0 = T.Tw_inverse([0]) 

sage: Tinv1 = T.Tw_inverse([1]) 

sage: Tinv2 = T.Tw_inverse([2]) 

 

sage: for x in [0*epsilon[0], -epsilon[0], -epsilon[1], epsilon[0], epsilon[1]]: 

....: x = KL.monomial(x) 

....: assert Tinv0(T[0](x)) == x and T[0](Tinv0(x)) == x 

....: assert Tinv1(T[1](x)) == x and T[1](Tinv1(x)) == x 

....: assert Tinv2(T[2](x)) == x and T[2](Tinv2(x)) == x 

 

sage: start = E[omega[1]]; start 

((-q^2*q1^3*q2-q^2*q1^2*q2^2)/(q^2*q1^4-q2^4))*B[(0, 0)] + B[(1, 0)] 

sage: Tinv1(Tinv2(Tinv1(Tinv0(Tinv1(Tinv2(Tinv1(Tinv0(start)))))))) * (q1*q2)^4/q^2 == Y0(start) 

True 

sage: Y0(start) == q^2*q1^4/q2^4 * start 

True 

 

Checking the relation between the `Y` s:: 

 

sage: q^2 * Y0(Y1(Y1(Y2(Y2(start))))) == start 

True 

sage: for x in [0*epsilon[0], -epsilon[0], -epsilon[1], epsilon[0], epsilon[1]]: 

....: x = KL.monomial(x) 

....: assert q^2 * Y0(Y1(Y1(Y2(Y2(start))))) == start 

 

""" 

 

@staticmethod 

def __classcall__(cls, KL, q='q', q1='q1', q2='q2', normalized=True): 

r""" 

EXAMPLES:: 

 

sage: NonSymmetricMacdonaldPolynomials(["B", 2, 1]) 

The family of the Macdonald polynomials of type ['B', 2, 1] with parameters q, q1, q2 

""" 

from sage.combinat.root_system.cartan_type import CartanType 

K = None 

#if KL in Algebras: 

if isinstance(KL, CombinatorialFreeModule): # temporary work around C3 issue ... 

K = KL.base_ring() 

else: 

if q == 'q': 

from sage.rings.rational_field import QQ 

K = QQ['q','q1','q2'].fraction_field() 

else: 

K = q.parent() 

KL = CartanType(KL).root_system().ambient_space().algebra(K) 

q = K(q) 

q1 = K(q1) 

q2 = K(q2) 

return super(NonSymmetricMacdonaldPolynomials, cls).__classcall__(cls, KL, q, q1, q2, normalized) 

 

def __init__(self, KL, q, q1, q2, normalized): 

r""" 

Initializes the nonsymmetric Macdonald polynomial class. 

 

INPUT: 

 

- ``KL`` -- algebra over weight space 

- ``q``, ``q1``, ``q2`` -- parameters 

- ``normalized`` -- a boolean (default: True) 

whether to normalize the result to have leading coefficient 1 

 

EXAMPLES:: 

 

sage: K = QQ['q,q1,q2'].fraction_field() 

sage: q, q1, q2 = K.gens() 

sage: KL = RootSystem(["A",1,1]).weight_space(extended = True).algebra(K) 

sage: NonSymmetricMacdonaldPolynomials(KL,q, q1, q2) 

The family of the Macdonald polynomials of type ['A', 1, 1] with parameters q, q1, q2 

 

sage: KL = RootSystem(["A",1,1]).ambient_space().algebra(K) 

sage: NonSymmetricMacdonaldPolynomials(KL,q, q1, q2) 

The family of the Macdonald polynomials of type ['A', 1, 1] with parameters q, q1, q2 

 

sage: KL = RootSystem(["A",1,1]).weight_space().algebra(K) 

sage: NonSymmetricMacdonaldPolynomials(KL,q, q1, q2) 

Traceback (most recent call last): 

... 

AssertionError: The weight lattice needs to be extended! 

 

""" 

# TODO: check all the choices! 

self._KL = KL 

self._L = KL.basis().keys() 

assert self._L.is_extended(), "The weight lattice needs to be extended!" 

self._q = q 

self._q1 = q1 

self._q2 = q2 

assert self.L_prime().classical() is self.L().classical() 

T = KL.twisted_demazure_lusztig_operators ( q1, q2, convention="dominant") 

T_Y = KL.demazure_lusztig_operators_on_classical(q, q1, q2, convention="dominant") 

CherednikOperatorsEigenvectors.__init__(self, T, T_Y, normalized = normalized) 

 

def _repr_(self): 

r""" 

EXAMPLES:: 

 

sage: NonSymmetricMacdonaldPolynomials(["B", 2, 1]) 

The family of the Macdonald polynomials of type ['B', 2, 1] with parameters q, q1, q2 

""" 

return "The family of the Macdonald polynomials of type %s with parameters %s, %s, %s"%(self.cartan_type(),self._q, self._q1, self._q2) 

 

# This is redundant with the cartan_type method of 

# CherednikOperatorsEigenvectors, but we need it very early in the 

# initialization, before self._T_Y is set ... 

@cached_method 

def cartan_type(self): 

r""" 

Return Cartan type of ``self``. 

 

EXAMPLES:: 

 

sage: NonSymmetricMacdonaldPolynomials(["B", 2, 1]).cartan_type() 

['B', 2, 1] 

""" 

return self._L.cartan_type() 

 

def L(self): 

r""" 

Return the affinization of the classical weight space. 

 

EXAMPLES:: 

 

sage: NonSymmetricMacdonaldPolynomials(["B", 2, 1]).L() 

Ambient space of the Root system of type ['B', 2, 1] 

""" 

return self._L 

 

@cached_method 

def L_check(self): 

r""" 

Return the other affinization of the classical weight space. 

 

.. TODO:: should this just return `L` in the simply laced case? 

 

EXAMPLES:: 

 

sage: NonSymmetricMacdonaldPolynomials(["B", 2, 1]).L_check() 

Coambient space of the Root system of type ['C', 2, 1] 

sage: NonSymmetricMacdonaldPolynomials(["B", 2, 1]).L_check().classical() 

Ambient space of the Root system of type ['B', 2] 

""" 

from sage.combinat.root_system.weight_space import WeightSpace 

from sage.combinat.root_system.type_affine import AmbientSpace 

L = self.L() 

other_affine_root_system = self.cartan_type().classical().dual().affine().root_system() 

if isinstance(L, WeightSpace): # TODO: make a nicer test 

return other_affine_root_system.coweight_space(L.base_ring(), extended=True) 

else: 

assert isinstance(L, AmbientSpace) 

return other_affine_root_system.coambient_space(L.base_ring()) 

 

@cached_method 

def L_prime(self): 

r""" 

The affine space where classical weights are lifted for the recursion. 

 

Also the parent of `\rho'`. 

 

EXAMPLES: 

 

In the twisted case, this is the affinization of the classical 

ambient space:: 

 

sage: NonSymmetricMacdonaldPolynomials("B2~*").L() 

Ambient space of the Root system of type ['B', 2, 1]^* 

sage: NonSymmetricMacdonaldPolynomials("B2~*").L().classical() 

Ambient space of the Root system of type ['C', 2] 

 

sage: NonSymmetricMacdonaldPolynomials("B2~*").L_prime() 

Ambient space of the Root system of type ['B', 2, 1]^* 

sage: NonSymmetricMacdonaldPolynomials("B2~*").L_prime().classical() 

Ambient space of the Root system of type ['C', 2] 

 

In the untwisted case, this is the other affinization of the 

classical ambient space:: 

 

sage: NonSymmetricMacdonaldPolynomials("B2~").L() 

Ambient space of the Root system of type ['B', 2, 1] 

sage: NonSymmetricMacdonaldPolynomials("B2~").L().classical() 

Ambient space of the Root system of type ['B', 2] 

 

sage: NonSymmetricMacdonaldPolynomials("B2~").L_prime() 

Coambient space of the Root system of type ['C', 2, 1] 

sage: NonSymmetricMacdonaldPolynomials("B2~").L_prime().classical() 

Ambient space of the Root system of type ['B', 2] 

 

For simply laced, the two affinizations coincide:: 

 

sage: NonSymmetricMacdonaldPolynomials("A2~").L() 

Ambient space of the Root system of type ['A', 2, 1] 

sage: NonSymmetricMacdonaldPolynomials("A2~").L().classical() 

Ambient space of the Root system of type ['A', 2] 

 

sage: NonSymmetricMacdonaldPolynomials("A2~").L_prime() 

Coambient space of the Root system of type ['A', 2, 1] 

sage: NonSymmetricMacdonaldPolynomials("A2~").L_prime().classical() 

Ambient space of the Root system of type ['A', 2] 

 

.. NOTE:: do we want the coambient space of type `A_2^{(1)}` instead? 

 

For type BC:: 

 

sage: NonSymmetricMacdonaldPolynomials(["BC",3,2]).L_prime() 

Ambient space of the Root system of type ['BC', 3, 2] 

""" 

ct = self.cartan_type() 

if ct.is_untwisted_affine(): 

return self.L_check() 

else: 

return self.L() 

 

@cached_method 

def L0(self): 

r""" 

Return the space indexing the monomials of the nonsymmetric Macdonald polynomials. 

 

EXAMPLES:: 

 

sage: NonSymmetricMacdonaldPolynomials("B2~").L0() 

Ambient space of the Root system of type ['B', 2] 

sage: NonSymmetricMacdonaldPolynomials("B2~*").L0() 

Ambient space of the Root system of type ['C', 2] 

""" 

return self.L().classical() 

 

@cached_method 

def KL0(self): 

r""" 

Return the group algebra where the nonsymmetric Macdonald polynomials live. 

 

EXAMPLES:: 

 

sage: NonSymmetricMacdonaldPolynomials("B2~").KL0() 

Algebra of the Ambient space of the Root system of type ['B', 2] 

over Fraction Field of Multivariate Polynomial Ring in q, q1, q2 over Rational Field 

sage: NonSymmetricMacdonaldPolynomials("B2~*").KL0() 

Algebra of the Ambient space of the Root system of type ['C', 2] 

over Fraction Field of Multivariate Polynomial Ring in q, q1, q2 over Rational Field 

 

""" 

return self._KL.classical() 

 

@lazy_attribute 

def Q_to_Qcheck(self): 

r""" 

The reindexing of the index set of the Y's by the coroot lattice. 

 

EXAMPLES:: 

 

sage: E = NonSymmetricMacdonaldPolynomials("C2~") 

sage: alphacheck = E.Y().keys().simple_roots() 

sage: E.Q_to_Qcheck(alphacheck[0]) 

alphacheck[0] - alphacheck[2] 

sage: E.Q_to_Qcheck(alphacheck[1]) 

alphacheck[1] 

sage: E.Q_to_Qcheck(alphacheck[2]) 

alphacheck[2] 

 

sage: x = alphacheck[1] + 2*alphacheck[2] 

sage: x.parent() 

Root lattice of the Root system of type ['B', 2, 1] 

sage: E.Q_to_Qcheck(x) 

alphacheck[1] + 2*alphacheck[2] 

sage: _.parent() 

Coroot lattice of the Root system of type ['C', 2, 1] 

""" 

#assert self.cartan_type().is_untwisted_affine() 

Qcheck = self._T_Y.Y().keys() 

Q = Qcheck.cartan_type().other_affinization().root_system().root_lattice() 

assert Q.classical() is Qcheck.classical() 

return Q.module_morphism(Qcheck.simple_roots_tilde().__getitem__, codomain=Qcheck) 

 

def Y(self): 

r""" 

Return the family of `Y` operators whose eigenvectors are the nonsymmetric Macdonald polynomials. 

 

EXAMPLES:: 

 

sage: NonSymmetricMacdonaldPolynomials("C2~").Y() 

Lazy family (<lambda>(i))_{i in Root lattice of the Root system of type ['B', 2, 1]} 

sage: _.keys().classical() 

Root lattice of the Root system of type ['B', 2] 

 

sage: NonSymmetricMacdonaldPolynomials("C2~*").Y() 

Lazy family (<...Y_lambdacheck...>(i))_{i in Coroot lattice of the Root system of type ['C', 2, 1]^*} 

sage: _.keys().classical() 

Root lattice of the Root system of type ['C', 2] 

 

sage: NonSymmetricMacdonaldPolynomials(["BC", 3, 2]).Y() 

Lazy family (<...Y_lambdacheck...>(i))_{i in Coroot lattice of the Root system of type ['BC', 3, 2]} 

sage: _.keys().classical() 

Root lattice of the Root system of type ['B', 3] 

""" 

from sage.sets.family import Family 

Y = self._T_Y.Y() 

ct = self.cartan_type() 

# TODO: improve test 

if ct.dual().is_untwisted_affine() or ct.type() == "BC": 

return Y 

Q = self.Q_to_Qcheck.domain() 

return Family(Q, lambda lambdacheck: Y[self.Q_to_Qcheck(lambdacheck)]) 

 

def affine_lift(self, mu): 

r""" 

Return the affinization of `\mu` in `L'`. 

 

INPUT: 

 

- ``mu`` -- a classical weight `\mu` 

 

.. SEEALSO:: 

 

- :meth:`.hecke_algebra_representation.CherednikOperatorsEigenvectors.affine_lift` 

- :meth:`affine_retract` 

- :meth:`L_prime` 

 

EXAMPLES: 

 

In the untwisted case, this is the other affinization at level 1:: 

 

sage: E = NonSymmetricMacdonaldPolynomials("B2~") 

sage: L0 = E.keys(); L0 

Ambient space of the Root system of type ['B', 2] 

sage: omega = L0.fundamental_weights() 

sage: E.affine_lift(omega[1]) 

e[0] + e['deltacheck'] 

sage: E.affine_lift(omega[1]).parent() 

Coambient space of the Root system of type ['C', 2, 1] 

 

In the twisted case, this is the usual affinization at level 1:: 

 

sage: E = NonSymmetricMacdonaldPolynomials("B2~*") 

sage: L0 = E.keys(); L0 

Ambient space of the Root system of type ['C', 2] 

sage: omega = L0.fundamental_weights() 

sage: E.affine_lift(omega[1]) 

e[0] + e['deltacheck'] 

sage: E.affine_lift(omega[1]).parent() 

Ambient space of the Root system of type ['B', 2, 1]^* 

""" 

return self.L_prime().embed_at_level(mu, 1) 

 

def twist(self, mu, i): 

r""" 

Act by `s_i` on the affine weight `\mu`. 

 

This calls ``simple_reflection``; which is semantically the 

same as the default implementation. 

 

EXAMPLES:: 

 

sage: W = WeylGroup(["B",3]) 

sage: W.element_class._repr_=lambda x: "".join(str(i) for i in x.reduced_word()) 

sage: K = QQ['q1,q2'] 

sage: q1, q2 = K.gens() 

sage: KW = W.algebra(K) 

sage: T = KW.demazure_lusztig_operators(q1, q2, affine=True) 

sage: E = T.Y_eigenvectors() 

sage: w = W.an_element(); w 

123 

sage: E.twist(w,1) 

1231 

""" 

return mu.simple_reflection(i) 

 

def affine_retract(self, mu): 

r""" 

Retract the affine weight `\mu` into a classical weight. 

 

INPUT: 

 

- ``mu`` -- an affine weight `\mu` in `L'` 

 

.. SEEALSO:: 

 

- :meth:`.hecke_algebra_representation.HeckeAlgebraRepresentation.affine_retract` 

- :meth:`affine_lift` 

- :meth:`L_prime` 

 

EXAMPLES:: 

 

sage: E = NonSymmetricMacdonaldPolynomials("B2~") 

sage: L0 = E.keys(); L0 

Ambient space of the Root system of type ['B', 2] 

sage: omega = L0.fundamental_weights() 

sage: E.affine_lift(omega[1]) 

e[0] + e['deltacheck'] 

sage: E.affine_retract(E.affine_lift(omega[1])) 

(1, 0) 

""" 

assert mu in self.L_prime() 

return self.L0()(mu) 

 

def __getitem__(self, mu): 

r""" 

Return the nonsymmetric Macdonald polynomial `E_\mu`. 

 

INPUT: 

 

- ``mu`` -- a weight `\mu` that lifts to a level 0 element of the affine weight lattice 

 

This methods simply checks the weight and calls 

:meth:`.hecke_algebra_representation.CherednikOperatorsEigenvectors.__getitem__`. 

 

.. NOTE:: 

 

Any element of the finite weight lattice lifts to a level 

0 element of the affine weight lattice. 

Exception: `\omega_n` in type `BC_n` dual. 

 

EXAMPLES:: 

 

sage: ct = CartanType(["BC",2,2]).dual() 

sage: E = NonSymmetricMacdonaldPolynomials(ct) 

sage: omega = E.keys().fundamental_weights() 

sage: omega[2] 

(1/2, 1/2) 

sage: E[omega[2]] 

Traceback (most recent call last): 

... 

ValueError: 1/2*e[0] + 1/2*e[1] does not lift to a level 0 element of the affine weight lattice 

sage: E[2*omega[2]] 

((q^2*q1^2+q^2*q1*q2)/(q^2*q1^2-q2^2))*B[(0, 0)] + ((-q^2*q1^2-q^2*q1*q2)/(-q^2*q1^2+q2^2))*B[(1, 0)] + B[(1, 1)] + ((-q^2*q1^2-q^2*q1*q2)/(-q^2*q1^2+q2^2))*B[(0, 1)] 

""" 

muaff = self._L.embed_at_level(mu, 0) 

if not all(muaff.scalar(coroot) in ZZ for coroot in self._L.simple_coroots()): 

raise ValueError("%s does not lift to a level 0 element of the affine weight lattice"%muaff) 

return super(NonSymmetricMacdonaldPolynomials, self).__getitem__(mu) 

 

 

@cached_method 

def rho_prime(self): # Should be rho_prime_check 

r""" 

Return the level 0 sum of the classical fundamental weights in `L'`. 

 

.. SEEALSO:: :meth:`L_prime` 

 

EXAMPLES: 

 

Untwisted case:: 

 

sage: NonSymmetricMacdonaldPolynomials("B2~").rho_prime() # CHECKME 

3/2*e[0] + 1/2*e[1] 

sage: NonSymmetricMacdonaldPolynomials("B2~").rho_prime().parent() 

Coambient space of the Root system of type ['C', 2, 1] 

 

Twisted case:: 

 

sage: NonSymmetricMacdonaldPolynomials("B2~*").rho_prime() # CHECKME 

2*e[0] + e[1] 

sage: NonSymmetricMacdonaldPolynomials("B2~*").rho_prime().parent() 

Ambient space of the Root system of type ['B', 2, 1]^* 

""" 

return self.L_prime().rho_classical() 

 

def eigenvalue_experimental(self, mu, l): 

r""" 

Return the eigenvalue of `Y^{\lambda^\vee}` acting on the macdonald polynomial `E_\mu`. 

 

INPUT: 

 

- ``mu`` -- the index `\mu` of an eigenvector 

- `l` -- an index `\lambda^\vee` of some `Y` 

 

.. NOTE:: 

 

- This method is currently not used; most tests below even 

test the naive method. They are left here as a basis for 

a future implementation. 

 

- This is actually equivariant, as long as `s_i` does not 

fix `\lambda`. 

 

- This method is only really needed for 

`\lambda^\vee=\alpha^\vee_i` with `i=0,...,n`. 

 

See Corollary 6.11 of [Haiman06]_. 

 

EXAMPLES:: 

 

sage: K = QQ['q,t'].fraction_field() 

sage: q,t = K.gens() 

sage: q1 = t 

sage: q2 = -1 

sage: KL = RootSystem(["A",1,1]).ambient_space().algebra(K) 

sage: E = NonSymmetricMacdonaldPolynomials(KL,q, q1, q2) 

sage: L0 = E.keys() 

sage: E.eigenvalues(L0([0,0])) # Checked by hand by Mark and Arun 

[1/(q*t), t] 

sage: alpha = E.Y().keys().simple_roots() 

sage: E.eigenvalue_experimental(L0([0,0]), alpha[0]) # todo: not implemented 

1/(q*t) 

sage: E.eigenvalue_experimental(L0([0,0]), alpha[1]) 

t 

 

Some examples of eigenvalues (not mathematically checked!!!):: 

 

sage: E.eigenvalues(L0([1,0])) 

[t, 1/(q*t)] 

sage: E.eigenvalues(L0([0,1])) 

[1/(q^2*t), q*t] 

sage: E.eigenvalues(L0([1,1])) 

[1/(q*t), t] 

sage: E.eigenvalues(L0([2,1])) 

[t, 1/(q*t)] 

sage: E.eigenvalues(L0([-1,1])) 

[(-1)/(-q^3*t), q^2*t] 

sage: E.eigenvalues(L0([-2,1])) 

[(-1)/(-q^4*t), q^3*t] 

sage: E.eigenvalues(L0([-2,0])) 

[(-1)/(-q^3*t), q^2*t] 

 

Some type `B` examples:: 

 

sage: K = QQ['q,t'].fraction_field() 

sage: q,t = K.gens() 

sage: q1 = t 

sage: q2 = -1 

sage: L = RootSystem(["B",2,1]).ambient_space() 

sage: KL = L.algebra(K) 

sage: E = NonSymmetricMacdonaldPolynomials(KL,q, q1, q2) 

sage: L0 = E.keys() 

sage: alpha = L.simple_coroots() 

sage: E.eigenvalue(L0((0,0)), alpha[0]) # not checked # not tested 

q/t 

sage: E.eigenvalue(L0((1,0)), alpha[1]) # What Mark got by hand # not tested 

q 

sage: E.eigenvalue(L0((1,0)), alpha[2]) # not checked # not tested 

t 

sage: E.eigenvalue(L0((1,0)), alpha[0]) # not checked # not tested 

1 

 

sage: L = RootSystem("B2~*").ambient_space() 

sage: KL = L.algebra(K) 

sage: E = NonSymmetricMacdonaldPolynomials(KL,q, q1, q2) 

sage: L0 = E.keys() 

sage: alpha = L.simple_coroots() 

sage: E.eigenvalue(L0((0,0)), alpha[0]) # assuming Mark's calculation is correct, one should get # not tested 

1/(q*t^2) 

 

The expected value can more or less be read off from equation 

(37), Corollary 6.15 of [Haiman06]_ 

 

.. TODO:: 

 

- Use proposition 6.9 of [Haiman06]_ to check the action 

of the `Y` s on monomials. 

 

- Generalize to any `q_1`, `q_2`. 

 

- Check claim by Mark: all scalar products should occur in 

the finite weight lattice, with alpha 0 being the 

appropriate projection of the affine alpha 0. Question: 

can this be emulated by being at level 0? 

""" 

assert self.Y().keys().is_parent_of(l) 

L_prime = self.L_prime() 

L0 = L_prime.classical() 

I0 = L0.index_set() 

assert L0.is_parent_of(mu) 

# Should we view mu as a translation, and ask for its alcove walk? 

muaff = self.affine_lift(mu) # embeds mu at level 1 in L_prime 

w = reversed(mu.reduced_word(I0, positive=False)) # the reduced word for w_\mu, Prop. 6.9 of [Haiman06]_ 

# mu should be scaled to make sure it implements a translation 

#w = reversed(L.reduced_word_of_translation(L(mu))) 

#x = L.embed_at_level(L0.rho(),1) 

#x = L.rho() / L.rho().level() 

x = self.rho_prime() 

l = self.L_prime().coroot_lattice()(l) # there might need to be a `nu` here 

for i in w: 

x = x.simple_reflection(i) 

q1,q2 = self.hecke_parameters(1) # TODO: clean up 

t = -q2/q1 # TODO: generalize for any eigenvalue 

# In type BC, maybe this should be q^...*a[0] 

return self._q**(-muaff.scalar(l)) * t**(-x.scalar(l)) 

 

def seed(self, mu): 

r""" 

Return `E_\mu` for `\mu` minuscule, i.e. in the fundamental alcove. 

 

INPUT: 

 

- ``mu`` -- the index `\mu` of an eigenvector 

 

EXAMPLES:: 

 

sage: E = NonSymmetricMacdonaldPolynomials(["A",2,1]) 

sage: omega = E.keys().fundamental_weights() 

sage: E.seed(omega[1]) 

B[(1, 0, 0)] 

""" 

return self.KL0().monomial(mu) 

 

def symmetric_macdonald_polynomial(self, mu): 

r""" 

Return the symmetric Macdonald polynomial indexed by `\mu`. 

 

INPUT: 

 

- ``mu`` -- a dominant weight `\mu` 

 

.. WARNING:: 

 

The result is Weyl-symmetric only for Hecke parameters of 

the form `q_1=v` and `q_2=-1/v`. In general the value of 

`v` below, should be the square root of `-q_1/q_2`, but the 

use of `q_1=t` and `q_2=-1` results in nonintegral powers of `t`. 

 

EXAMPLES:: 

 

sage: K = QQ['q,v,t'].fraction_field() 

sage: q,v,t = K.gens() 

sage: E = NonSymmetricMacdonaldPolynomials(['A',2,1], q, v, -1/v) 

sage: om = E.L0().fundamental_weights() 

sage: E.symmetric_macdonald_polynomial(om[2]) 

B[(1, 1, 0)] + B[(1, 0, 1)] + B[(0, 1, 1)] 

sage: E.symmetric_macdonald_polynomial(2*om[1]) 

((q*v^2+v^2-q-1)/(q*v^2-1))*B[(1, 1, 0)] + ((q*v^2+v^2-q-1)/(q*v^2-1))*B[(1, 0, 1)] + B[(2, 0, 0)] + ((q*v^2+v^2-q-1)/(q*v^2-1))*B[(0, 1, 1)] + B[(0, 2, 0)] + B[(0, 0, 2)] 

sage: f = E.symmetric_macdonald_polynomial(E.L0()((2,1,0))); f 

((2*q*v^4+v^4-q*v^2+v^2-q-2)/(q*v^4-1))*B[(1, 1, 1)] + B[(1, 2, 0)] + B[(1, 0, 2)] + B[(2, 1, 0)] + B[(2, 0, 1)] + B[(0, 1, 2)] + B[(0, 2, 1)] 

 

We compare with the type `A` Macdonald polynomials 

coming from symmetric functions:: 

 

sage: P = SymmetricFunctions(K).macdonald().P() 

sage: g = P[2,1].expand(3); g 

x0^2*x1 + x0*x1^2 + x0^2*x2 + ((-2*q*t^2 + q*t - t^2 + q - t + 2)/(-q*t^2 + 1))*x0*x1*x2 + x1^2*x2 + x0*x2^2 + x1*x2^2 

sage: fe =f.expand(g.parent().gens()); fe 

x0^2*x1 + x0*x1^2 + x0^2*x2 + ((2*q*v^4 + v^4 - q*v^2 + v^2 - q - 2)/(q*v^4 - 1))*x0*x1*x2 + x1^2*x2 + x0*x2^2 + x1*x2^2 

sage: g.map_coefficients(lambda x: x.subs(t=v*v)) == fe 

True 

 

sage: E = NonSymmetricMacdonaldPolynomials(['C',3,1], q, v, -1/v) 

sage: om = E.L0().fundamental_weights() 

sage: E.symmetric_macdonald_polynomial(om[1]+om[2]) 

B[(-2, -1, 0)] + B[(-2, 1, 0)] + B[(-2, 0, -1)] + B[(-2, 0, 1)] + ((4*q^3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2*v^10+q*v^4-1))*B[(0, -1, 0)] + B[(0, -1, -2)] + B[(0, -1, 2)] + ((-4*q^3*v^14-2*q^2*v^14+2*q^3*v^12-2*q^2*v^12+2*q^3*v^10-q*v^12+5*q^2*v^10+5*q*v^4-q^2*v^2+2*v^4-2*q*v^2+2*v^2-2*q-4)/(-q^3*v^14+q^2*v^10+q*v^4-1))*B[(0, 1, 0)] + B[(0, 1, -2)] + B[(0, 1, 2)] + B[(0, 2, -1)] + B[(0, 2, 1)] + ((4*q^3*v^14+2*q^2*v^14-2*q^3*v^12+2*q^2*v^12-2*q^3*v^10+q*v^12-5*q^2*v^10-5*q*v^4+q^2*v^2-2*v^4+2*q*v^2-2*v^2+2*q+4)/(q^3*v^14-q^2*v^10-q*v^4+1))*B[(0, 0, -1)] + ((4*q^3*v^14+2*q^2*v^14-2*q^3*v^12+2*q^2*v^12-2*q^3*v^10+q*v^12-5*q^2*v^10-5*q*v^4+q^2*v^2-2*v^4+2*q*v^2-2*v^2+2*q+4)/(q^3*v^14-q^2*v^10-q*v^4+1))*B[(0, 0, 1)] 

 

An example for type `G`:: 

 

sage: E = NonSymmetricMacdonaldPolynomials(['G',2,1], q, v, -1/v) 

sage: om = E.L0().fundamental_weights() 

sage: E.symmetric_macdonald_polynomial(2*om[1]) 

((3*q^6*v^22+3*q^5*v^22-3*q^6*v^20+q^4*v^22-4*q^5*v^20+q^4*v^18-q^5*v^16+q^3*v^18-2*q^4*v^16+q^5*v^14-q^3*v^16+q^4*v^14-4*q^4*v^12+q^2*v^14+q^5*v^10-8*q^3*v^12+4*q^4*v^10-4*q^2*v^12+8*q^3*v^10-q*v^12-q^4*v^8+4*q^2*v^10-q^2*v^8+q^3*v^6-q*v^8+2*q^2*v^6-q^3*v^4+q*v^6-q^2*v^4+4*q*v^2-q^2+3*v^2-3*q-3)/(q^6*v^22-q^5*v^20-q^4*v^12-q^3*v^12+q^3*v^10+q^2*v^10+q*v^2-1))*B[(0, 0, 0)] + ((q*v^2+v^2-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-q^2*v^4+2*q*v^2+2*v^2-2*q-2)/(-q^4*v^12+q^3*v^10+q*v^2-1))*B[(0, -1, 1)] + ((2*q^4*v^12+2*q^3*v^12-2*q^4*v^10-2*q^3*v^10+q^2*v^8-q^3*v^6+q*v^8-2*q^2*v^6+q^3*v^4-q*v^6+q^2*v^4-2*q*v^2-2*v^2+2*q+2)/(q^4*v^12-q^3*v^10-q*v^2+1))*B[(0, 1, -1)] + B[(0, 2, -2)] 

 

""" 

if self.cartan_type().classical() != mu.parent().cartan_type() or not mu.is_dominant(): 

raise ValueError("%s must be a dominant weight for the classical subrootsystem of %s" % (mu, self.cartan_type())) 

v = self._q1 

KL0 = self.KL0() 

s = KL0.zero() 

# efficiently compute the finite Hecke symmetrization of the 

# nonsymmetric Macdonald polynomial of the dominant weight mu 

# by searching the Weyl orbit of mu and remembering 

Torbit = {} 

for c in mu._orbit_iter(): 

i = c.first_descent() 

if i is None: 

Torbit[c] = self[mu] # the nonsymmetric Macdonald polynomial of mu 

else: 

Torbit[c] = v * self._T.Tw([i])(Torbit[c.simple_reflection(i)]) 

s = s + Torbit[c] 

return s