Ticket #9944: trac9944_abvar_endomorphism.patch

File trac9944_abvar_endomorphism.patch, 1.7 KB (added by SimonKing, 8 years ago)

Fix a problem with initialisation of endomorphism rings of abelian varieties on 32 bit

  • sage/modular/abvar/homspace.py

    # HG changeset patch
    # User Simon King <simon.king@uni-jena.de>
    # Date 1304688960 -7200
    # Node ID dab5e9f161e510e1b0d54db0e5c8183aac8b72c5
    # Parent  9ef6e3b6921a6ac709117f14b4f99f7c0d800c2e
    #9944: Fix endomorphism ring of abelian varieties on 32 bit machines.
    
    diff --git a/sage/modular/abvar/homspace.py b/sage/modular/abvar/homspace.py
    a b  
    183183import sage.rings.all
    184184
    185185from sage.rings.ring import Ring
     186from sage.categories.rings import Rings
    186187from sage.matrix.matrix_space import MatrixSpace
    187188from sage.matrix.constructor import Matrix, identity_matrix
    188189from sage.structure.element import is_Matrix
     
    701702            Endomorphism ring of Abelian variety J0(25) of dimension 0
    702703            sage: type(J0(11).endomorphism_ring())
    703704            <class 'sage.modular.abvar.homspace.EndomorphismSubring_with_category'>
     705
     706        TESTS:
     707
     708        The following tests against a problem on 32 bit machines that
     709        occured while working on trac ticket #9944::
     710
     711            sage: sage.modular.abvar.homspace.EndomorphismSubring(J1(12345))
     712            Endomorphism ring of Abelian variety J1(12345) of dimension 5405473
     713
    704714        """
    705715        self._J = A.ambient_variety()
    706716        self._A = A
    707         Homspace.__init__(self, A, A, A.category())
    708         Ring.__init__(self, A.base_ring())
    709717
     718        # Initialise self with the correct category.
     719        # 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)
    710724        if gens is None:
    711725            self._gens = None
    712726        else: