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

r""" 

Homology of modular abelian varieties 

 

Sage can compute with homology groups associated to modular abelian 

varieties with coefficients in any commutative ring. Supported 

operations include computing matrices and characteristic 

polynomials of Hecke operators, rank, and rational decomposition as 

a direct sum of factors (obtained by cutting out kernels of Hecke 

operators). 

 

AUTHORS: 

 

- William Stein (2007-03) 

 

EXAMPLES:: 

 

sage: J = J0(43) 

sage: H = J.integral_homology() 

sage: H 

Integral Homology of Abelian variety J0(43) of dimension 3 

sage: H.hecke_matrix(19) 

[ 0 0 -2 0 2 0] 

[ 2 -4 -2 0 2 0] 

[ 0 0 -2 -2 0 0] 

[ 2 0 -2 -4 2 -2] 

[ 0 2 0 -2 -2 0] 

[ 0 2 0 -2 0 0] 

sage: H.base_ring() 

Integer Ring 

sage: d = H.decomposition(); d 

doctest:warning 

... 

DeprecationWarning: The default order on free modules has changed. The old ordering is in sage.modules.free_module.EchelonMatrixKey 

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

[ 

Submodule of rank 2 of Integral Homology of Abelian variety J0(43) of dimension 3, 

Submodule of rank 4 of Integral Homology of Abelian variety J0(43) of dimension 3 

] 

sage: a = d[0] 

sage: a.hecke_matrix(5) 

[-4 0] 

[ 0 -4] 

sage: a.T(7) 

Hecke operator T_7 on Submodule of rank 2 of Integral Homology of Abelian variety J0(43) of dimension 3 

""" 

from __future__ import absolute_import 

 

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

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

# 

# This program is free software: you can redistribute it and/or modify 

# it under the terms of the GNU General Public License as published by 

# the Free Software Foundation, either version 2 of the License, or 

# (at your option) any later version. 

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

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

 

from sage.structure.richcmp import richcmp_method, richcmp, richcmp_not_equal 

from sage.modular.hecke.all import HeckeModule_free_module 

from sage.rings.all import Integer, ZZ, QQ, CommutativeRing 

 

from .abvar import sqrt_poly 

 

# TODO: we will probably also need homology that is *not* a Hecke module. 

 

@richcmp_method 

class Homology(HeckeModule_free_module): 

""" 

A homology group of an abelian variety, equipped with a Hecke 

action. 

""" 

def hecke_polynomial(self, n, var='x'): 

""" 

Return the n-th Hecke polynomial in the given variable. 

 

INPUT: 

 

 

- ``n`` - positive integer 

 

- ``var`` - string (default: 'x') the variable name 

 

 

OUTPUT: a polynomial over ZZ in the given variable 

 

EXAMPLES:: 

 

sage: H = J0(43).integral_homology(); H 

Integral Homology of Abelian variety J0(43) of dimension 3 

sage: f = H.hecke_polynomial(3); f 

x^6 + 4*x^5 - 16*x^3 - 12*x^2 + 16*x + 16 

sage: parent(f) 

Univariate Polynomial Ring in x over Integer Ring 

sage: H.hecke_polynomial(3,'w') 

w^6 + 4*w^5 - 16*w^3 - 12*w^2 + 16*w + 16 

""" 

return self.hecke_matrix(n).charpoly(var) 

 

 

class Homology_abvar(Homology): 

""" 

The homology of a modular abelian variety. 

""" 

def __init__(self, abvar, base): 

""" 

This is an abstract base class, so it is called implicitly in the 

following examples. 

 

EXAMPLES:: 

 

sage: H = J0(43).integral_homology() 

sage: type(H) 

<class 'sage.modular.abvar.homology.IntegralHomology_with_category'> 

 

TESTS:: 

 

sage: H = J0(43).integral_homology() 

sage: loads(dumps(H)) == H 

True 

""" 

if not isinstance(base, CommutativeRing): 

raise TypeError("base ring must be a commutative ring") 

HeckeModule_free_module.__init__( 

self, base, abvar.level(), weight=2) 

self.__abvar = abvar 

 

def __richcmp__(self, other, op): 

r""" 

Compare ``self`` to ``other``. 

 

EXAMPLES:: 

 

sage: J0(37).integral_homology() == J0(41).integral_homology() 

False 

sage: J0(37).integral_homology() == J0(37).rational_homology() 

False 

sage: J0(37).integral_homology() == loads(dumps(J0(37).integral_homology())) 

True 

""" 

