Changeset 879c5ff in git for Singular/LIB/dmod.lib


Ignore:
Timestamp:
May 8, 2009, 6:02:23 PM (15 years ago)
Author:
Viktor Levandovskyy <levandov@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
a5075a7d32535b7c43e10e87abb25bf2c6bc89f2
Parents:
a2e297661483537b015225dc3602180d4df607c7
Message:
*levandov: new proc operatorModulo added


git-svn-id: file:///usr/local/Singular/svn/trunk@11786 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/dmod.lib

    ra2e2976 r879c5ff  
    11//////////////////////////////////////////////////////////////////////////////
    2 version="$Id: dmod.lib,v 1.42 2009-04-15 11:11:34 seelisch Exp $";
     2version="$Id: dmod.lib,v 1.43 2009-05-08 16:02:23 levandov Exp $";
    33category="Noncommutative";
    44info="
     
    4848@*    annfsOT, annfsLOT, annfs2, annfsRB etc.
    4949@* - all the relevant data to F^s (LD, LD0, bs, PS) are computed by operatorBM
     50@* - operator PS can be computed via operatorModulo or operatorBM
    5051@*
    5152@* - annihilator of F^{s1} for a number s1 is computed with annfspecial
     
    6566bernsteinBM(F[,eng]);   compute global Bernstein polynomial for a polynomial F (algorithm of Briancon-Maisonobe)
    6667operatorBM(F[,eng]);    compute Ann F^s, Ann F^s0, BS and PS for a polynomial F (algorithm of Briancon-Maisonobe)
     68operatorModulo(F, I, b); compute PS via the modulo approach
    6769annfsParamBM(F[,eng]);  compute the generic Ann F^s (algorithm by Briancon and Maisonobe) and exceptional parametric constellations for a polynomial F with parametric coefficients
    6870annfsBMI(F[,eng]);      compute Ann F^s and Bernstein ideal for a polynomial F=f1*..*fP (multivariate algorithm of Briancon-Maisonobe)
     
    9698
    9799LIB "matrix.lib"; // for submat
    98 LIB "nctools.lib";
     100LIB "nctools.lib"; // makeModElimRing etc.
    99101LIB "elim.lib"; // for nselect
    100102LIB "qhmoduli.lib"; // for Max
     
    19131915//  poly F = x^3+y^3+z^2*w;
    19141916
    1915 // TODO: 1 has to appear in the 1nd column of transp. matrix
    1916 // this does not happen automatically
    1917 // for this, do special modulo with emphasis on the 1comp (c,<)
    1918 // of the transp matrix, there must appear 1 in the GB
    1919 // then use lift to get the expression...
    19201917// need: (c,<) ordering for such comp's
    19211918
    1922 /*
    19231919proc operatorModulo(poly F, ideal I, poly b)
    19241920"USAGE:  operatorModulo(f,I,b);  f a poly, I an ideal, b a poly
    19251921RETURN:  poly
    1926 PURPOSE: compute the B-operator from the polynomial f, ideal I = Ann f^s and Bernstein-Sato
    1927 polynomial b using modulo i.e. kernel of module homomorphism
    1928 NOTE:  The computations take place in the ring, similar to the one returned by Sannfs procedure.
    1929 @*       If printlevel=1, progress debug messages will be printed,
    1930 @*       if printlevel>=2, all the debug messages will be printed.
     1922PURPOSE: compute the B-operator from the polynomial f,
     1923@*           ideal I = Ann f^s and Bernstein-Sato polynomial b
     1924@*           using modulo i.e. kernel of module homomorphism
     1925NOTE:  The computations take place in the ring, similar to the one
     1926@*       returned by Sannfs procedure.
     1927@*     Note, that operator is not completely reduced wrt Ann f^{s+1}. 
     1928@*     If printlevel=1, progress debug messages will be printed,
     1929@*     if printlevel>=2, all the debug messages will be printed.
    19311930EXAMPLE: example operatorModulo; shows examples
    19321931"
    19331932{
    1934   // with hom_kernel;
    1935   matrix AA[1][2] = F,-b;
    1936   //  matrix M = matrix(subst(I,s,s+1)*freemodule(2)); // ann f^{s+1}
     1933  int ppl = printlevel-voice+2;
     1934  def save = basering;
     1935  // change the ordering on the currRing
     1936  def mering = makeModElimRing(save);
     1937  setring mering;
     1938  poly b = imap(save, b);
     1939  poly F = imap(save, F);
     1940  ideal I = imap(save, I);
    19371941  matrix N = matrix(I); // ann f^s
    19381942  //  matrix K = hom_kernel(AA,M,N);
    1939   matrix K = modulo(AA,N);
    1940   K = transpose(K);
    1941   print(K);
    1942   ideal J;
    1943   int i;
    1944   poly t; number n;
    1945   for(i=1; i<=nrows(K); i++)
    1946   {
    1947     if (K[i,2]!=0)
    1948     {
    1949       if ( leadmonom(K[i,2]) == 1)
     1943  // option(noreturnSB)?
     1944  /// matrix K = modulo(AA,N); // too slow: do it with slim!
     1945    module M = b,-F;
     1946    dbprint(ppl,"starting modulo computation");
     1947    module K = moduloSlim(M,N);
     1948    dbprint(ppl,"finished modulo computation");
     1949    //    K = transpose(K);
     1950//     matrix M[3][s+2] = F,-b,I[1..s], 1,0:(s+1),0,1,0:(s);
     1951//     module GM = slimgb(M);
     1952//     module GMT = transpose(G);
     1953//     GMT = GMT[2],GMT[3]; // modulo matrix
     1954//     module K = GMT[2];
     1955//     GMT = transpose(GMT);
     1956//     K = transpose(K);
     1957//     matrix K = GMT;
     1958//////////////////////////////////////////////////
     1959//  now select those elts whose 0's entry is nonzero
     1960// if there is constant => done
     1961// if not => compute GB and get it
     1962    module L;
     1963    ideal J;
     1964    int i;
     1965    poly t; number n;
     1966    for(i=1; i<=ncols(K); i++)
     1967    {
     1968      if (K[1,i]!=0)
    19501969      {
    1951         t = K[i,1];
    1952         n = leadcoef(K[i,2]);
    1953         t = t/n;
    1954         //        J = J, K[i][2];
    1955         break;
     1970        L = L,K[i];
     1971        if ( leadmonom(K[1,i]) == 1)
     1972        {
     1973          t = K[2,i];
     1974          n = leadcoef(K[1,i]);
     1975          t = t/n;
     1976          break;
     1977          //          return(t);
     1978        }
    19561979      }
    19571980    }
    1958   }
    1959   ideal J = groebner(subst(I,s,s+1)); // for NF
    1960   t = NF(t,J);
    1961   "candidate:"; t;
    1962   J = subst(J,s,s-1);
    1963   // test:
    1964   if ( NF(t*F-b,J) !=0)
    1965   {
    1966     "Problem: PS does not work on F";
    1967   }
    1968   return(t);
     1981    if (n!=0)
     1982    {
     1983      // constant found
     1984      setring save; poly t = imap(mering,t); kill mering;
     1985      return(t);
     1986    }
     1987    dbprint(ppl,"no explicit constant. Start one more GB computation");   
     1988    // else: compute GB and do the same
     1989    L = L[2..ncols(L)];
     1990    K  = slimgb(L);
     1991    dbprint(ppl,"finished GB computation");
     1992    for(i=1; i<=ncols(K); i++)
     1993    {
     1994      if (K[1,i]!=0)
     1995      {
     1996        if ( leadmonom(K[1,i]) == 1)
     1997        {
     1998          t = K[2,i];
     1999          n = leadcoef(K[1,i]);
     2000          t = t/n;
     2001//          break;
     2002          setring save; poly t = imap(mering,t); kill mering;
     2003          return(t);
     2004        }
     2005      }
     2006    }
     2007
     2008    // we are here if no constant found
     2009    "ERROR: must never get here!";
     2010    return(0);
     2011//     for(i=1; i<=nrows(K); i++)
     2012//     {
     2013//       if (K[i,2]!=0)
     2014//       {
     2015//         if ( leadmonom(K[i,2]) == 1)
     2016//         {
     2017//           t = K[i,1];
     2018//           n = leadcoef(K[i,2]);
     2019//           t = t/n;
     2020// //        J = J, K[i][2];
     2021//           break;
     2022//         }
     2023//      }
     2024//   }
     2025//   ideal J = groebner(subst(I,s,s+1)); // for NF
     2026//   t = NF(t,J);
     2027//   "candidate:"; t;
     2028//   J = subst(J,s,s-1);
     2029//   // test:
     2030//   if ( NF(t*F-b,J) !=0)
     2031//   {
     2032//     "Problem: PS does not work on F";
     2033//   }
     2034//   return(t);
    19692035}
    19702036example
    19712037{
    19722038  "EXAMPLE:"; echo = 2;
    1973   //  ring r = 0,(x,y,z),Dp;
    1974   //   poly F = x^3+y^3+z^3;
    1975   LIB "dmod.lib"; option(prot); option(mem);
     2039  //  LIB "dmod.lib"; option(prot); option(mem);
    19762040  ring r = 0,(x,y),Dp;
    1977   //  poly F = x^3+y^3+x*y^2;
    1978   poly F = x^4 + y^4 + x*y^4;
     2041  poly F = x^3+y^3+x*y^3;
    19792042  def A = Sannfs(F); // here we get LD = ann f^s
    19802043  setring A;
    19812044  poly F = imap(r,F);
    19822045  def B = annfs0(LD,F); // to obtain BS polynomial
    1983   list BS = imap(B,BS);
    1984   poly b = fl2poly(BS,"s");
     2046  list BS = imap(B,BS);   poly bs = fl2poly(BS,"s");
     2047  poly PS = operatorModulo(F,LD,bs);
    19852048  LD = groebner(LD);
    1986   poly PS = operatorModulo(F,LD,b);
    1987   PS; // the operator, s.t. PS*F^{s+1} = bs*F^s mod LD
    1988   reduce(PS*F-bs,LD); // check the property of PS
    1989 }
    1990 */
    1991 
    1992 
     2049  PS = NF(PS,subst(LD,s,s+1));; // reduction modulo Ann s^{s+1}
     2050  size(PS);
     2051  lead(PS);
     2052  reduce(PS*F-bs,LD); // check the defining property of PS
     2053}
    19932054
    19942055proc annfsParamBM (poly F, list #)
Note: See TracChangeset for help on using the changeset viewer.