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

# -*- coding: utf-8 -*- 

""" 

Manin symbol lists 

 

There are various different classes holding lists of Manin symbols of 

different types. The hierarchy is as follows: 

 

- :class:`ManinSymbolList` 

 

- :class:`ManinSymbolList_group` 

 

- :class:`ManinSymbolList_gamma0` 

- :class:`ManinSymbolList_gamma1` 

- :class:`ManinSymbolList_gamma_h` 

 

- :class:`ManinSymbolList_character` 

 

""" 

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

# Sage: System for Algebra and Geometry Experimentation 

# 

# Copyright (C) 2005 William Stein <wstein@gmail.com> 

# 

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

# 

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

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

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

# General Public License for more details. 

# 

# The full text of the GPL is available at: 

# 

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

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

from __future__ import absolute_import 

from six.moves import range 

 

import sage.modular.modsym.p1list as p1list 

import sage.modular.modsym.g1list as g1list 

import sage.modular.modsym.ghlist as ghlist 

from sage.rings.all import Integer 

from sage.structure.parent import Parent 

from sage.structure.sage_object import register_unpickle_override 

from sage.structure.richcmp import richcmp_method, richcmp 

from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets 

 

from .apply import apply_to_monomial 

 

from sage.modular.modsym.manin_symbol import ManinSymbol 

 

 

@richcmp_method 

class ManinSymbolList(Parent): 

""" 

Base class for lists of all Manin symbols for a given weight, group or character. 

""" 

 

Element = ManinSymbol 

 

def __init__(self, weight, lst): 

""" 

Constructor for a ManinSymbolList. 

 

INPUT: 

 

- ``weight`` -- the weight of the symbols 

 

- ``lst`` -- the list of symbols 

 

On construction, a ManinSymbolList constructs a dict for 

rapid determination of the index of any given symbol. 

 

This is a base class only; users will only directly construct 

objects in the derived classes ManinSymbolList_gamma0, 

ManinSymbolList_gamma1, ManinSymbolList_gamma_h, 

ManinSymbolList_gamma_character. Many standard methods are 

only implemented in the derived classes. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList 

sage: ManinSymbolList(6,P1List(11)) 

<sage.modular.modsym.manin_symbol_list.ManinSymbolList_with_category object at ...> 

""" 

self._weight = weight 

self._symbol_list = lst 

self._index = {x: i for i,x in enumerate(lst)} 

Parent.__init__(self, category=FiniteEnumeratedSets()) 

 

def _element_constructor_(self, x): 

""" 

Construct an element of ``self``. 

 

TESTS:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList 

sage: m = ManinSymbolList(6, P1List(11)) 

sage: x = m((2, 3, 5)); x 

[X^2*Y^2,(3,5)] 

sage: m(x) == x 

True 

""" 

if isinstance(x, ManinSymbol): 

x = x.tuple() 

return self.element_class(self, x) 

 

def __richcmp__(self, right, op): 

""" 

Comparison function for ManinSymbolList objects. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList 

sage: m1 = ManinSymbolList(6,P1List(11)) 

sage: m2 = ManinSymbolList(6,P1List(13)) 

sage: m3 = ManinSymbolList(4,P1List(11)) 

sage: m1 < m2 

True 

sage: m2 < m3 

False 

sage: m1 < m3 

False 

""" 

if not isinstance(right, ManinSymbolList): 

return NotImplemented 

return richcmp((self._weight, self._symbol_list), 

(right._weight, right._symbol_list), op) 

 

def symbol_list(self): 

""" 

Return the list of symbols of ``self``. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList 

sage: m = ManinSymbolList(6, P1List(11)) 

""" 

return list(self._symbol_list) # This makes a shallow copy 

 

def __len__(self): 

""" 

Return the length of this :class:`ManinSymbolList`. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList 

sage: m = ManinSymbolList(6,P1List(11)) 

sage: len(m) 

12 

""" 

return len(self._symbol_list) 

 

def apply(self, j, X): 

""" 

Apply the matrix `X = [a, b; c, d]` to the `j`-th Manin symbol. 

 

Implemented in derived classes. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList 

sage: m = ManinSymbolList(6,P1List(11)) 

sage: m.apply(10, [1,2,0,1]) 

Traceback (most recent call last): 

... 

NotImplementedError: Only implemented in derived classes 

 

""" 

raise NotImplementedError("Only implemented in derived classes") 

 

def _apply_S_only_0pm1(self): 

""" 

Return True if the coefficient when applying the S relation is 

always 0, 1, or -1. This is useful for optimizing code in 

relation_matrix.py. 

 

EXAMPLES:: 

 

sage: eps = DirichletGroup(4).gen(0) 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character 

sage: ManinSymbolList_character(eps,2)._apply_S_only_0pm1() 

True 

sage: eps = DirichletGroup(7).gen(0) 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character 

sage: ManinSymbolList_character(eps,2)._apply_S_only_0pm1() 

False 

""" 