if not isinstance(other, Homology_abvar): 

return NotImplemented 

else: 

return richcmp((self.abelian_variety(), self.base_ring()), 

(other.abelian_variety(), other.base_ring()), op) 

 

def _repr_(self): 

""" 

Return string representation of self. This must be defined in the 

derived class. 

 

EXAMPLES:: 

 

sage: H = J0(43).integral_homology() 

sage: from sage.modular.abvar.homology import Homology_abvar 

sage: Homology_abvar._repr_(H) 

Traceback (most recent call last): 

... 

NotImplementedError: please override this in the derived class 

""" 

raise NotImplementedError("please override this in the derived class") 

 

def gens(self): 

""" 

Return generators of self. 

 

This is not yet implemented! 

 

EXAMPLES:: 

 

sage: H = J0(37).homology() 

sage: H.gens() # this will change 

Traceback (most recent call last): 

... 

NotImplementedError: homology classes not yet implemented 

""" 

raise NotImplementedError("homology classes not yet implemented") 

 

def gen(self, n): 

""" 

Return `n^{th}` generator of self. 

 

This is not yet implemented! 

 

EXAMPLES:: 

 

sage: H = J0(37).homology() 

sage: H.gen(0) # this will change 

Traceback (most recent call last): 

... 

NotImplementedError: homology classes not yet implemented 

""" 

raise NotImplementedError("homology classes not yet implemented") 

 

def abelian_variety(self): 

""" 

Return the abelian variety that this is the homology of. 

 

EXAMPLES:: 

 

sage: H = J0(48).homology() 

sage: H.abelian_variety() 

Abelian variety J0(48) of dimension 3 

""" 

return self.__abvar 

 

def ambient_hecke_module(self): 

""" 

Return the ambient Hecke module that this homology is contained 

in. 

 

EXAMPLES:: 

 

sage: H = J0(48).homology(); H 

Integral Homology of Abelian variety J0(48) of dimension 3 

sage: H.ambient_hecke_module() 

Integral Homology of Abelian variety J0(48) of dimension 3 

""" 

return self 

 

def free_module(self): 

""" 

Return the underlying free module of this homology group. 

 

EXAMPLES:: 

 

sage: H = J0(48).homology() 

sage: H.free_module() 

Ambient free module of rank 6 over the principal ideal domain Integer Ring 

""" 

try: 

return self.__free_module 

except AttributeError: 

M = self.base_ring()**self.rank() 

self.__free_module = M 

return M 

 

def hecke_bound(self): 

r""" 

Return bound on the number of Hecke operators needed to generate 

the Hecke algebra as a `\ZZ`-module acting on this 

space. 

 

EXAMPLES:: 

 

sage: J0(48).homology().hecke_bound() 

16 

sage: J1(15).homology().hecke_bound() 

32 

""" 

return self.__abvar.modular_symbols(sign=1).hecke_bound() 

 

def hecke_matrix(self, n): 

""" 

Return the matrix of the n-th Hecke operator acting on this 

homology group. 

 

INPUT: 

 

 

- ``n`` - a positive integer 

 

 

OUTPUT: a matrix over the coefficient ring of this homology group 

 

EXAMPLES:: 

 

sage: H = J0(23).integral_homology() 

sage: H.hecke_matrix(3) 

[-1 -2 2 0] 

[ 0 -3 2 -2] 

[ 2 -4 3 -2] 

[ 2 -2 0 1] 

 

The matrix is over the coefficient ring:: 

 

sage: J = J0(23) 

sage: J.homology(QQ[I]).hecke_matrix(3).parent() 

Full MatrixSpace of 4 by 4 dense matrices over Number Field in I with defining polynomial x^2 + 1 

""" 

raise NotImplementedError 

 

def rank(self): 

""" 

Return the rank as a module or vector space of this homology 

group. 

 

EXAMPLES:: 

 

sage: H = J0(5077).homology(); H 

Integral Homology of Abelian variety J0(5077) of dimension 422 

sage: H.rank() 

844 

""" 

return self.__abvar.dimension() * 2 

 

def submodule(self, U, check=True): 

