Ask Your Question
1

How to write Buchberger algorithm?

asked 11 years ago

Neda gravatar image

updated 11 years ago

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}
Preview: (hide)

2 Answers

Sort by » oldest newest most voted
2

answered 11 years ago

slelievre gravatar image

updated 11 years ago

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.

Preview: (hide)
link
2

answered 11 years ago

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??
Preview: (hide)
link

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: 11 years ago

Seen: 1,892 times

Last updated: Jun 13 '13