return False # derived classes could overload and put True 

 

def apply_S(self, j): 

""" 

Apply the matrix `S = [0, -1; 1, 0]` to the `j`-th Manin symbol. 

 

Implemented in derived classes. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList 

sage: m = ManinSymbolList(6,P1List(11)) 

sage: m.apply_S(10) 

Traceback (most recent call last): 

... 

NotImplementedError: Only implemented in derived classes 

""" 

raise NotImplementedError("Only implemented in derived classes") 

 

def apply_I(self, j): 

""" 

Apply the matrix `I = [-1, 0; 0, 1]` to the `j`-th Manin symbol. 

 

Implemented in derived classes. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList 

sage: m = ManinSymbolList(6,P1List(11)) 

sage: m.apply_I(10) 

Traceback (most recent call last): 

... 

NotImplementedError: Only implemented in derived classes 

""" 

raise NotImplementedError("Only implemented in derived classes") 

 

def apply_T(self, j): 

""" 

Apply the matrix `T = [0, 1; -1, -1]` to the `j`-th Manin symbol. 

 

Implemented in derived classes. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList 

sage: m = ManinSymbolList(6,P1List(11)) 

sage: m.apply_T(10) 

Traceback (most recent call last): 

... 

NotImplementedError: Only implemented in derived classes 

""" 

raise NotImplementedError("Only implemented in derived classes") 

 

def apply_TT(self, j): 

""" 

Apply the matrix `TT = T^2 = [-1, -1; 0, 1]` to the `j`-th 

Manin symbol. 

 

Implemented in derived classes. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList 

sage: m = ManinSymbolList(6,P1List(11)) 

sage: m.apply_TT(10) 

Traceback (most recent call last): 

... 

NotImplementedError: Only implemented in derived classes 

""" 

raise NotImplementedError("Only implemented in derived classes") 

 

def index(self, x): 

""" 

Return the index of ``x`` in the list of Manin symbols. 

 

INPUT: 

 

- ``x`` -- a triple of integers `(i, u, v)` defining a valid 

Manin symbol, which need not be normalized 

 

OUTPUT: 

 

integer -- the index of the normalized Manin symbol equivalent 

to `(i, u, v)`. If ``x`` is not in ``self``, -1 is returned. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList 

sage: m = ManinSymbolList(6,P1List(11)) 

sage: m.index(m.symbol_list()[2]) 

2 

sage: S = m.symbol_list() 

sage: all([i == m.index(S[i]) for i in range(len(S))]) 

True 

""" 

if x in self._index: 

return self._index[x] 

x = self.normalize(x) 

try: 

return self._index[x] 

except KeyError: 

return -1 

 

def manin_symbol_list(self): 

""" 

Return all the Manin symbols in ``self`` as a list. 

 

Cached for subsequent calls. 

 

OUTPUT: 

 

A list of :class:`ManinSymbol` objects, which is a copy of the 

complete list of Manin symbols. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList 

sage: m = ManinSymbolList(6,P1List(11)) 

sage: m.manin_symbol_list() # not implemented for the base class 

 

:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0 

sage: m = ManinSymbolList_gamma0(6, 4) 

sage: m.manin_symbol_list() 

[[Y^2,(0,1)], 

[Y^2,(1,0)], 

[Y^2,(1,1)], 

... 

[X^2,(3,1)], 

[X^2,(3,2)]] 

 

""" 

import copy 

try: 

return copy.copy(self.__manin_symbol_list) 

except AttributeError: 

self.__manin_symbol_list = [self.manin_symbol(i) 

for i in range(len(self))] 

return copy.copy(self.__manin_symbol_list) 

 

list = manin_symbol_list 

 

def manin_symbol(self, i): 

""" 

Return the ``i``-th Manin symbol in this :class:`ManinSymbolList`. 

 

INPUT: 

 

- ``i`` -- integer, a valid index of a symbol in this list 

 

OUTPUT: 

 

:class:`ManinSymbol` -- the `i`'th Manin symbol in the list. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList 

sage: m = ManinSymbolList(6,P1List(11)) 

sage: m.manin_symbol(3) # not implemented for base class 

 

:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0 

sage: m = ManinSymbolList_gamma0(6, 4) 

sage: s = m.manin_symbol(3); s 

[Y^2,(1,2)] 

sage: type(s) 

<type 'sage.modular.modsym.manin_symbol.ManinSymbol'> 

""" 

return self.element_class(self, self._symbol_list[i]) 

 

def normalize(self, x): 

""" 

Return a normalized Manin symbol from ``x``. 

 

To be implemented in derived classes. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList 

sage: m = ManinSymbolList(6,P1List(11)) 

sage: m.normalize((0,6,7)) # not implemented in base class 

 

""" 

raise NotImplementedError("Only implemented in derived classes") 

 

def weight(self): 

