Ask Your Question
1

How to write Buchberger algorithm?

asked 2013-06-11 22:11:04 -0500

Neda gravatar image

updated 2013-06-11 22:17:36 -0500

Hello, I want to write this algorithm in sage, I know sage is python base but I'm not much familiar with this programming language so I'm working on it.. Could you please tell me how can I write Buchberger algorithm in sage? I know there is commands for computing it, but I want the algorithm..

input= (f1,…,fs)

output= a groebner basis G={ g1,...,gt} for f ? G

initialization :

G=F

g:= {(fi,fj) | fi,fj ? G , fi!= fj }

h:=0

iteration

    WHILE *g* != 0   DO

           choose any {f,g} ?  *g*

           *g*:= *g* \ {{f,g}}

            h:= (s(f,g)) ^G 

            IF h != 0  THEN

                *g* := *g* U {{u,h}| u ? G }

                 G:= G U {h}
edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
2

answered 2013-06-13 02:40:33 -0500

tmonteil gravatar image

A simpler way to find where buchberger() function is located could be the use of the import_statements() function:

sage: import_statements('buchberger')
from sage.rings.polynomial.toy_buchberger import buchberger
sage: from sage.rings.polynomial.toy_buchberger import buchberger
sage: buchberger??
edit flag offensive delete link more
2

answered 2013-06-11 23:15:21 -0500

updated 2013-06-11 23:39:56 -0500

Check if it is in Sage's source code:

search_doc('buchberger')

This reveals that there is a file

$SAGE_ROOT/devel/sage/sage/rings/polynomial/toy_buchberger.py

(where $SAGE_ROOT is your Sage root directory).

In this file there is a function buchberger and a function buchberger_improved.

To get the code for Buchberger's algorithm, type

sage: from sage.rings.polynomial.toy_buchberger import buchberger
sage: buchberger??

It uses a function to compute the S-polynomial of two polynomials, whose source code you can see by typing

sage: from sage.rings.polynomial.toy_buchberger import spol
sage: spol??

See also the online documentation for toy_buchberger.

You can also browse the source code online at github. See toy_buchberger there.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-06-11 22:11:04 -0500

Seen: 362 times

Last updated: Jun 13 '13