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

cdef extern from 'symmetrica/def.h': 

INT outerproduct_schur(OP parta, OP partb, OP result) 

INT dimension_schur(OP a, OP result) 

INT part_part_skewschur(OP big, OP small, OP result) 

INT newtrans(OP perm, OP schur) 

INT compute_schur_with_alphabet(OP part, OP length, OP poly) 

INT compute_homsym_with_alphabet(OP number, OP length, OP poly) 

INT compute_elmsym_with_alphabet(OP number, OP length, OP poly) 

INT compute_monomial_with_alphabet(OP partition, OP length, OP poly) 

INT compute_powsym_with_alphabet(OP number, OP length, OP poly) 

INT compute_schur_with_alphabet_det(OP part, OP length, OP poly) 

  

INT part_part_skewschur(OP a, OP b, OP c) 

  

INT t_SCHUR_MONOMIAL(OP schur, OP result) 

INT t_SCHUR_HOMSYM(OP a, OP b) 

INT t_SCHUR_ELMSYM(OP a, OP b) 

  

INT t_MONOMIAL_SCHUR(OP a, OP b) 

INT t_MONOMIAL_HOMSYM(OP a, OP b) 

INT t_MONOMIAL_ELMSYM(OP a, OP b) 

  

INT t_ELMSYM_SCHUR(OP a, OP b) 

INT t_ELMSYM_MONOMIAL(OP a, OP b) 

INT t_ELMSYM_HOMSYM(OP a, OP b) 

  

INT t_HOMSYM_SCHUR(OP a, OP b) 

INT t_HOMSYM_MONOMIAL(OP a, OP b) 

INT t_HOMSYM_ELMSYM(OP a, OP b) 

  

  

INT t_POWSYM_SCHUR(OP a, OP b) 

INT t_SCHUR_POWSYM(OP a, OP b) 

INT t_POWSYM_HOMSYM(OP a, OP b) 

INT t_HOMSYM_POWSYM(OP a, OP b) 

INT t_POWSYM_ELMSYM(OP a, OP b) 

INT t_ELMSYM_POWSYM(OP a, OP b) 

INT t_POWSYM_MONOMIAL(OP a, OP b) 

INT t_MONOMIAL_POWSYM(OP a, OP b) 

  

INT hall_littlewood(OP part, OP res) 

  

INT mult_schur_schur(OP s1, OP s2, OP res) 

INT mult_monomial_monomial(OP m1, OP m2, OP res) 

  

INT t_POLYNOM_POWER(OP a, OP b) 

INT t_POLYNOM_SCHUR(OP a, OP b) 

INT t_POLYNOM_ELMSYM(OP a, OP b) 

INT t_POLYNOM_MONOMIAL(OP a, OP b) 

  

INT symmetricp(OP a) 

  

INT scalarproduct_schur(OP a, OP b, OP c) 

  

  

def outerproduct_schur_symmetrica(parta, partb): 

""" 

you enter two PARTITION objects, and the result is 

a SCHUR object, which is the expansion of the product 

of the two schurfunctions, labbeled by 

the two PARTITION objects parta and partb. 

Of course this can also be interpreted as the decomposition of the 

outer tensor product of two irreducibe representations of the 

symmetric group. 

  

EXAMPLES: 

sage: symmetrica.outerproduct_schur([2],[2]) 

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

""" 

cdef OP cparta, cpartb, cresult 

  

cparta = callocobject() 

cpartb = callocobject() 

cresult = callocobject() 

  

_op_partition(parta, cparta) 

_op_partition(partb, cpartb) 

  

sig_on() 

outerproduct_schur(cparta, cpartb, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cparta) 

freeall(cpartb) 

freeall(cresult) 

  

return res 

  

  

def dimension_schur_symmetrica(s): 

""" 

you enter a SCHUR object a, and the result is the 

dimension of the corresponding representation of the 

symmetric group sn. 

""" 

cdef OP ca, cresult 

  

cresult = callocobject() 

ca = callocobject() 

  

_op_schur(s, ca) 

sig_on() 

dimension_schur(ca, cresult) 

sig_off() 

res = _py(cresult) 

  

freeall(ca) 

freeall(cresult) 

  

return res 

  

  

def newtrans_symmetrica(perm): 

