Posts tagged ‘commutative algebra’

Computing Gröbner bases in Haskell

I wrote a small package to compute Gröbner bases in Haskell with the Buchberger algorithm (with applications to variable elimination). Performance is quite bad compared to specialised software like Macaulay, but it seems to work ! I put a Cabal package here. Maybe I’ll add several functions afterwards.

A testcase :
import Data.Polynomial
import Data.Ring
import Algebra.GroebnerBasis
import Algebra.Elimination
type R = Polynom QQ VarXYZ
[x,y,z,t,u,v] = map returnp [X,Y,Z,T,U,V] :: [R]
-- projection from a point on the intersection of quadrics
main = do
print $ step_eliminate [T] $ MakeIdeal
[x^2 - 3*y*z + z*t + 2*x*t,
z^2 + 5*y^2 + z*x - 2*t*z]

The output should be :
[x*y^2+2/5*x^2*z+1/2*y^2*z+3/10*x*z^2+-3/5*y*z^2+1/10*z^3]

Advertisements

20 March 2009 at 7:47 pm Leave a comment

Experimental algebraic geometry I : the grassmannian

I just began playing with Macaulay 2 to see how it could help doing algebraic geometry without manual tedious computations. Let’s try with the grassmannian: fortunately, the program comes with lots of pre-written functions, including the generation of Grassmanians.

Macaulay provides a command-line interface using the readline library (like many other command-line programs) : here is what input/output looks like

i1 : V = Grassmannian(1,3)
o1 = ideal(p   p    - p   p    + p   p   )
            1,2 0,3    0,2 1,3    0,1 2,3
o1 : Ideal of ZZ[p   , p   , p   , p   , p   , p   ]
                  0,1   0,2   1,2   0,3   1,3   2,3

When I type a command at i1, I get an output o1 with a value \mathrm{ideal}(p_{1,2} p_{0,3} - p_{0,2} p_{1,3} + p_{0,1} p_{2,3}) and a type: this output is an ideal of the ring \mathbb{Z}[p_{0,1}, p_{0,2}, p_{1,2}, p_{0,3}, p_{1,3}, p_{2,3}]. Many features of the Grassmannian as an algebraic variety are available: first define

i1 : V = Grassmannian(1,3,CoefficientRing => QQ);
o1 : Ideal of QQ[p   , p   , p   , p   , p   , p   ]
                  0,1   0,2   1,2   0,3   1,3   2,3
i2 : X = Proj(ring V / V)
o2 = X
o2 : ProjectiveVariety

the projective variety X over \mathbb Q defined by the homogeneous ideal V : here ring V denotes the ambient ring of V. We see that V is a non-singular quadric in 5-dimensional projective space, and check several well-known facts (more…)

7 February 2009 at 11:17 pm Leave a comment


Pages

Categories