Ask Your Question
1

What implementation does sage use for solve?

asked 2021-04-19 20:48:21 +0100

anonymous user

Anonymous

What algorithm does sage use when you solve polynomials with the solve() function?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-04-19 20:53:15 +0100

tmonteil gravatar image

Regarding the solve function, Sage does not implement it own algorithm, instead it asks maxima to do the job by default. You can also pass the algorithm='sympy' option to use Sympy instead.

See:

sage: solve?
edit flag offensive delete link more

Comments

What algorithm does maxima use then? There are numerious methods to solve polynomials like Durand-Kerner...

MathAllOverThePlace gravatar imageMathAllOverThePlace ( 2021-04-19 20:57:38 +0100 )edit

We have to check. Note however that the Durand-Kerner algorithm is numerical, while the solve function will try to give you the solutions as symbolic expressions involving nth roots:

sage: solve(2*x^2-7==0,x)
[x == -1/2*sqrt(7)*sqrt(2), x == 1/2*sqrt(7)*sqrt(2)]
tmonteil gravatar imagetmonteil ( 2021-04-19 23:28:30 +0100 )edit

So is it safe to say that say that Sage solves polynomials analytically instead of numerically? Do you know how they implement such algorithm? You would think that a computer solves factorization nummerically since it can easilly calculate a lot of numbers with decent precision.

MathAllOverThePlace gravatar imageMathAllOverThePlace ( 2021-04-20 10:36:52 +0100 )edit

So is it safe to say that say that Sage solves polynomials analytically instead of numerically?

Yep, when possible. When not possible (degree >=5, and no "obvious" paths to an explicit solution, Sage can compute root values in QQbar, which can be thought of as objects representing algorithms, computable to arbitrary precision and are treated as exact numbers by "the rest of Sage".

Do you know how they implement such algorithm?

Tou are welcome to read the source ;-) (translation : I don't know, do not know enough to know where to start...).

You would think that a computer solves factorization numerically since it can easily calculate a lot of numbers with decent precision.

That's more or less what happens when an explicit solution (first intention goal) does not exist.

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2021-04-20 14:33:43 +0100 )edit

You could also ask on the Maxima mailing lists: https://maxima.sourceforge.io/maximal...

John Palmieri gravatar imageJohn Palmieri ( 2021-04-20 18:25:24 +0100 )edit

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: 2021-04-19 20:48:21 +0100

Seen: 386 times

Last updated: Apr 19 '21