""" 

Return the weight of the Manin symbols in this :class:`ManinSymbolList`. 

 

OUTPUT: 

 

integer -- the weight of the Manin symbols in the list. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0 

sage: m = ManinSymbolList_gamma0(6, 4) 

sage: m.weight() 

4 

""" 

return self._weight 

 

 

class ManinSymbolList_group(ManinSymbolList): 

""" 

Base class for Manin symbol lists for a given group. 

 

INPUT: 

 

- ``level`` -- integer level 

 

- ``weight`` -- integer weight 

 

- ``syms`` -- something with ``normalize`` and ``list`` methods, 

e.g. :class:`~sage.modular.modsym.p1list.P1List`. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_group 

sage: ManinSymbolList_group(11, 2, P1List(11)) 

<sage.modular.modsym.manin_symbol_list.ManinSymbolList_group_with_category object at ...> 

""" 

def __init__(self, level, weight, syms): 

""" 

Constructor for class ManinSymbolList_group. 

 

INPUT: 

 

- ``level`` -- integer level 

 

- ``weight`` -- integer weight 

 

- ``syms`` -- something with ``normalize`` and ``list`` 

methods, e.g. :class:`~sage.modular.modsym.p1list.P1List`. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_group 

sage: L = ManinSymbolList_group(11, 2, P1List(11)); L 

<sage.modular.modsym.manin_symbol_list.ManinSymbolList_group_with_category object at ...> 

""" 

self.__level = level 

self.__syms = syms # syms is anything with a normalize and list method. 

 

# The list returned from P1List is guaranteed to be sorted. 

# Thus each list constructed below is also sorted. This is 

# important since the index function assumes the list is sorted. 

L = [(i, u, v) for i in range(weight - 2 + 1) 

for u, v in syms.list()] 

ManinSymbolList.__init__(self, weight, L) 

 

def level(self): 

""" 

Return the level of this :class:`ManinSymbolList`. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0 

sage: ManinSymbolList_gamma0(5,2).level() 

5 

 

:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma1 

sage: ManinSymbolList_gamma1(51,2).level() 

51 

 

:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma_h 

sage: ManinSymbolList_gamma_h(GammaH(117, [4]),2).level() 

117 

""" 

return self.__level 

 

def apply_S(self, j): 

""" 

Apply the matrix `S = [0, -1; 1, 0]` to the `j`-th Manin symbol. 

 

INPUT: 

 

- ``j`` -- (int) a symbol index 

 

OUTPUT: 

 

``(k, s)`` where k is the index of the symbol obtained by acting on the 

`j`'th symbol with `S`, and `s` is the parity of the `j`'th symbol 

(a Python ``int``, either 1 or -1). 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0 

sage: m = ManinSymbolList_gamma0(5,8) 

sage: m.apply_S(4) 

(40, 1) 

sage: [m.apply_S(i) for i in range(len(m))] 

[(37, 1), 

(36, 1), 

(41, 1), 

(39, 1), 

(40, 1), 

(38, 1), 

(31, -1), 

(30, -1), 

(35, -1), 

(33, -1), 

(34, -1), 

(32, -1), 

... 

(4, 1), 

(2, 1)] 

""" 

i, u, v = self._symbol_list[j] 

k = self.index((self._weight-2-i, v, -u)) 

if i%2 == 0: 

return k, 1 

else: 

return k, -1 

 

def _apply_S_only_0pm1(self): 

""" 

Return True if the coefficient when applying the S relation is 

always 0, 1, or -1. This is useful for optimizing code in 

relation_matrix.py. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0 

sage: ManinSymbolList_gamma0(5,8)._apply_S_only_0pm1() 

True 

""" 

return True 

 

def apply_I(self, j): 

""" 

Apply the matrix `I=[-1,0,0,1]` to the `j`-th Manin symbol. 

 

INPUT: 

 

- ``j`` - (int) a symbol index 

 

OUTPUT: 

 

``(k, s)`` where k is the index of the symbol obtained by acting on the 

`j`'th symbol with `I`, and `s` is the parity of the `j`'th symbol 

(a Python ``int``, either 1 or -1) 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0 

sage: m = ManinSymbolList_gamma0(5,8) 

sage: m.apply_I(4) 

(3, 1) 

sage: [m.apply_I(i) for i in range(10)] 

[(0, 1), 

(1, 1), 

(5, 1), 

(4, 1), 

(3, 1), 

(2, 1), 

(6, -1), 

(7, -1), 

(11, -1), 

(10, -1)] 

""" 

i, u, v = self._symbol_list[j] 

k = self.index((i, -u, v)) 

if i%2 == 0: 

return k, 1 

else: 

return k, -1 

 

def apply_T(self, j): 

