Hi there,

I have a release candidate of my libSINGULAR code available. The HG patch is 
at

   http://sage.math.washington.edu/home/malb/pkgs/libsingular.hg

and the required (!) updated SPKG is at:

  http://sage.math.washington.edu/home/malb/pkgs/singular-3-0-2-20070517.spkg

. This spkg also re-enables building of libfac and libcf which are required by 
the optional M2.

This patch does:
 * switch the default implementation for MPolynomials over QQ and GF(p) to 
    libSINGULAR
 * MPolynomial_libsingular should provide everything provided by 
   MPolynomial_polydict so far
 * print all MPolynomials with respect to their monomial ordering
 * add a couple of methods to aid Gröbner basis algorithms, stuff like 
    monomial_lcm etc.

This patch misses:
 * much of the cool stuff in SINGULAR
 * e.g. block orderings
 * support for MPolynomials over GF(p^n) etc.
 * intense testing.

As a proof of concept I made a stand alone version of my F4 implementation 
(over GF(p)) available at:

  http://sage.math.washington.edu/home/malb/f4.py

# old implementation
sage: P1.<a,b,c,d,e,f,g,h,i,j> = 
MPolynomialRing_polydict_domain(GF(127),10,order=TermOrder('degrevlex'))
sage: F1 = sage.rings.ideal.Katsura(P1,6)
sage: time gb = f4(F1)
CPU times: user 4.45 s, sys: 0.07 s, total: 4.51 s
Wall time: 4.55

# new implementation
sage: P2.<a,b,c,d,e,f,g,h,i,j> = 
MPolynomialRing(GF(127),10,order=TermOrder('degrevlex'))
sage: F2 = sage.rings.ideal.Katsura(P2,6)
sage: time gb = f4(F2)
CPU times: user 0.37 s, sys: 0.01 s, total: 0.38 s
Wall time: 0.38

Please note that this is still way slower than SINGULAR (0.10 seconds) mainly 
because so much time is wasted converting between the polynomial 
representation and the matrix representation.

Another fun example, Buchberger's original algorithm:

------------------------------------------
# should these be defined globally?
LM = lambda f: f.lm() 
LT = lambda f: f.lt()
Spol = lambda f,g: LCM(LM(f),LM(g)) // LT(f) * f - LCM(LM(f),LM(g)) // LT(g) * 
g

def buchberger(F):
  G = set(F)
  
  while True:
    Gprime = G.copy()
    for p in Gprime:
     for q in Gprime:
        if p != q:
          S = Spol(p,q).reduce(Gprime)
          if S != 0:
            G.add(S)
    if G == Gprime:
      break

  return list(G)
------------------------------------------

This is of course very very slow but it shows that we have machinery in place 
for this kind of commutative algebra and that this machinery looks pretty 
natural.

Martin

-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_www: http://www.informatik.uni-bremen.de/~malb
_jab: [EMAIL PROTECTED]


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to