r""" 

Return the submodule of this homology group given by `U`, 

which should be a submodule of the free module associated to this 

homology group. 

 

INPUT: 

 

 

- ``U`` - submodule of ambient free module (or 

something that defines one) 

 

- ``check`` - currently ignored. 

 

 

.. note:: 

 

We do *not* check that U is invariant under all Hecke 

operators. 

 

EXAMPLES:: 

 

sage: H = J0(23).homology(); H 

Integral Homology of Abelian variety J0(23) of dimension 2 

sage: F = H.free_module() 

sage: U = F.span([[1,2,3,4]]) 

sage: M = H.submodule(U); M 

Submodule of rank 1 of Integral Homology of Abelian variety J0(23) of dimension 2 

 

Note that the submodule command doesn't actually check that the 

object defined is a homology group or is invariant under the Hecke 

operators. For example, the fairly random `M` that we just 

defined is not invariant under the Hecke operators, so it is not a 

Hecke submodule - it is only a `\ZZ`-submodule. 

 

:: 

 

sage: M.hecke_matrix(3) 

Traceback (most recent call last): 

... 

ArithmeticError: subspace is not invariant under matrix 

""" 

return Homology_submodule(self, U) 

 

 

class IntegralHomology(Homology_abvar): 

r""" 

The integral homology `H_1(A,\ZZ)` of a modular 

abelian variety. 

""" 

def __init__(self, abvar): 

""" 

Create the integral homology of a modular abelian variety. 

 

INPUT: 

 

 

- ``abvar`` - a modular abelian variety 

 

 

EXAMPLES:: 

 

sage: H = J0(23).integral_homology(); H 

Integral Homology of Abelian variety J0(23) of dimension 2 

sage: type(H) 

<class 'sage.modular.abvar.homology.IntegralHomology_with_category'> 

 

TESTS:: 

 

sage: loads(dumps(H)) == H 

True 

""" 

Homology_abvar.__init__(self, abvar, ZZ) 

 

def _repr_(self): 

""" 

String representation of the integral homology. 

 

EXAMPLES:: 

 

sage: J0(23).integral_homology()._repr_() 

'Integral Homology of Abelian variety J0(23) of dimension 2' 

""" 

return "Integral Homology of %s"%self.abelian_variety() 

 

def hecke_matrix(self, n): 

""" 

Return the matrix of the n-th Hecke operator acting on this 

homology group. 

 

EXAMPLES:: 

 

sage: J0(48).integral_homology().hecke_bound() 

16 

sage: t = J1(13).integral_homology().hecke_matrix(3); t 

[ 0 0 2 -2] 

[-2 -2 0 2] 

[-2 -2 0 0] 

[ 0 -2 2 -2] 

sage: t.base_ring() 

Integer Ring 

""" 

n = Integer(n) 

return self.abelian_variety()._integral_hecke_matrix(n) 

 

def hecke_polynomial(self, n, var='x'): 

""" 

Return the n-th Hecke polynomial on this integral homology group. 

 

EXAMPLES:: 

 

sage: f = J0(43).integral_homology().hecke_polynomial(2) 

sage: f.base_ring() 

Integer Ring 

sage: factor(f) 

(x + 2)^2 * (x^2 - 2)^2 

""" 

n = Integer(n) 

M = self.abelian_variety().modular_symbols(sign=1) 

f = (M.hecke_polynomial(n, var)**2).change_ring(ZZ) 

return f 

 

class RationalHomology(Homology_abvar): 

r""" 

The rational homology `H_1(A,\QQ)` of a modular 

abelian variety. 

""" 

def __init__(self, abvar): 

""" 

Create the rational homology of a modular abelian variety. 

 

INPUT: 

 

 

- ``abvar`` - a modular abelian variety 

 

 

EXAMPLES:: 

 

sage: H = J0(23).rational_homology(); H 

Rational Homology of Abelian variety J0(23) of dimension 2 

 

TESTS:: 

 

sage: loads(dumps(H)) == H 

True 

""" 

Homology_abvar.__init__(self, abvar, QQ) 

 

def _repr_(self): 

""" 

Return string representation of the rational homology. 

 

EXAMPLES:: 

 

sage: J0(23).rational_homology()._repr_() 

'Rational Homology of Abelian variety J0(23) of dimension 2' 

""" 

return "Rational Homology of %s"%self.abelian_variety() 

 

def hecke_matrix(self, n): 

""" 

Return the matrix of the n-th Hecke operator acting on this 

homology group. 

 

EXAMPLES:: 

 

sage: t = J1(13).homology(QQ).hecke_matrix(3); t 

[ 0 0 2 -2] 

[-2 -2 0 2] 

[-2 -2 0 0] 

[ 0 -2 2 -2] 

sage: t.base_ring() 

Rational Field 

sage: t = J1(13).homology(GF(3)).hecke_matrix(3); t 

[0 0 2 1] 

[1 1 0 2] 

[1 1 0 0] 

[0 1 2 1] 

sage: t.base_ring() 

Finite Field of size 3 

""" 