""" 

Apply the matrix `T=[0,1,-1,-1]` to the `j`-th Manin symbol. 

 

INPUT: 

 

- ``j`` - (int) a symbol index 

 

OUTPUT: see documentation for apply() 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0 

sage: m = ManinSymbolList_gamma0(5,8) 

sage: m.apply_T(4) 

[(3, 1), (9, -6), (15, 15), (21, -20), (27, 15), (33, -6), (39, 1)] 

sage: [m.apply_T(i) for i in range(10)] 

[[(5, 1), (11, -6), (17, 15), (23, -20), (29, 15), (35, -6), (41, 1)], 

[(0, 1), (6, -6), (12, 15), (18, -20), (24, 15), (30, -6), (36, 1)], 

[(4, 1), (10, -6), (16, 15), (22, -20), (28, 15), (34, -6), (40, 1)], 

[(2, 1), (8, -6), (14, 15), (20, -20), (26, 15), (32, -6), (38, 1)], 

[(3, 1), (9, -6), (15, 15), (21, -20), (27, 15), (33, -6), (39, 1)], 

[(1, 1), (7, -6), (13, 15), (19, -20), (25, 15), (31, -6), (37, 1)], 

[(5, 1), (11, -5), (17, 10), (23, -10), (29, 5), (35, -1)], 

[(0, 1), (6, -5), (12, 10), (18, -10), (24, 5), (30, -1)], 

[(4, 1), (10, -5), (16, 10), (22, -10), (28, 5), (34, -1)], 

[(2, 1), (8, -5), (14, 10), (20, -10), (26, 5), (32, -1)]] 

""" 

k = self._weight 

i, u, v = self._symbol_list[j] 

u, v = self.__syms.normalize(v,-u-v) 

if (k-2) % 2 == 0: 

s = 1 

else: 

s = -1 

z = [] 

a = Integer(k-2-i) 

for j in range(k-2-i+1): 

m = self.index((j, u, v)) 

z.append((m, s * a.binomial(j))) 

s *= -1 

return z 

 

def apply_TT(self, j): 

""" 

Apply the matrix `TT=[-1,-1,0,1]` to the `j`-th Manin symbol. 

 

INPUT: 

 

- ``j`` - (int) a symbol index 

 

OUTPUT: see documentation for apply() 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0 

sage: m = ManinSymbolList_gamma0(5,8) 

sage: m.apply_TT(4) 

[(38, 1)] 

sage: [m.apply_TT(i) for i in range(10)] 

[[(37, 1)], 

[(41, 1)], 

[(39, 1)], 

[(40, 1)], 

[(38, 1)], 

[(36, 1)], 

[(31, -1), (37, 1)], 

[(35, -1), (41, 1)], 

[(33, -1), (39, 1)], 

[(34, -1), (40, 1)]] 

""" 

k = self._weight 

i, u, v = self._symbol_list[j] 

u, v = self.__syms.normalize(-u-v,u) 

if (k-2-i) % 2 == 0: 

s = 1 

else: 

s = -1 

z = [] 

a = Integer(i) 

for j in range(i+1): 

m = self.index((k-2-i+j, u, v)) 

z.append((m, s * a.binomial(j))) 

s *= -1 

return z 

 

def apply(self, j, m): 

r""" 

Apply the matrix `m = [a, b; c, d]` to the `j`-th Manin symbol. 

 

INPUT: 

 

- ``j`` - (int) a symbol index 

 

- ``m = [a, b, c, d]`` a list of 4 integers, which defines a 2x2 matrix 

 

OUTPUT: 

 

a list of pairs `(j_i, \alpha_i)`, where each `\alpha_i` is a nonzero 

integer, `j_i` is an integer (index of the `j_i`-th Manin symbol), and 

`\sum_i \alpha_i\*x_{j_i}` is the image of the j-th Manin symbol under 

the right action of the matrix [a,b;c,d]. Here the right action of 

`g = [a, b; c, d]` on a Manin symbol `[P(X,Y),(u,v)]` is 

`[P(aX+bY,cX+dY),(u,v)\*g]`. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0 

sage: m = ManinSymbolList_gamma0(5,8) 

sage: m.apply(40, [2,3,1,1]) 

[(0, 729), (6, 2916), (12, 4860), (18, 4320), 

(24, 2160), (30, 576), (36, 64)] 

""" 

a, b, c, d = m[0], m[1], m[2], m[3] 

i, u, v = self._symbol_list[j] 

P = apply_to_monomial(i, self._weight-2, a, b, c, d) 

m = self.index((0, u*a+v*c, u*b+v*d)) 

if m == -1: 

return [] 

r = len(self.__syms) 

return [(m + r*k, P[k]) for k in range(self._weight-2+1) 

if P[k] != 0] 

 

def normalize(self, x): 