""" 

computes the decomposition of a schubertpolynomial labeled by 

the permutation perm, as a sum of Schurfunction. 

FIXME! 

""" 

cdef OP cperm = callocobject(), cresult = callocobject() 

  

_op_permutation(perm, cperm) 

  

sig_on() 

newtrans(cperm, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(cperm) 

  

return res 

  

  

def compute_schur_with_alphabet_symmetrica(part, length, alphabet='x'): 

""" 

Computes the expansion of a schurfunction labeled by a 

partition PART as a POLYNOM erg. The INTEGER length specifies the 

length of the alphabet. 

  

EXAMPLES: 

sage: symmetrica.compute_schur_with_alphabet(2,2) 

x0^2 + x0*x1 + x1^2 

sage: symmetrica.compute_schur_with_alphabet([2],2) 

x0^2 + x0*x1 + x1^2 

sage: symmetrica.compute_schur_with_alphabet(Partition([2]),2) 

x0^2 + x0*x1 + x1^2 

sage: symmetrica.compute_schur_with_alphabet(Partition([2]),2,'y') 

y0^2 + y0*y1 + y1^2 

sage: symmetrica.compute_schur_with_alphabet(Partition([2]),2,'a,b') 

a^2 + a*b + b^2 

sage: symmetrica.compute_schur_with_alphabet([2,1],1,'x') 

0 

""" 

late_import() 

cdef OP cpart = callocobject(), cresult = callocobject(), clength = callocobject() 

  

if isinstance(part, (int, Integer)): 

_op_partition([part], cpart) 

elif isinstance(part, (builtinlist, Partition)): 

_op_partition(part, cpart) 

else: 

raise NotImplementedError("n must be an integer or partition") 

_op_integer(length, clength) 

  

sig_on() 

compute_schur_with_alphabet(cpart, clength, cresult) 

sig_off() 

  

res = _py_polynom_alphabet(cresult, alphabet, length) 

  

freeall(cresult) 

freeall(cpart) 

  

return res 

  

  

def compute_homsym_with_alphabet_symmetrica(n, length, alphabet='x'): 

""" 

computes the expansion of a homogenous(=complete) symmetric 

function labeled by a INTEGER number as a POLYNOM erg. 

The object number may also be a PARTITION or a HOM_SYM object. 

The INTEGER laenge specifies the length of the alphabet. 

Both routines are the same. 

  

EXAMPLES: 

sage: symmetrica.compute_homsym_with_alphabet(3,1,'x') 

x^3 

sage: symmetrica.compute_homsym_with_alphabet([2,1],1,'x') 

x^3 

sage: symmetrica.compute_homsym_with_alphabet([2,1],2,'x') 

x0^3 + 2*x0^2*x1 + 2*x0*x1^2 + x1^3 

sage: symmetrica.compute_homsym_with_alphabet([2,1],2,'a,b') 

a^3 + 2*a^2*b + 2*a*b^2 + b^3 

sage: symmetrica.compute_homsym_with_alphabet([2,1],2,'x').parent() 

Multivariate Polynomial Ring in x0, x1 over Integer Ring 

  

""" 

late_import() 

cdef OP cn = callocobject(), clength = callocobject(), cresult = callocobject() 

  

if isinstance(n, (int, Integer)): 

_op_integer(n, cn) 

elif isinstance(n, (builtinlist, Partition)): 

_op_partition(n, cn) 

else: 

raise NotImplementedError("n must be an integer or a partition") 

  

_op_integer(length, clength) 

  

sig_on() 

compute_homsym_with_alphabet(cn, clength, cresult) 

sig_off() 

  

res = _py_polynom_alphabet(cresult, alphabet, length) 

  

freeall(cresult) 

freeall(cn) 

freeall(clength) 

  

return res 

  

  

def compute_elmsym_with_alphabet_symmetrica(n, length, alphabet='x'): 

""" 

computes the expansion of a elementary symmetric 

function labeled by a INTEGER number as a POLYNOM erg. 

The object number may also be a PARTITION or a ELM_SYM object. 

The INTEGER length specifies the length of the alphabet. 

Both routines are the same. 

  

EXAMPLES: 

sage: a = symmetrica.compute_elmsym_with_alphabet(2,2); a 

x0*x1 

sage: a.parent() 

Multivariate Polynomial Ring in x0, x1 over Integer Ring 

sage: a = symmetrica.compute_elmsym_with_alphabet([2],2); a 

x0*x1 

sage: symmetrica.compute_elmsym_with_alphabet(3,2) 

0 

sage: symmetrica.compute_elmsym_with_alphabet([3,2,1],2) 

0 

  

""" 

late_import() 

cdef OP cn = callocobject(), clength = callocobject(), cresult = callocobject() 

  

if isinstance(n, (int, Integer)): 

if n > length: 

return 0 

_op_integer(n, cn) 

elif isinstance(n, (builtinlist, Partition)): 

if max(n) > length: 

return 0 

_op_partition(n, cn) 

else: 

raise NotImplementedError("n must be an integer or a partition") 

  

_op_integer(length, clength) 

  

sig_on() 

compute_elmsym_with_alphabet(cn, clength, cresult) 

sig_off() 

  

res = _py_polynom_alphabet(cresult, alphabet, length) 

  

freeall(cresult) 

freeall(cn) 

freeall(clength) 

  

return res 

  

  

def compute_monomial_with_alphabet_symmetrica(n, length, alphabet='x'): 

""" 

computes the expansion of a monomial symmetric 

function labeled by a PARTITION number as a POLYNOM erg. 

The INTEGER laenge specifies the length of the alphabet. 

  

EXAMPLES: 

sage: symmetrica.compute_monomial_with_alphabet([2,1],2,'x') 

x0^2*x1 + x0*x1^2 

sage: symmetrica.compute_monomial_with_alphabet([1,1,1],2,'x') 

0 

sage: symmetrica.compute_monomial_with_alphabet(2,2,'x') 

x0^2 + x1^2 

sage: symmetrica.compute_monomial_with_alphabet(2,2,'a,b') 

a^2 + b^2 

sage: symmetrica.compute_monomial_with_alphabet(2,2,'x').parent() 

Multivariate Polynomial Ring in x0, x1 over Integer Ring 

  

""" 

late_import() 

cdef OP cn = callocobject(), clength = callocobject(), cresult = callocobject() 

if isinstance(n, (int, Integer)): 

_op_integer(n, cn) 

elif isinstance(n, (builtinlist, Partition)): 

if len(n) > length: 

return 0 

_op_partition(n, cn) 

else: 

raise NotImplementedError("n must be an integer or a partition") 

  

_op_integer(length, clength) 

  

sig_on() 

compute_monomial_with_alphabet(cn, clength, cresult) 

sig_off() 

  

res = _py_polynom_alphabet(cresult, alphabet, length) 

  

freeall(cresult) 

freeall(cn) 

freeall(clength) 

  

return res 

  

  

def compute_powsym_with_alphabet_symmetrica(n, length, alphabet='x'): 

""" 

computes the expansion of a power symmetric 

function labeled by a INTEGER label or by a PARTITION label 

or a POW_SYM label as a POLYNOM erg. 

The INTEGER laenge specifies the length of the alphabet. 

  

EXAMPLES: 

sage: symmetrica.compute_powsym_with_alphabet(2,2,'x') 

x0^2 + x1^2 

sage: symmetrica.compute_powsym_with_alphabet(2,2,'x').parent() 

Multivariate Polynomial Ring in x0, x1 over Integer Ring 

sage: symmetrica.compute_powsym_with_alphabet([2],2,'x') 

x0^2 + x1^2 

sage: symmetrica.compute_powsym_with_alphabet([2],2,'a,b') 

a^2 + b^2 

sage: symmetrica.compute_powsym_with_alphabet([2,1],2,'a,b') 

a^3 + a^2*b + a*b^2 + b^3 

  

""" 

late_import() 

cdef OP cn = callocobject(), clength = callocobject(), cresult = callocobject() 

  

if isinstance(n, (int, Integer)): 

_op_integer(n, cn) 

elif isinstance(n, (builtinlist, Partition)): 

_op_partition(n, cn) 

else: 

raise NotImplementedError("need to write code for POW_SYM") 

  

_op_integer(length, clength) 

  

sig_on() 

compute_powsym_with_alphabet(cn, clength, cresult) 

sig_off() 

  

res = _py_polynom_alphabet(cresult, alphabet, length) 

  

freeall(cresult) 

freeall(cn) 

freeall(clength) 

  

return res 

  

  

def compute_schur_with_alphabet_det_symmetrica(part, length, alphabet='x'): 

""" 

EXAMPLES: 

sage: symmetrica.compute_schur_with_alphabet_det(2,2) 

x0^2 + x0*x1 + x1^2 

sage: symmetrica.compute_schur_with_alphabet_det([2],2) 

x0^2 + x0*x1 + x1^2 

sage: symmetrica.compute_schur_with_alphabet_det(Partition([2]),2) 

x0^2 + x0*x1 + x1^2 

sage: symmetrica.compute_schur_with_alphabet_det(Partition([2]),2,'y') 

y0^2 + y0*y1 + y1^2 

sage: symmetrica.compute_schur_with_alphabet_det(Partition([2]),2,'a,b') 

a^2 + a*b + b^2 

""" 

cdef OP cpart = callocobject(), cresult = callocobject(), clength = callocobject() 

  

if isinstance(part, (int, Integer)): 

_op_partition([part], cpart) 

elif isinstance(part, (builtinlist, Partition)): 

_op_partition(part, cpart) 

else: 

raise NotImplementedError("n must be an integer or partition") 

  

_op_integer(length, clength) 

  

sig_on() 

compute_schur_with_alphabet_det(cpart, clength, cresult) 

sig_off() 

  

res = _py_polynom_alphabet(cresult, alphabet, length) 

  

freeall(cresult) 

freeall(cpart) 

freeall(clength) 

  

return res 

  

def part_part_skewschur_symmetrica(outer, inner): 

""" 

Return the skew Schur function s_{outer/inner}. 

  

EXAMPLES:: 

  

sage: symmetrica.part_part_skewschur([3,2,1],[2,1]) 

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

""" 

cdef OP couter = callocobject(), cinner = callocobject(), cresult = callocobject() 

  

_op_partition(outer, couter) 

_op_partition(inner, cinner) 

  

sig_on() 

part_part_skewschur(couter, cinner, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(couter) 

freeall(cinner) 

freeall(cresult) 

  

return res 

  

def hall_littlewood_symmetrica(part): 

""" 

computes the so called Hall Littlewood Polynomials, i.e. 

a SCHUR object, whose coefficient are polynomials in one 

variable. The method, which is used for the computation is described 

in the paper: A.O. Morris The Characters of the group GL(n,q) 

Math Zeitschr 81, 112-123 (1963) 

""" 

  

cdef OP cpart = callocobject(), cresult = callocobject() 

cdef OP pointer 

  

if len(part) == 0: 

raise TypeError("part must be a partition of a positive integer") 

  

_op_partition(part, cpart) 

  

sig_on() 

hall_littlewood(cpart, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(cpart) 

  

return res 

  

  

def t_SCHUR_MONOMIAL_symmetrica(schur): 

""" 

""" 

  

cdef OP cschur = callocobject(), cresult = callocobject() 

  

_op_schur(schur, cschur) 

  

sig_on() 

t_SCHUR_MONOMIAL(cschur, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(cschur) 

  

return res 

  

  

  

def t_SCHUR_HOMSYM_symmetrica(schur): 

""" 

""" 

  

cdef OP cschur = callocobject(), cresult = callocobject() 

  

_op_schur(schur, cschur) 

  

sig_on() 

t_SCHUR_HOMSYM(cschur, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(cschur) 

  

return res 

  

  

def t_SCHUR_ELMSYM_symmetrica(schur): 

""" 

""" 

  

cdef OP cschur = callocobject(), cresult = callocobject() 

  

_op_schur(schur, cschur) 

  

sig_on() 

t_SCHUR_ELMSYM(cschur, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(cschur) 

  

return res 

  

  

def t_SCHUR_POWSYM_symmetrica(schur): 

""" 

  

""" 

  

cdef OP cschur = callocobject(), cresult = callocobject() 

  

_op_schur(schur, cschur) 

  

sig_on() 

t_SCHUR_POWSYM(cschur, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(cschur) 

  

return res 

  

def t_POLYNOM_SCHUR_symmetrica(p): 

""" 

Converts a symmetric polynomial with base ring QQ or ZZ into a symmetric function 

in the Schur basis. 

""" 

cdef OP polynom = callocobject(), cresult = callocobject() 

  

_op_polynom(p, polynom) 

  

if not symmetricp(polynom): 

raise ValueError("the polynomial must be symmetric") 

  

sig_on() 

t_POLYNOM_SCHUR(polynom, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(polynom) 

  

return res 

  

  

  

  

  

def t_MONOMIAL_HOMSYM_symmetrica(monomial): 

""" 

  

""" 

  

cdef OP cmonomial = callocobject(), cresult = callocobject() 

  

_op_monomial(monomial, cmonomial) 

  

sig_on() 

t_MONOMIAL_HOMSYM(cmonomial, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(cmonomial) 

  

return res 

  

def t_MONOMIAL_ELMSYM_symmetrica(monomial): 

""" 

  

""" 

  

cdef OP cmonomial = callocobject(), cresult = callocobject() 

  

_op_monomial(monomial, cmonomial) 

  

sig_on() 

t_MONOMIAL_ELMSYM(cmonomial, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(cmonomial) 

  

return res 

  

  

def t_MONOMIAL_SCHUR_symmetrica(monomial): 

""" 

  

""" 

  

cdef OP cmonomial = callocobject(), cresult = callocobject() 

  

_op_monomial(monomial, cmonomial) 

  

sig_on() 

t_MONOMIAL_SCHUR(cmonomial, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(cmonomial) 

  

return res 

  

  

def t_MONOMIAL_POWSYM_symmetrica(monomial): 

""" 

  

""" 

  

cdef OP cmonomial = callocobject(), cresult = callocobject() 

  

_op_monomial(monomial, cmonomial) 

  

sig_on() 

t_MONOMIAL_POWSYM(cmonomial, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(cmonomial) 

  

return res 

  

def t_POLYNOM_MONOMIAL_symmetrica(p): 

""" 

Converts a symmetric polynomial with base ring QQ or ZZ into a symmetric function 

in the monomial basis. 

""" 

cdef OP polynom = callocobject(), cresult = callocobject() 

  

_op_polynom(p, polynom) 

  

if not symmetricp(polynom): 

raise ValueError("the polynomial must be symmetric") 

  

sig_on() 

t_POLYNOM_MONOMIAL(polynom, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(polynom) 

  

return res 

  

  

def t_ELMSYM_SCHUR_symmetrica(elmsym): 

""" 

  

""" 

  

cdef OP celmsym = callocobject(), cresult = callocobject() 

  

_op_elmsym(elmsym, celmsym) 

  

sig_on() 

t_ELMSYM_SCHUR(celmsym, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(celmsym) 

  

return res 

  

  

def t_ELMSYM_POWSYM_symmetrica(elmsym): 

""" 

  

""" 

  

cdef OP celmsym = callocobject(), cresult = callocobject() 

  

_op_elmsym(elmsym, celmsym) 

  

sig_on() 

t_ELMSYM_POWSYM(celmsym, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(celmsym) 

  

return res 

  

def t_ELMSYM_MONOMIAL_symmetrica(elmsym): 

""" 

  

""" 

  

cdef OP celmsym = callocobject(), cresult = callocobject() 

  

_op_elmsym(elmsym, celmsym) 

  

sig_on() 

t_ELMSYM_MONOMIAL(celmsym, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(celmsym) 

  

return res 

  

  

  

def t_ELMSYM_HOMSYM_symmetrica(elmsym): 

""" 

  

""" 

  

cdef OP celmsym = callocobject(), cresult = callocobject() 

  

_op_elmsym(elmsym, celmsym) 

  

sig_on() 

t_ELMSYM_HOMSYM(celmsym, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(celmsym) 

  

return res 

  

def t_POLYNOM_ELMSYM_symmetrica(p): 

""" 

Converts a symmetric polynomial with base ring QQ or ZZ into a symmetric function 

in the elementary basis. 

""" 

cdef OP polynom = callocobject(), cresult = callocobject() 

  

_op_polynom(p, polynom) 

  

if not symmetricp(polynom): 

raise ValueError("the polynomial must be symmetric") 

  

sig_on() 

t_POLYNOM_ELMSYM(polynom, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(polynom) 

  

return res 

  

  

  

def t_HOMSYM_SCHUR_symmetrica(homsym): 

""" 

  

""" 

  

cdef OP chomsym = callocobject(), cresult = callocobject() 

  

_op_homsym(homsym, chomsym) 

  

sig_on() 

t_HOMSYM_SCHUR(chomsym, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(chomsym) 

  

return res 

  

def t_HOMSYM_POWSYM_symmetrica(homsym): 

""" 

  

""" 

  

cdef OP chomsym = callocobject(), cresult = callocobject() 

  

_op_homsym(homsym, chomsym) 

  

sig_on() 

t_HOMSYM_POWSYM(chomsym, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(chomsym) 

  

return res 

  

  

  

  

def t_HOMSYM_MONOMIAL_symmetrica(homsym): 

""" 

  

""" 

  

cdef OP chomsym = callocobject(), cresult = callocobject() 

  

_op_homsym(homsym, chomsym) 

  

sig_on() 

t_HOMSYM_MONOMIAL(chomsym, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(chomsym) 

  

return res 

  

def t_HOMSYM_ELMSYM_symmetrica(homsym): 

""" 

  

""" 

  

cdef OP chomsym = callocobject(), cresult = callocobject() 

  

_op_homsym(homsym, chomsym) 

  

sig_on() 

t_HOMSYM_ELMSYM(chomsym, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(chomsym) 

  

return res 

  

  

  

def t_POWSYM_MONOMIAL_symmetrica(powsym): 

""" 

  

""" 

  

cdef OP cpowsym = callocobject(), cresult = callocobject() 

  

_op_powsym(powsym, cpowsym) 

  

sig_on() 

t_POWSYM_MONOMIAL(cpowsym, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(cpowsym) 

  

return res 

  

  

  

  

def t_POWSYM_SCHUR_symmetrica(powsym): 

""" 

  

""" 

  

cdef OP cpowsym = callocobject(), cresult = callocobject() 

  

_op_powsym(powsym, cpowsym) 

  

sig_on() 

t_POWSYM_SCHUR(cpowsym, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(cpowsym) 

  

return res 

  

def t_POWSYM_ELMSYM_symmetrica(powsym): 

""" 

  

""" 

  

cdef OP cpowsym = callocobject(), cresult = callocobject() 

  

_op_powsym(powsym, cpowsym) 

  

sig_on() 

t_POWSYM_ELMSYM(cpowsym, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(cpowsym) 

  

return res 

  

def t_POWSYM_HOMSYM_symmetrica(powsym): 

""" 

  

""" 

  

cdef OP cpowsym = callocobject(), cresult = callocobject() 

  

_op_powsym(powsym, cpowsym) 

  

sig_on() 

t_POWSYM_HOMSYM(cpowsym, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(cpowsym) 

  

return res 

  

def t_POLYNOM_POWER_symmetrica(p): 

""" 

Converts a symmetric polynomial with base ring QQ or ZZ into a symmetric function 

in the power sum basis. 

""" 

cdef OP polynom = callocobject(), cresult = callocobject() 

  

_op_polynom(p, polynom) 

  

if not symmetricp(polynom): 

raise ValueError("the polynomial must be symmetric") 

  

sig_on() 

t_POLYNOM_POWER(polynom, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cresult) 

freeall(polynom) 

  

return res 

  

  

def mult_schur_schur_symmetrica(s1, s2): 

""" 

""" 

cdef OP cs1 = callocobject(), cs2 = callocobject(), cresult = callocobject() 

  

_op_schur(s1, cs1) 

_op_schur(s2, cs2) 

  

sig_on() 

mult_schur_schur(cs1, cs2, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cs1) 

freeall(cs2) 

freeall(cresult) 

  

return res 

  

  

  

def mult_monomial_monomial_symmetrica(m1, m2): 

""" 

""" 

cdef OP cm1 = callocobject(), cm2 = callocobject(), cresult = callocobject() 

  

_op_monomial(m1, cm1) 

_op_monomial(m2, cm2) 

  

sig_on() 

mult_monomial_monomial(cm1, cm2, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cm1) 

freeall(cm2) 

freeall(cresult) 

  

return res 

  

  

  

def scalarproduct_schur_symmetrica(s1, s2): 

cdef OP cs1 = callocobject(), cs2 = callocobject(), cresult = callocobject() 

  

_op_schur(s1, cs1) 

_op_schur(s2, cs2) 

  

sig_on() 

scalarproduct_schur(cs1, cs2, cresult) 

sig_off() 

  

res = _py(cresult) 

  

freeall(cs1) 

freeall(cs2) 

freeall(cresult) 

  

return res