n = Integer(n) 

return self.abelian_variety()._rational_hecke_matrix(n) 

 

def hecke_polynomial(self, n, var='x'): 

""" 

Return the n-th Hecke polynomial on this rational homology group. 

 

EXAMPLES:: 

 

sage: f = J0(43).rational_homology().hecke_polynomial(2) 

sage: f.base_ring() 

Rational Field 

sage: factor(f) 

(x + 2) * (x^2 - 2) 

""" 

f = self.hecke_operator(n).matrix().characteristic_polynomial(var) 

return sqrt_poly(f) 

 

#n = Integer(n) 

#M = self.abelian_variety().modular_symbols(sign=1) 

#f = M.hecke_polynomial(n, var)**2 

#return f 

 

 

class Homology_over_base(Homology_abvar): 

r""" 

The homology over a modular abelian variety over an arbitrary base 

commutative ring (not `\ZZ` or 

`\QQ`). 

""" 

def __init__(self, abvar, base_ring): 

r""" 

Called when creating homology with coefficients not 

`\ZZ` or `\QQ`. 

 

INPUT: 

 

 

- ``abvar`` - a modular abelian variety 

 

- ``base_ring`` - a commutative ring 

 

 

EXAMPLES:: 

 

sage: H = J0(23).homology(GF(5)); H 

Homology with coefficients in Finite Field of size 5 of Abelian variety J0(23) of dimension 2 

sage: type(H) 

<class 'sage.modular.abvar.homology.Homology_over_base_with_category'> 

 

TESTS:: 

 

sage: loads(dumps(H)) == H 

True 

""" 

Homology_abvar.__init__(self, abvar, base_ring) 

 

def _repr_(self): 

""" 

Return string representation of self. 

 

EXAMPLES:: 

 

sage: H = J0(23).homology(GF(5)) 

sage: H._repr_() 

'Homology with coefficients in Finite Field of size 5 of Abelian variety J0(23) of dimension 2' 

""" 

return "Homology with coefficients in %s of %s"%(self.base_ring(), self.abelian_variety()) 

 

def hecke_matrix(self, n): 

""" 

Return the matrix of the n-th Hecke operator acting on this 

homology group. 

 

EXAMPLES:: 

 

sage: t = J1(13).homology(GF(3)).hecke_matrix(3); t 

[0 0 2 1] 

[1 1 0 2] 

[1 1 0 0] 

[0 1 2 1] 

sage: t.base_ring() 

Finite Field of size 3 

""" 

n = Integer(n) 

return self.abelian_variety()._integral_hecke_matrix(n).change_ring(self.base_ring()) 

 

 

class Homology_submodule(Homology): 

""" 

A submodule of the homology of a modular abelian variety. 

""" 

def __init__(self, ambient, submodule): 

""" 

Create a submodule of the homology of a modular abelian variety. 

 

INPUT: 

 

 

- ``ambient`` - the homology of some modular abelian 

variety with ring coefficients 

 

- ``submodule`` - a submodule of the free module 

underlying ambient 

 

 

EXAMPLES:: 

 

sage: H = J0(37).homology() 

sage: H.submodule([[1,0,0,0]]) 

Submodule of rank 1 of Integral Homology of Abelian variety J0(37) of dimension 2 

 

TESTS:: 

 

sage: loads(dumps(H)) == H 

True 

""" 

if not isinstance(ambient, Homology_abvar): 

raise TypeError("ambient must be the homology of a modular abelian variety") 

self.__ambient = ambient 

#try: 

# if not submodule.is_submodule(ambient): 

# raise ValueError, "submodule must be a submodule of the ambient homology group" 

#except AttributeError: 

submodule = ambient.free_module().submodule(submodule) 

self.__submodule = submodule 

HeckeModule_free_module.__init__( 

self, ambient.base_ring(), ambient.level(), weight=2) 

 

def _repr_(self): 

""" 

String representation of this submodule of homology. 

 

EXAMPLES:: 

 

sage: H = J0(37).homology() 

sage: G = H.submodule([[1, 2, 3, 4]]) 

sage: G._repr_() 

'Submodule of rank 1 of Integral Homology of Abelian variety J0(37) of dimension 2' 

""" 