""" 

Return the normalization of the Manin symbol ``x`` with 

respect to this list. 

 

INPUT: 

 

- ``x`` -- (3-tuple of ints) a tuple defining a ManinSymbol 

 

OUTPUT: 

 

``(i,u,v)`` -- (3-tuple of ints) another tuple defining the associated 

normalized ManinSymbol 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0 

sage: m = ManinSymbolList_gamma0(5,8) 

sage: [m.normalize(s.tuple()) for s in m.manin_symbol_list()][:10] 

[(0, 0, 1), 

(0, 1, 0), 

(0, 1, 1), 

(0, 1, 2), 

(0, 1, 3), 

(0, 1, 4), 

(1, 0, 1), 

(1, 1, 0), 

(1, 1, 1), 

(1, 1, 2)] 

""" 

u,v = self.__syms.normalize(x[1],x[2]) 

return (x[0],u,v) 

 

 

class ManinSymbolList_gamma0(ManinSymbolList_group): 

r""" 

Class for Manin symbols for `\Gamma_0(N)`. 

 

INPUT: 

 

- ``level`` - (integer): the level. 

 

- ``weight`` - (integer): the weight. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0 

sage: m = ManinSymbolList_gamma0(5,2); m 

Manin Symbol List of weight 2 for Gamma0(5) 

sage: m.manin_symbol_list() 

[(0,1), (1,0), (1,1), (1,2), (1,3), (1,4)] 

sage: m = ManinSymbolList_gamma0(6,4); m 

Manin Symbol List of weight 4 for Gamma0(6) 

sage: len(m) 

36 

""" 

def __init__(self, level, weight): 

""" 

Constructor for a ModularSymbolList for Gamma_0(N) 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0 

sage: M11 = ManinSymbolList_gamma0(11,2) 

sage: M11 

Manin Symbol List of weight 2 for Gamma0(11) 

sage: M11 == loads(dumps(M11)) 

True 

""" 

ManinSymbolList_group.__init__(self, level, weight, p1list.P1List(level)) 

 

def __repr__(self): 

""" 

String representation. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0 

sage: M11 = ManinSymbolList_gamma0(11,2) 

sage: str(M11) 

'Manin Symbol List of weight 2 for Gamma0(11)' 

 

""" 

return "Manin Symbol List of weight %s for Gamma0(%s)"%( 

self.weight(), self.level()) 

 

 

class ManinSymbolList_gamma1(ManinSymbolList_group): 

r""" 

Class for Manin symbols for `\Gamma_1(N)`. 

 

INPUT: 

 

- ``level`` - (integer): the level. 

 

- ``weight`` - (integer): the weight. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma1 

sage: m = ManinSymbolList_gamma1(5,2); m 

Manin Symbol List of weight 2 for Gamma1(5) 

sage: m.manin_symbol_list() 

[(0,1), 

(0,2), 

(0,3), 

... 

(4,3), 

(4,4)] 

sage: m = ManinSymbolList_gamma1(6,4); m 

Manin Symbol List of weight 4 for Gamma1(6) 

sage: len(m) 

72 

sage: m == loads(dumps(m)) 

True 

""" 

def __init__(self, level, weight): 

""" 

Constructor for a ModularSymbolList for `\Gamma_0(N)`. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma1 

sage: M11 = ManinSymbolList_gamma1(11,2) 

sage: M11 

Manin Symbol List of weight 2 for Gamma1(11) 

""" 

ManinSymbolList_group.__init__(self, level, weight, g1list.G1list(level)) 

 

def __repr__(self): 

""" 

Return the string representation of this :class:`ManinSymbolList`. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma1 

sage: M11 = ManinSymbolList_gamma1(11,4) 

sage: str(M11) 

'Manin Symbol List of weight 4 for Gamma1(11)' 

""" 

return "Manin Symbol List of weight %s for Gamma1(%s)"%( 

self.weight(), self.level()) 

 

 

class ManinSymbolList_gamma_h(ManinSymbolList_group): 

r""" 

Class for Manin symbols for `\Gamma_H(N)`. 

 

INPUT: 

 

- ``group`` - (integer): the congruence subgroup. 

 

- ``weight`` - (integer): the weight. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma_h 

sage: G = GammaH(117, [4]) 

sage: m = ManinSymbolList_gamma_h(G,2); m 

Manin Symbol List of weight 2 for Congruence Subgroup Gamma_H(117) with H generated by [4] 

sage: m.manin_symbol_list()[100:110] 

[(1,88), 

(1,89), 

(1,90), 

(1,91), 

(1,92), 

(1,93), 

(1,94), 

(1,95), 

(1,96), 

(1,97)] 

sage: len(m.manin_symbol_list()) 

2016 

sage: m == loads(dumps(m)) 

True 

""" 

def __init__(self, group, weight): 

r""" 

Constructor for Manin symbols for `\Gamma_H(N)`. 

 

EXAMPLES:: 

 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma_h 

sage: G = GammaH(117, [4]) 

sage: m = ManinSymbolList_gamma_h(G,2); m 

Manin Symbol List of weight 2 for Congruence Subgroup Gamma_H(117) with H generated by [4] 

""" 

self.__group = group 

