Ask Your Question
1

xgcd for several arguments

asked 2023-09-28 09:59:24 +0100

Martin-Br gravatar image

SageMath has a built-in method for performing the extended Euclidean algorithm for two numbers (or polynomials), called xgcd. The algorithm also works for several arguments, by recursion. One can implement this easily with a SageMath helper function, but I was wondering: does SageMath have a built-in extension of xgcd to several arguments?

edit retag flag offensive close merge delete

Comments

Hi, are you working on this, otherwise do you mind if I implement this and contribute? I also need this functionality for my personal purpose.

seewoo5 gravatar imageseewoo5 ( 2024-07-21 01:18:14 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-09-29 23:56:48 +0100

Max Alekseyev gravatar image

updated 2023-09-30 00:02:37 +0100

Perhaps not. You are welcome to contribute the enhancement.

There is a related functionality implemented for multivariate polynomials via .lift() method, which works like this:

sage: R.<x,y> = QQ[]
sage: pols = [x^2-2*x+4,x^2-5*x+6,x^2-4]
sage: J = R.ideal(pols)
sage: gcd(pols).lift(J)
[1/4, -1/10, -3/20]
sage: sum(map(prod,zip(_,pols))) == gcd(pols)
True
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

1 follower

Stats

Asked: 2023-09-28 09:59:24 +0100

Seen: 692 times

Last updated: Sep 30 '23