Ticket #9894: cohomology-pkg.diff

File cohomology-pkg.diff, 17.0 KB (added by SimonKing, 10 years ago)

Diff of the latest changes in the spkg. For reviewing only

  • SPKG.txt

    # HG changeset patch
    # User Simon King <simon.king@uni-jena.de>
    # Date 1333064883 -7200
    # Node ID 4cacfb3469e92c74810dd31e48ca5822866b507f
    # Parent  377993cb31d6c37b7a595437c07eb0229cc10fa8
    Consider useSlimgb/useStd in various places. Improve construction of parameters
    for the Symonds test. Change the docs accordingly.
    
    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    120120    - Using the coercion framework in a better way.
    121121    - Small improvements in the MeatAxe code.
    122122    - Include the docs in the spkg.
     123    - Improved construction of dependent parameters for Symonds' test.
    123124  * 2.1.1 (Simon King, September 2010):
    124125    - Cohomology data are now by default only created in the private
    125126      database.
  • src/pGroupCohomology/__init__.py

    diff --git a/src/pGroupCohomology/__init__.py b/src/pGroupCohomology/__init__.py
    a b  
    17501750    sage: H.suffDeg=-1
    17511751    sage: H.option('prot')
    17521752    sage: H.test_for_completion()
     1753        Try to find a set of generators over which the ring is finite.
     1754          > Considering 10 elements
     1755          > Considering 9 elements
     1756          > Considering 9 elements
     1757          > Considering 8 elements
     1758          > Considering 7 elements
     1759          > Considering 6 elements
     1760          > Considering 5 elements
     1761          > Considering 5 elements
     1762          > Considering 5 elements
    17531763        Trying Symonds' criterion for H^*(SmallGroup(64,32); GF(2))
    17541764        Successful application of the Symonds criterion
    17551765    True
     
    21062116
    21072117    sage: HS8.option('prot')
    21082118    sage: HS8.HilbertPoincareTest()
     2119    Try to find small parameters
    21092120    We expect that the Hilbert-Poincare criterion will not apply before degree 20
    21102121    sage: HS8.WhatFRS
    21112122    sage: HS8.option('noprot')
  • src/pGroupCohomology/cohomology.pyx

    diff --git a/src/pGroupCohomology/cohomology.pyx b/src/pGroupCohomology/cohomology.pyx
    a b  
    618618            S[j+1] = L[j]
    619619    counter = 0
    620620    poly_tmp = singular.poly(0)
     621    gb_command = "groebner" # todo: allow to choose between slimgb, std, groebner
    621622    try:
    622623        # again, std(..,..) is buggy. Avoid it!
    623         if good_singular_version and (int(singular('%s(groebner(%s+%s))'%('dim' if p==2 else 'GKdim',Id.name(),S.name()))) >= d0):
     624        if good_singular_version and (int(singular('%s(%s(%s+%s))'%('dim' if p==2 else 'GKdim',gb_command, Id.name(),S.name()))) >= d0):
    624625            return False,False
    625626        # S might be by far too long. So, try to eliminate
    626627        # some of its elements.
     
    632633                singular.eval('%s=%s[%d]'%(poly_tmp.name(),S.name(),j))
    633634                singular.eval('%s[%d]=0'%(S.name(),j))
    634635                # std(...,...) is buggy
    635                 if int(singular('%s(groebner(%s+%s))'%('dim' if p==2 else 'GKdim',Id.name(),S.name()))) >= d0:
     636                if int(singular('%s(%s(%s+%s))'%('dim' if p==2 else 'GKdim', gb_command, Id.name(),S.name()))) >= d0:
    636637                    singular.eval('%s[%d]=%s'%(S.name(),j,poly_tmp.name()))
    637638                else:
    638639                    Kicked.append(j-1)
     
    658659            counter +=1
    659660            # Did we find something?
    660661            if good_singular_version:
    661                 if int(singular.eval('%s(groebner(%s+ideal(%s[1][1])))'%('dim' if p==2 else 'GKdim',Id.name(),vp.name())))<d0:
     662                if int(singular.eval('%s(%s(%s+ideal(%s[1][1])))'%('dim' if p==2 else 'GKdim',gb_command,Id.name(),vp.name())))<d0:
    662663                    #     getattr(Id.std(vp.name()+'[1][1]'),'dim' if p==2 else 'GKdim')()) < d0:
    663664                    print_protocol("We found a parameter.")
    664665                    if regularity==1:
     
    18531854        :::     Express cochain of degree 2 as polynomial
    18541855        :::     Express cochain of degree 1 as polynomial
    18551856        :::     Express cochain of degree 1 as polynomial
     1857            Try to find a set of generators over which the ring is finite.
    18561858            Computing complete Groebner basis for H^*(D8; GF(2))
    18571859        Time for computing Groebner basis
    1858            Wall: ...
     1860           Wall: 0.00
     1861              > Considering 2 elements
    18591862            Trying Symonds' criterion for H^*(D8; GF(2))
    18601863            Successful application of the Symonds criterion
    18611864            Computation of H^*(D8; GF(2)) is finished
     
    53995402                <li> We used the following parameters for the Symonds criterion:
    54005403                </li>
    54015404                <ol>
    5402                   <li><nobr>c_2_2</nobr>, an element of degree 2
     5405                  <li><nobr>b_1_0</nobr>, an element of degree 1
    54035406                  </li>
    54045407                  <li><nobr>b_1_1</nobr>, an element of degree 1
    54055408                  </li>
    5406                   <li><nobr>b_1_0</nobr>, an element of degree 1
     5409                  <li><nobr>c_2_2</nobr>, an element of degree 2
    54075410                  </li>
    54085411                </ol>
    54095412                </li>    <li> As a module over these parameters, the cohomology is generated in degree at most 0.
     
    81758178        R = singular('basering')
    81768179        cdef list L
    81778180        print_protocol("Testing whether parameters of the cohomology ring can be found")
     8181        if self.useSlimgb:
     8182            gb_command = "slimgb"
     8183        elif self.useStd:
     8184            gb_command = "std"
     8185        else:
     8186            gb_command = "groebner"
    81788187        for i in self.MaxelPos:
    81798188            L = self.restrictions_as_string(i)
    81808189            self.RestrMaps[i][1].codomain().set_ring()
    8181             if singular.eval('vdim(groebner(ideal(%s)))'%','.join(L))=='-1':
     8190            if singular.eval('vdim(%s(ideal(%s)))'%(gb_command,','.join(L)))=='-1':
    81828191                return False
    81838192        self.setprop('_parameters_do_exist',True)
    81848193        return True
     
    83288337        i = start_deg
    83298338        from pGroupCohomology.resolution import OPTION
    83308339        cdef int BreakPoint = OPTION.opts.get('NrCandidates',512)
     8340        if self.useSlimgb:
     8341            gb_command = "slimgb"
     8342        elif self.useStd:
     8343            gb_command = "std"
     8344        else:
     8345            gb_command = "groebner"
    83318346        try:
    83328347            dgb = singular.eval('degBound')
    83338348            singular.eval('degBound=0')
     
    83368351            print_protocol("> Killing all parameters but the last")
    83378352            # the following hits a bug in singular-3-1-1
    83388353            #I = I.std(singular.ideal(Par[:-1] or 0).groebner())
    8339             singular.eval('%s=groebner(%s+ideal(%s))'%(I.name(),I.name(),','.join(Par[:-1] or ['0'])))
     8354            singular.eval('%s=%s(%s+ideal(%s))'%(I.name(),gb_command,I.name(),','.join(Par[:-1] or ['0'])))
    83408355            if isinstance(Par[-1],basestring):
    83418356                maxdeg = int(singular.eval('deg(%s)'%Par[-1]))-1
    83428357            else:
     
    83708385                counter = 0
    83718386                try:
    83728387                    # again, std(..,..) is buggy. Avoid it!
    8373                     if int(singular.eval('vdim(groebner(%s+%s))'%(I.name(),S.name()))) >= 0:
     8388                    if int(singular.eval('vdim(%s(%s+%s))'%(gb_command,I.name(),S.name()))) >= 0:
    83748389                        # S might be by far too long. So, try to eliminate
    83758390                        # some of its elements.
    83768391                        for j from 1 <=j <=lenL:
    83778392                            singular.eval('%s=%s[%d]'%(poly_tmp.name(),S.name(),j))
    83788393                            singular.eval('%s[%d]=0'%(S.name(),j))
    83798394                            # std(...,...) is buggy
    8380                             if int(singular.eval('vdim(groebner(%s+%s))'%(I.name(),S.name()))) == -1:
     8395                            if int(singular.eval('vdim(%s(%s+%s))'%(gb_command,I.name(),S.name()))) == -1:
    83818396                                singular.eval('%s[%d]=%s'%(S.name(),j,poly_tmp.name()))
    83828397                        singular.eval('%s=simplify(%s,2)'%(S.name(),S.name()))
    83838398                        lenL = int(singular.eval('size(%s)'%S.name()))
     
    84938508
    84948509        """
    84958510        from pGroupCohomology.modular_cohomology import MODCOHO
     8511        print_protocol("Try to find small parameters")
    84968512        if isinstance(self,MODCOHO):
    84978513            P = self.parameters_from_sylow_subgroup()
    84988514            if P is not None:
     
    87598775        ## try to simplify, by killing nilpotent generators
    87608776        dgb = singular.eval('degBound')
    87618777        singular.eval('degBound=%d'%mdeg)
    8762        
     8778        if self.useSlimgb:
     8779            gb_command = "slimgb"
     8780        elif self.useStd:
     8781            gb_command = "std"
     8782        else:
     8783            gb_command = "groebner"
    87638784        if s!='0':
    87648785            try:
    87658786                print_protocol("Exploring factors by enumeration (can be interrupted with Ctrl-c)",self.Resl.getindent())
     
    87688789                I = singular(self.prefix+'I')
    87698790                if [X.name() for X in self.Gen if X.ydeg()]:
    87708791                    # std(...,...) is buggy. Avoid it!
    8771                     singular.eval('%s=groebner(%s+ideal(%s))'%(I.name(),I.name(),','.join([X.name() for X in self.Gen if X.ydeg()])))
     8792                    singular.eval('%s=%s(%s+ideal(%s))'%(I.name(),gb_command,I.name(),','.join([X.name() for X in self.Gen if X.ydeg()])))
    87728793                for i from 1<=i<=mdeg:
    87738794                    L = [t for t in self.standard_monomials(i) if singular('%s/%s!=0'%(poly.name(),t))]
    87748795                    lenL = len(L)
     
    88348855
    88358856        There is no guarantee that they give rise to parameters for
    88368857        the cohomology ring. There is no guarantee that the returned
    8837         elements are algebraically independent.
     8858        elements are algebraically independent. Since elements of
     8859        degree one do not contribute to the degree bound in Symonds'
     8860        completeness criterion, we always include the degree one
     8861        generators.
    88388862
    88398863        This method is applied for the Symonds test (see
    88408864        :meth:`SymondsTest`).
     
    88478871            sage: H = CohomologyRing(32,32, from_scratch=True)
    88488872            sage: H.make(2)
    88498873
    8850         It may surprise that an empty list is supposed to provide
    8851         parameters, but actually it is correct, as the current ring
    8852         approximation is finite modulo those generators that will,
     8874        It may surprise that a list of nilpotent generators is supposed
     8875        to provide parameters, but actually it is correct, as the current
     8876        ring approximation is finite modulo those generators that will,
    88538877        in higher approximation, be nilpotent::
    88548878
    88558879            sage: H.verify_parameters_exist()
    88568880            False
    88578881            sage: H.dependent_parameters()
    8858             []
     8882            ['a_1_0', 'a_1_1', 'a_1_2']
    88598883            sage: print H
    88608884            Cohomology ring of Small Group number 32 of order 32 with coefficients in GF(2)
    88618885            <BLANKLINE>
     
    88978921            sage: H.verify_parameters_exist()
    88988922            True
    88998923            sage: H.dependent_parameters()
    8900             ['c_4_5', 'c_4_4']
     8924            ['a_1_0', 'a_1_1', 'a_1_2', 'c_4_5', 'c_4_4']
    89018925            sage: print H
    89028926            Cohomology ring of Small Group number 32 of order 32 with coefficients in GF(2)
    89038927            <BLANKLINE>
     
    89198943             a_1_2*a_3_3+a_1_1*a_3_3+a_1_0*a_3_2]
    89208944
    89218945        """
    8922         P = [t.name() for t in sorted([x for x in self.Gen if not x.ydeg()])]
    8923         Ess = []
     8946        print_protocol("Try to find a set of generators over which the ring is finite.")
     8947        P = [t.name() for t in sorted([x for x in self.Gen if (not x.ydeg()) and x.deg()>1])]
     8948        Ess = [t.name() for t in self.Gen if t.deg()==1]
    89248949        self.make_groebner()
    89258950        self.set_ring()
    89268951        I = self.relation_ideal()
     
    89288953        p = self._prime or self.Resl.coef()
    89298954        # we need at least Singular version 3-1-1 in order
    89308955        # to use GKdim
     8956        if self.useSlimgb:
     8957            gb_command = "slimgb"
     8958        elif self.useStd:
     8959            gb_command = "std"
     8960        else:
     8961            gb_command = "groebner"
    89318962        while P:
     8963            print_protocol("  > Considering %d elements"%(len(P)+len(Ess)-1))
    89328964            x = P.pop(-1)
    89338965            if self._good_singular_version:
    8934                 if singular('%s(groebner(%s+ideal(%s)))'%('dim' if p==2 else 'GKdim',I.name(),','.join(Ess+P)))>0:
     8966                if singular('%s(%s(%s+ideal(%s)))'%('dim' if p==2 else 'GKdim',gb_command,I.name(),','.join(Ess+P)))>0:
    89358967                    Ess.append(x)
    89368968            else:
    8937                 if singular('vdim(groebner(%s+ideal(%s)))==-1'%(I.name(),','.join(Ess+P))):
     8969                if singular('vdim(%s(%s+ideal(%s)))==-1'%(gb_command,I.name(),','.join(Ess+P))):
    89388970                    Ess.append(x)
    89398971        return Ess
    89408972
     
    94719503        singular.eval('attrib(%s,"isSB",1)'%I.name())
    94729504        P = self.filter_regular_parameters()
    94739505        d = 0
     9506        if self.useSlimgb:
     9507            gb_command = "slimgb"
     9508        elif self.useStd:
     9509            gb_command = "std"
     9510        else:
     9511            gb_command = "groebner"
    94749512        for p in P:
    94759513            if singular.eval('is_regular(%s,%s)'%(p,I.name()))=='1':
    94769514                d+=1
    94779515                if p!=P[-1]:
    9478                     singular.eval('%s=groebner(%s+ideal(%s))'%(I.name(),I.name(),p))
     9516                    singular.eval('%s=%s(%s+ideal(%s))'%(I.name(),gb_command,I.name(),p))
    94799517            else:
    94809518                break
    94819519        singular.eval('degBound='+dgb)
     
    1030310341            ['c_2_2', 'c_2_3', 'b_1_1']
    1030410342            sage: H64.option('prot')
    1030510343            sage: H64.test_for_completion()
     10344                Try to find a set of generators over which the ring is finite.
     10345                  > Considering 3 elements
     10346                  > Considering 3 elements
    1030610347                Trying Symonds' criterion for H^*(SmallGroup(64,6); GF(2))
    1030710348                Successful application of the Symonds criterion
    1030810349            True
     
    1033310374            sage: H81.parameters()
    1033410375            ['c_6_8', 'b_4_5-b_2_4^2-b_2_3^2']
    1033510376            sage: H81.dependent_parameters()
    10336             ['c_6_8', 'b_2_4', 'b_2_3']
     10377            ['a_1_0', 'a_1_1', 'a_1_2', 'c_6_8', 'b_2_4', 'b_2_3']
    1033710378            sage: H81.option('prot')
    1033810379            sage: H81.test_for_completion()
    1033910380            Trying Symonds' criterion for H^*(E27*C9; GF(3))
     
    1100211043        # Unfortunately, the following hits a bug in
    1100311044        # singular-3-1-1
    1100411045        #I = singular('std(%sI,groebner(ideal(%s)))'%(self.prefix,','.join(hsop)))
    11005         I = singular('groebner(%sI+ideal(%s))'%(self.prefix,','.join(hsop)))
     11046        if self.useSlimgb:
     11047            gb_command = "slimgb"
     11048        elif self.useStd:
     11049            gb_command = "std"
     11050        else:
     11051            gb_command = "groebner"
     11052        I = singular('%s(%sI+ideal(%s))'%(gb_command, self.prefix,','.join(hsop)))
    1100611053        if singular.eval('vdim(%s)'%I.name())=='-1':
    1100711054            print_protocol("The approximation of %s is not finite over the given parameters"%repr(self))
    1100811055            return False
  • src/pGroupCohomology/modular_cohomology.pyx

    diff --git a/src/pGroupCohomology/modular_cohomology.pyx b/src/pGroupCohomology/modular_cohomology.pyx
    a b  
    22632263            sage: H.next()
    22642264            sage: H.option('prot')
    22652265            sage: H.test_for_completion()
     2266            Try to find a set of generators over which the ring is finite.
    22662267            Computing complete Groebner basis for H^*(M11; GF(2))
     2268              > Considering 2 elements
     2269              > Considering 1 elements
     2270              > Considering 1 elements
    22672271            Trying Symonds' criterion for H^*(M11; GF(2))
    22682272            Successful application of the Symonds criterion
    22692273            True
     
    24122416        algebraically dependent parameters --- but without success::
    24132417
    24142418            sage: H.dependent_parameters()
    2415             ['c_6_4', 'b_4_0', 'b_4_2', 'b_2_0']
     2419            ['a_1_0', 'c_6_4', 'b_4_0', 'b_4_2', 'b_2_0']
    24162420
    24172421        We proceed to the next degree. In order to avoid the automatic
    24182422        application of a completeness criterion, we use the method
     
    24432447
    24442448        Using algebraically dependent parameters would allow to use
    24452449        the Symonds criterion (:meth:`~pGroupCohomology.cohomology.COHO.SymondsTest`)
    2446         only in degree `6+4+4+2 -4+1 = 13`::
     2450        only in degree `1+6+4+4+2 -5+1 = 13`::
    24472451
    24482452            sage: H.dependent_parameters()
    2449             ['c_6_4', 'b_4_0', 'b_4_2', 'b_2_0']
     2453            ['a_1_0', 'c_6_4', 'b_4_0', 'b_4_2', 'b_2_0']
    24502454
    24512455        Nevertheless, the Hilbert-Poincare criterion detects completeness
    24522456        in degree 10, since it can use parameters that are not filter regular
     
    37763780            sage: H.completed
    37773781            False
    37783782            sage: H.test_for_completion()
     3783            Try to find a set of generators over which the ring is finite.
    37793784            Computing complete Groebner basis for H^*(SmallGroup(720,763); GF(2))
     3785              > Considering 3 elements
     3786              > Considering 3 elements
     3787              > Considering 3 elements
    37803788            Trying Symonds' criterion for H^*(SmallGroup(720,763); GF(2))
    37813789            Successful application of the Symonds criterion
    37823790            True