ManinSymbolList_group.__init__(self, group.level(), weight, ghlist.GHlist(group)) 

 

def group(self): 

""" 

Return the group associated to self. 

 

EXAMPLES:: 

 

sage: ModularSymbols(GammaH(12, [5]), 2).manin_symbols().group() 

Congruence Subgroup Gamma_H(12) with H generated by [5] 

""" 

return self.__group 

 

def __repr__(self): 

""" 

Return the string representation of self. 

 

EXAMPLES:: 

 

sage: ModularSymbols(GammaH(12, [5]), 2).manin_symbols().__repr__() 

'Manin Symbol List of weight 2 for Congruence Subgroup Gamma_H(12) with H generated by [5]' 

""" 

return "Manin Symbol List of weight %s for %s"%( 

self.weight(), self.group()) 

 

 

class ManinSymbolList_character(ManinSymbolList): 

""" 

List of Manin symbols with character. 

 

INPUT: 

 

- ``character`` -- (DirichletCharacter) the Dirichlet character 

 

- ``weight`` -- (integer) the weight 

 

EXAMPLES:: 

 

sage: eps = DirichletGroup(4).gen(0) 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character 

sage: m = ManinSymbolList_character(eps,2); m 

Manin Symbol List of weight 2 for Gamma1(4) with character [-1] 

sage: m.manin_symbol_list() 

[(0,1), (1,0), (1,1), (1,2), (1,3), (2,1)] 

sage: m == loads(dumps(m)) 

True 

""" 

def __init__(self, character, weight): 

""" 

Constructor for :class:`ManinSymbolList_character` objects. 

 

INPUT: 

 

- ``character`` - (DirichletCharacter) the Dirichlet character 

 

- ``weight`` - (integer) the weight 

 

EXAMPLES:: 

 

sage: eps = DirichletGroup(4).gen(0) 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character 

sage: m = ManinSymbolList_character(eps,2); m 

Manin Symbol List of weight 2 for Gamma1(4) with character [-1] 

sage: m.manin_symbol_list() 

[(0,1), (1,0), (1,1), (1,2), (1,3), (2,1)] 

sage: TestSuite(m).run() 

""" 

self.__level = character.modulus() 

self.__P1 = p1list.P1List(self.level()) 

 

# We make a copy of the character *only* to program around what seems 

# to be a bug in the cPickle module in some obscure case. 

# If we don't due this, then this doctest fails. 

# sage: M = ModularSymbols(DirichletGroup(5).0) 

# sage: loads(dumps(M)) == M 

 

self.__character = character.__copy__() 

 

# The list returned from P1List is guaranteed to be sorted. 

# Thus each list constructed below is also sorted. This is 

# important since the index function assumes the list is sorted. 

L = [(i, u, v) for i in range(weight-2+1) \ 

for u, v in self.__P1.list()] 

self.__list = L 

ManinSymbolList.__init__(self, weight, L) 

 

def __repr__(self): 

""" 

Standard function returning string representation. 

 

EXAMPLES:: 

 

sage: eps = DirichletGroup(4).gen(0) 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character 

sage: m = ManinSymbolList_character(eps,2); m 

Manin Symbol List of weight 2 for Gamma1(4) with character [-1] 

sage: str(m) # indirect doctest 

'Manin Symbol List of weight 2 for Gamma1(4) with character [-1]' 

""" 

return "Manin Symbol List of weight %s for Gamma1(%s) with character %s"%( 

self.weight(), self.level(), self.character()._repr_short_()) 

 

def level(self): 

""" 

Return the level of this :class:`ManinSymbolList`. 

 

OUTPUT: 

 

``integer`` - the level of the symbols in this list. 

 

EXAMPLES:: 

 

sage: eps = DirichletGroup(4).gen(0) 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character 

sage: ManinSymbolList_character(eps,4).level() 

4 

""" 

return self.__level 

 

def apply(self, j, m): 

""" 

Apply the integer matrix `m=[a,b;c,d]` to the `j`-th Manin symbol. 

 

INPUT: 

 

 

- ``j`` (integer): the index of the symbol to act on. 

 

- ``m`` (list of ints): `[a,b,c,d]` where `m = [a, b; c, d]` is the matrix to be applied. 

 

 

OUTPUT: 

 

A list of pairs `(j, c_i)`, where each `c_i` is an 

integer, `j` is an integer (the `j`-th Manin symbol), and the 

sum `c_i*x_i` is the image of self under the right action 

of the matrix `[a,b;c,d]`. Here the right action of 

`g = [a,b;c,d]` on a Manin symbol `[P(X,Y),(u,v)]` is by 

definition `[P(aX+bY,cX+dY),(u,v)*g]`. 

 

EXAMPLES:: 

 

sage: eps = DirichletGroup(4).gen(0) 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character 

sage: m = ManinSymbolList_character(eps,4) 

sage: m[6] 

[X*Y,(0,1)] 

sage: m.apply(4, [1,0,0,1]) 

[(4, 1)] 

sage: m.apply(1, [-1,0,0,1]) 

[(1, -1)] 

""" 