return "Submodule of rank %s of %s" % (self.rank(), self.__ambient) 

 

def __richcmp__(self, other, op): 

r""" 

Compare ``self`` to ``other``. 

 

EXAMPLES:: 

 

sage: J0(37).homology().decomposition() # indirect doctest 

[ 

Submodule of rank 2 of Integral Homology of Abelian variety J0(37) of dimension 2, 

Submodule of rank 2 of Integral Homology of Abelian variety J0(37) of dimension 2 

] 

""" 

if not isinstance(other, Homology_submodule): 

return NotImplemented 

lx = self.__ambient 

rx = other.__ambient 

if lx != rx: 

return richcmp_not_equal(lx, rx, op) 

return richcmp(self.__submodule, other.__submodule, op) 

 

def ambient_hecke_module(self): 

""" 

Return the ambient Hecke module that this homology is contained 

in. 

 

EXAMPLES:: 

 

sage: H = J0(48).homology(); H 

Integral Homology of Abelian variety J0(48) of dimension 3 

sage: d = H.decomposition(); d 

[ 

Submodule of rank 2 of Integral Homology of Abelian variety J0(48) of dimension 3, 

Submodule of rank 4 of Integral Homology of Abelian variety J0(48) of dimension 3 

] 

sage: d[0].ambient_hecke_module() 

Integral Homology of Abelian variety J0(48) of dimension 3 

""" 

return self.__ambient 

 

def free_module(self): 

""" 

Return the underlying free module of the homology group. 

 

EXAMPLES:: 

 

sage: H = J0(48).homology() 

sage: K = H.decomposition()[1]; K 

Submodule of rank 4 of Integral Homology of Abelian variety J0(48) of dimension 3 

sage: K.free_module() 

Free module of degree 6 and rank 4 over Integer Ring 

Echelon basis matrix: 

[ 1 0 0 0 0 0] 

[ 0 1 0 0 1 -1] 

[ 0 0 1 0 -1 1] 

[ 0 0 0 1 0 -1] 

""" 

return self.__submodule 

 

def hecke_bound(self): 

""" 

Return a bound on the number of Hecke operators needed to generate 

the Hecke algebra acting on this homology group. 

 

EXAMPLES:: 

 

sage: d = J0(43).homology().decomposition(2); d 

[ 

Submodule of rank 2 of Integral Homology of Abelian variety J0(43) of dimension 3, 

Submodule of rank 4 of Integral Homology of Abelian variety J0(43) of dimension 3 

] 

 

Because the first factor has dimension 2 it corresponds to an 

elliptic curve, so we have a Hecke bound of 1. 

 

:: 

 

sage: d[0].hecke_bound() 

1 

sage: d[1].hecke_bound() 

8 

""" 

if self.rank() <= 2: 

return ZZ(1) 

else: 

return self.__ambient.hecke_bound() 

 

def hecke_matrix(self, n): 

""" 

Return the matrix of the n-th Hecke operator acting on this 

homology group. 

 

EXAMPLES:: 

 

sage: d = J0(125).homology(GF(17)).decomposition(2); d 

[ 

Submodule of rank 4 of Homology with coefficients in Finite Field of size 17 of Abelian variety J0(125) of dimension 8, 

Submodule of rank 4 of Homology with coefficients in Finite Field of size 17 of Abelian variety J0(125) of dimension 8, 

Submodule of rank 8 of Homology with coefficients in Finite Field of size 17 of Abelian variety J0(125) of dimension 8 

] 

sage: t = d[0].hecke_matrix(17); t 

[16 15 15 0] 

[ 0 5 0 2] 

[ 2 0 5 15] 

[ 0 15 0 16] 

sage: t.base_ring() 

Finite Field of size 17 

sage: t.fcp() 

(x^2 + 13*x + 16)^2 

""" 

n = Integer(n) 

try: 

return self.__hecke_matrix[n] 

except AttributeError: 

self.__hecke_matrix = {} 

except KeyError: 

pass 

t = self.__ambient.hecke_matrix(n) 

s = t.restrict(self.__submodule) 

self.__hecke_matrix[n] = s 

return s 

 

def rank(self): 

""" 

Return the rank of this homology group. 

 

EXAMPLES:: 

 

sage: d = J0(43).homology().decomposition(2) 

sage: [H.rank() for H in d] 

[2, 4] 

""" 

return self.__submodule.rank()