# HG changeset patch
# User Nicolas M. Thiery <nthiery@users.sf.net>
# Date 1335432132 -7200
# Node ID 6f3208b6c947ac98e66aaed92649dfe82e368583
# Parent 323b129ff1429fb00df8a064f1e60ec59efba50c
#12875: Fix the homset category initialization for ModularAbelianVariety's homspaces
Before the patch, the following was wrong (probably introduced by #9138):
{{{
sage: End(J0(37)).homset_category()
Join of Category of hom sets in Category of sets and Category of rings
}}}
After the patch:
{{{
sage: End(J0(37)).homset_category()
Category of modular abelian varieties over Rational Field
}}}
In both cases, we have, as desired:
{{{
sage: End(J0(37)).category()
Join of Category of hom sets in Category of sets and Category of rings
}}}
By the way, this removes a direct call to _Hom_, using Hom instead.
diff --git a/sage/modular/abvar/abvar.py b/sage/modular/abvar/abvar.py
a
|
b
|
class ModularAbelianVariety_abstract(Par |
590 | 590 | |
591 | 591 | sage: J0(37)._Hom_(J1(37)) |
592 | 592 | Space of homomorphisms from Abelian variety J0(37) of dimension 2 to Abelian variety J1(37) of dimension 40 |
| 593 | sage: J0(37)._Hom_(J1(37)).homset_category() |
| 594 | Category of modular abelian varieties over Rational Field |
593 | 595 | """ |
594 | 596 | if cat is None: |
595 | 597 | K = self.base_field(); L = B.base_field() |
diff --git a/sage/modular/abvar/homspace.py b/sage/modular/abvar/homspace.py
a
|
b
|
import sage.rings.integer_ring |
183 | 183 | import sage.rings.all |
184 | 184 | |
185 | 185 | from sage.rings.ring import Ring |
| 186 | from sage.categories.category import Category |
186 | 187 | from sage.categories.rings import Rings |
187 | 188 | from sage.matrix.matrix_space import MatrixSpace |
188 | 189 | from sage.matrix.constructor import Matrix, identity_matrix |
… |
… |
class EndomorphismSubring(Homspace, Ring |
700 | 701 | Endomorphism ring of Abelian variety J0(23) of dimension 2 |
701 | 702 | sage: sage.modular.abvar.homspace.EndomorphismSubring(J0(25)) |
702 | 703 | Endomorphism ring of Abelian variety J0(25) of dimension 0 |
703 | | sage: type(J0(11).endomorphism_ring()) |
| 704 | sage: E = J0(11).endomorphism_ring() |
| 705 | sage: type(E) |
704 | 706 | <class 'sage.modular.abvar.homspace.EndomorphismSubring_with_category'> |
| 707 | sage: E.category() |
| 708 | Join of Category of hom sets in Category of sets and Category of rings |
| 709 | sage: E.homset_category() |
| 710 | Category of modular abelian varieties over Rational Field |
| 711 | sage: TestSuite(E).run(skip=["_test_elements"]) |
705 | 712 | |
706 | 713 | TESTS: |
707 | 714 | |
… |
… |
class EndomorphismSubring(Homspace, Ring |
716 | 723 | self._A = A |
717 | 724 | |
718 | 725 | # Initialise self with the correct category. |
| 726 | # TODO: a category should be able to specify the appropriate |
| 727 | # category for its endomorphism sets |
719 | 728 | # We need to initialise it as a ring first |
720 | | cat = A.category() |
721 | | cat = cat.join([cat.hom_category(),Rings()]) |
722 | | Ring.__init__(self, A.base_ring(), category=cat) |
723 | | Homspace.__init__(self, A, A, cat=cat) |
| 729 | homset_cat = A.category() |
| 730 | cat = Category.join([homset_cat.hom_category(),Rings()]) |
| 731 | Ring.__init__(self, A.base_ring()) |
| 732 | Homspace.__init__(self, A, A, cat=homset_cat) |
| 733 | self._refine_category_(Rings()) |
724 | 734 | if gens is None: |
725 | 735 | self._gens = None |
726 | 736 | else: |
diff --git a/sage/modular/abvar/morphism.py b/sage/modular/abvar/morphism.py
a
|
b
|
class Morphism(Morphism_abstract, sage.m |
654 | 654 | B = sub.lattice().basis() |
655 | 655 | ims = sum([ (L(b)*self.matrix()).list() for b in B], []) |
656 | 656 | MS = matrix_space.MatrixSpace(self.base_ring(), len(B), self.codomain().rank()) |
657 | | H = sub.Hom(self.codomain(), self.category()) |
| 657 | H = sub.Hom(self.codomain(), self.category_for()) |
658 | 658 | return H(MS(ims)) |
659 | 659 | |
660 | 660 | class DegeneracyMap(Morphism): |
… |
… |
class HeckeOperator(Morphism): |
736 | 736 | sage: J = J0(37) |
737 | 737 | sage: T2 = J.hecke_operator(2); T2 |
738 | 738 | Hecke operator T_2 on Abelian variety J0(37) of dimension 2 |
| 739 | sage: T2.parent() |
| 740 | Endomorphism ring of Abelian variety J0(37) of dimension 2 |
739 | 741 | """ |
740 | 742 | n = ZZ(n) |
741 | 743 | if n <= 0: |
… |
… |
class HeckeOperator(Morphism): |
744 | 746 | raise TypeError, "abvar must be a modular abelian variety" |
745 | 747 | self.__abvar = abvar |
746 | 748 | self.__n = n |
747 | | sage.modules.matrix_morphism.MatrixMorphism_abstract.__init__(self, abvar._Hom_(abvar)) |
| 749 | sage.modules.matrix_morphism.MatrixMorphism_abstract.__init__(self, abvar.Hom(abvar)) |
748 | 750 | |
749 | 751 | def _repr_(self): |
750 | 752 | """ |