a, b, c, d = m[0], m[1], m[2], m[3] 

i, u, v = self._symbol_list[j] 

P = apply_to_monomial(i, self._weight-2, a, b, c, d) 

m, s = self.index((0, u*a+v*c, u*b+v*d)) 

if m == -1 or s == 0: 

return [] 

r = len(self.__P1) 

return [(m + r*k, s*P[k]) for k in range(self._weight-2+1) 

if P[k] != 0] 

 

def apply_S(self, j): 

""" 

Apply the matrix `S=[0,1;-1,0]` to the `j`-th Manin symbol. 

 

INPUT: 

 

- ``j`` - (integer) a symbol index. 

 

OUTPUT: 

 

``(k, s)`` where `k` is the index of the symbol obtained by acting 

on the `j`'th symbol with `S`, and `s` is the parity of the 

`j`'th symbol. 

 

EXAMPLES:: 

 

sage: eps = DirichletGroup(4).gen(0) 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character 

sage: m = ManinSymbolList_character(eps,2); m 

Manin Symbol List of weight 2 for Gamma1(4) with character [-1] 

sage: m.apply_S(4) 

(2, -1) 

sage: [m.apply_S(i) for i in range(len(m))] 

[(1, 1), (0, -1), (4, 1), (5, -1), (2, -1), (3, 1)] 

""" 

i, u, v = self._symbol_list[j] 

k, s = self.index((self._weight-2-i, v, -u)) 

if i%2 == 0: 

return k, s 

else: 

return k, -s 

 

def _apply_S_only_0pm1(self): 

""" 

Return True if the coefficient when applying the S relation is 

always 0, 1, or -1. This is useful for optimizing code in 

relation_matrix.py. 

 

EXAMPLES:: 

 

sage: eps = DirichletGroup(4).gen(0) 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character 

sage: ManinSymbolList_character(eps,2)._apply_S_only_0pm1() 

True 

sage: ManinSymbolList_character(DirichletGroup(13).0,2)._apply_S_only_0pm1() 

False 

""" 

return self.__character.order() <= 2 

 

def apply_I(self, j): 

""" 

Apply the matrix `I=[-1,0,0,1]` to the `j`-th Manin symbol. 

 

INPUT: 

 

- ``j`` - (integer) a symbol index 

 

OUTPUT: 

 

``(k, s)`` where `k` is the index of the symbol obtained by acting 

on the `j`'th symbol with `I`, and `s` is the parity of the 

`j`'th symbol. 

 

EXAMPLES:: 

 

sage: eps = DirichletGroup(4).gen(0) 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character 

sage: m = ManinSymbolList_character(eps,2); m 

Manin Symbol List of weight 2 for Gamma1(4) with character [-1] 

sage: m.apply_I(4) 

(2, -1) 

sage: [m.apply_I(i) for i in range(len(m))] 

[(0, 1), (1, -1), (4, -1), (3, -1), (2, -1), (5, 1)] 

""" 

i, u, v = self._symbol_list[j] 

k, s = self.index((i, -u, v)) 

if i%2 == 0: 

return k, s 

else: 

return k, -s 

 

def apply_T(self, j): 

""" 

Apply the matrix `T=[0,1,-1,-1]` to the j-th Manin symbol. 

 

INPUT: 

 

- ``j`` - (integer) a symbol index. 

 

OUTPUT: 

 

A list of pairs `(j, c_i)`, where each `c_i` is an 

integer, `j` is an integer (the `j`-th Manin symbol), and the 

sum `c_i*x_i` is the image of self under the right action 

of the matrix `T`. 

 

EXAMPLES:: 

 

sage: eps = DirichletGroup(4).gen(0) 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character 

sage: m = ManinSymbolList_character(eps,2); m 

Manin Symbol List of weight 2 for Gamma1(4) with character [-1] 

sage: m.apply_T(4) 

[(1, -1)] 

sage: [m.apply_T(i) for i in range(len(m))] 

[[(4, 1)], [(0, -1)], [(3, 1)], [(5, 1)], [(1, -1)], [(2, 1)]] 

""" 

k = self._weight 

i, u, v = self._symbol_list[j] 

u, v, r = self.__P1.normalize_with_scalar(v,-u-v) 

r = self.__character(r) 

if (k-2) % 2 == 0: 

s = r 

else: 

s = -r 

z = [] 

a = Integer(k-2-i) 

for j in range(k-2-i+1): 

m, r = self.index((j, u, v)) 

z.append((m, s * r * a.binomial(j))) 

s *= -1 

return z 

 

def apply_TT(self, j): 

