Ask Your Question

Revision history [back]

First, it makes sense that you will get [1.0] as the only element of the Groebner basis since, as the polynomial sum_sqr_distances has coefficients in the inexact ring RR, it is likely that the given polynomials generate the whole polynomial ring.

Indeed, when you add a polynomial with coefifients in RR with polynomials with coefficients in QQ, the result will belong to a polynomial ring with coefficients in RR. You can check it by typing:

sage: I ..... over Real Field with 53 bits of precision

You can replace QQ with RDF in the definition of the polynomial ring. Then the coercion will be done towards RDF which consist of low-level floating-point numbers, hence the computation will finish, while it might take longer with RR.

However, i guess that having [1.0] as the only element of the Groebner basis due to working in an inexact ring is quite unsatisfactory.

So, if you want to work on an exact ring, since the name sum_sqr_distances seems to indicate that the coefficients are quadratic numbers, you should define them either in QQbar or in some number field. It is likely that the computation of a Groebner basis will be even slower.

First, it makes sense that you will get [1.0]the coinstant polynomial 1.0 as the only element of the Groebner basis since, as the polynomial sum_sqr_distances has coefficients in the inexact ring RR, it is likely that the given polynomials generate the whole polynomial ring.

Indeed, when you add a polynomial with coefifients in RR with polynomials with coefficients in QQ, the result will belong to a polynomial ring with coefficients in RR. You can check it by typing:

sage: I
..... over Real Field with 53 bits of precision

precision

You can replace QQ with RDF in the definition of the polynomial ring. Then the coercion will be done towards RDF which consist of low-level floating-point numbers, hence the computation will finish, while it might take longer with RR.

However, i guess that having [1.0] as the only element of the Groebner basis due to working in an inexact ring is quite unsatisfactory.

So, if you want to work on an exact ring, since the name sum_sqr_distances seems to indicate that the coefficients are quadratic numbers, you should define them either in QQbar or in some number field. It is likely that the computation of a Groebner basis will be even slower.

First, it makes sense that you will get the coinstant polynomial 1.0 as the only element of the Groebner basis since, as the polynomial sum_sqr_distances has coefficients in the inexact ring RR, it is likely that the given polynomials generate the whole polynomial ring.

Indeed, when you add a polynomial with coefifients in RR with polynomials with coefficients in QQ, the result will belong to a polynomial ring with coefficients in RR. You can check it by typing:

sage: I
..... over Real Field with 53 bits of precision

You can replace QQ with RDF in the definition of the polynomial ring. Then the coercion will be done towards RDF which consist of low-level floating-point numbers, hence the computation will finish, while it might take longer with RR.

However, i guess that having [1.0] as the only element of the Groebner basis due to working in an inexact ring is quite unsatisfactory.

So, if you want to work on an exact ring, since the name sum_sqr_distances seems to indicate that the coefficients are quadratic numbers, you should define them either in QQbar or in some number field. It is likely that the computation of a Groebner basis will be even slower.

Of course, you can convert sum_sqr_distances into a polynomial with rational coefficients as follows:

sage: sum_sqr_distances = P(sum_sqr_distances)

But regarding the "sqr" name of the polynomial, it is likely not to be the way to go.

First, it makes sense that you will get the coinstant polynomial 1.0 as the only element of the Groebner basis since, as the polynomial sum_sqr_distances has coefficients in the inexact ring RR, it is likely that the given polynomials generate the whole polynomial ring.

Indeed, when you add a polynomial with coefifients in RR with polynomials with coefficients in QQ, the result will belong to a polynomial ring with coefficients in RR. You can check it by typing:

sage: I
..... over Real Field with 53 bits of precision

You can replace QQ with RDF in the definition of the polynomial ring. Then the coercion will be done towards RDF which consist of low-level floating-point numbers, hence the computation will finish, while it might take longer with RR.

However, i guess that having [1.0] as the only element of the Groebner basis due to working in an inexact ring is quite unsatisfactory.

So, if you want to work on an exact ring, since the name sum_sqr_distances seems to indicate that the coefficients are quadratic numbers, you should define them either in QQbar or in some number field. It is likely that the computation of a Groebner basis will be even slower.

Of course, you can convert sum_sqr_distances into a polynomial with rational coefficients as follows:

sage: sum_sqr_distances = P(sum_sqr_distances)

But regarding the "sqr" name of the polynomial, it is likely not to be the way to go.

Now, regarding your initial problem, perhaps should you forget about polynomial equations, instead, look at the optimization features of Sage, in particular, you can have a look at:

sage: minimize?

First, it makes sense that you will get the coinstant polynomial 1.0 as the only element of the Groebner basis since, as the polynomial sum_sqr_distances has coefficients in the inexact ring RR, it is likely that the given polynomials generate the whole polynomial ring.

Indeed, when you add a polynomial with coefifients in RR with polynomials with coefficients in QQ, the result will belong to a polynomial ring with coefficients in RR. You can check it by typing:

sage: I
..... over Real Field with 53 bits of precision

You can replace QQ with RDF in the definition of the polynomial ring. Then the coercion will be done towards RDF which consist of low-level floating-point numbers, hence the computation will finish, while it might take longer with RR.

However, i guess that having [1.0] as the only element of the Groebner basis due to working in an inexact ring is quite unsatisfactory.

So, if you want to work on an exact ring, since the name sum_sqr_distances seems to indicate that the coefficients are quadratic numbers, you should define them either in QQbar or in some number field. It is likely that the computation of a Groebner basis will be even slower.

Of course, you can convert sum_sqr_distances into a polynomial with rational coefficients as follows:

sage: sum_sqr_distances = P(sum_sqr_distances)

But regarding the "sqr" name of the polynomial, it is likely not to be the way to go.

Now, regarding your initial problem, perhaps should you forget about polynomial equations, instead, look at the optimization features of Sage, in particular, you can have a look at:

sage: minimize?

You can also have a look at this question