""" 

Apply the matrix `TT=[-1,-1,0,1]` to the `j`-th Manin symbol. 

 

INPUT: 

 

- ``j`` - (integer) a symbol index 

 

OUTPUT: 

 

A list of pairs `(j, c_i)`, where each `c_i` is an 

integer, `j` is an integer (the `j`-th Manin symbol), and the 

sum `c_i*x_i` is the image of self under the right action 

of the matrix `T^2`. 

 

EXAMPLES:: 

 

sage: eps = DirichletGroup(4).gen(0) 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character 

sage: m = ManinSymbolList_character(eps,2); m 

Manin Symbol List of weight 2 for Gamma1(4) with character [-1] 

sage: m.apply_TT(4) 

[(0, 1)] 

sage: [m.apply_TT(i) for i in range(len(m))] 

[[(1, -1)], [(4, -1)], [(5, 1)], [(2, 1)], [(0, 1)], [(3, 1)]] 

""" 

k = self._weight 

i, u, v = self._symbol_list[j] 

u, v, r = self.__P1.normalize_with_scalar(-u-v,u) 

r = self.__character(r) 

if (k-2-i) % 2 == 0: 

s = r 

else: 

s = -r 

z = [] 

a = Integer(i) 

for j in range(i+1): 

m, r = self.index((k-2-i+j, u, v)) 

z.append((m, s * r * a.binomial(j))) 

s *= -1 

return z 

 

def character(self): 

""" 

Return the character of this :class:`ManinSymbolList_character` object. 

 

OUTPUT: 

 

The Dirichlet character of this Manin symbol list. 

 

EXAMPLES:: 

 

sage: eps = DirichletGroup(4).gen(0) 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character 

sage: m = ManinSymbolList_character(eps,2); m 

Manin Symbol List of weight 2 for Gamma1(4) with character [-1] 

sage: m.character() 

Dirichlet character modulo 4 of conductor 4 mapping 3 |--> -1 

 

""" 

return self.__character 

 

def index(self, x): 

""" 

Return the index of a standard Manin symbol equivalent to 

``x``, together with a scaling factor. 

 

INPUT: 

 

- ``x`` -- 3-tuple of integers defining an element of this 

list of Manin symbols, which need not be normalized 

 

OUTPUT: 

 

A pair ``(i, s)`` where ``i`` is the index of the Manin symbol 

equivalent to ``x`` and ``s`` is the scalar (an element of the 

base field). If there is no Manin symbol equivalent to ``x`` 

in the list, then ``(-1, 0)`` is returned. 

 

EXAMPLES:: 

 

sage: eps = DirichletGroup(4).gen(0) 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character 

sage: m = ManinSymbolList_character(eps,4); m 

Manin Symbol List of weight 4 for Gamma1(4) with character [-1] 

sage: [m.index(s.tuple()) for s in m.manin_symbol_list()] 

[(0, 1), 

(1, 1), 

(2, 1), 

(3, 1), 

... 

(16, 1), 

(17, 1)] 

""" 

if x in self._index: 

return self._index[x], 1 

x, s = self.normalize(x) 

try: 

return self._index[x], s 

except KeyError: 

return -1, 0 

 

def normalize(self, x): 

""" 

Return the normalization of the Manin Symbol ``x`` with 

respect to this list, together with the normalizing scalar. 

 

INPUT: 

 

- ``x`` - 3-tuple of integers ``(i,u,v)``, defining an element of this 

list of Manin symbols, which need not be normalized. 

 

OUTPUT: 

 

``((i,u,v),s)``, where ``(i,u,v)`` is the normalized Manin symbol equivalent 

to ``x``, and ``s`` is the normalizing scalar. 

 

EXAMPLES:: 

 

sage: eps = DirichletGroup(4).gen(0) 

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character 

sage: m = ManinSymbolList_character(eps,4); m 

Manin Symbol List of weight 4 for Gamma1(4) with character [-1] 

sage: [m.normalize(s.tuple()) for s in m.manin_symbol_list()] 

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

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

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

... 

((2, 1, 3), 1), 

((2, 2, 1), 1)] 

""" 

u,v,s = self.__P1.normalize_with_scalar(x[1],x[2]) 

return (x[0],u,v), self.__character(s) 

 

 

register_unpickle_override('sage.modular.modsym.manin_symbols', 

'ManinSymbolList', ManinSymbolList) 

register_unpickle_override('sage.modular.modsym.manin_symbols', 

'ManinSymbolList_group', ManinSymbolList_group) 

register_unpickle_override('sage.modular.modsym.manin_symbols', 

'ManinSymbolList_gamma0', ManinSymbolList_gamma0) 

register_unpickle_override('sage.modular.modsym.manin_symbols', 

'ManinSymbolList_gamma1', ManinSymbolList_gamma1) 

register_unpickle_override('sage.modular.modsym.manin_symbols', 

'ManinSymbolList_gamma_h', ManinSymbolList_gamma_h) 

register_unpickle_override('sage.modular.modsym.manin_symbols', 

'ManinSymbolList_character', ManinSymbolList_character)