Hi Santanu,

I noticed that you also opened a new thread for your question. I think
that it is fine to keep the discussion on the existing thread, since
your new question is of course very similar to the old.

On 19 Mai, 08:27, Santanu Sarkar <[email protected]> wrote:
> Dear Simon,
>  Thank you very much. This approach works well.
> Another thing. I want to find the common solution of
> x0^2+y0^2+x1^2+y1^2+x2^2+y2^2-1, (x1+x2+2x0)^2+(y1+y2+2y0)^2+2(x0^2+y0^2)-1,
> (x1+x2+2x0)x0+(y1+y2+2y0)y0+x0x1+y0y1+x0x2+y0y2,
> x0^2+y0^2+2x1x2+2y1y2 over reals
> using your idea.
> However it does not work.

The approach I.variety(CC) will not work in the new example, since it
is restricted to the case that the ideal is of Krull dimension zero:

sage: R.<x0,y0,x1,y1,x2,y2> = QQ[]
sage: I = [x0^2+y0^2+x1^2+y1^2+x2^2+y2^2-1, (x1+x2+2*x0)^2+
(y1+y2+2*y0)^2+2*(x0^2+y0^2)-1,
....: (x1+x2+2*x0)*x0+(y1+y2+2*y0)*y0+x0*x1+y0*y1+x0*x2+y0*y2,
....: x0^2+y0^2+2*x1*x2+2*y1*y2]*R
sage: I.variety(CC)
Traceback (most recent call last):
...
ValueError: The dimension of the ideal is 3, but it should be 0

But perhaps the approach with using Gröbner bases in lexicographic
term order provides a semi-automated solution:

  sage: R.<x0,y0,x1,y1,x2,y2> = PolynomialRing(QQ, order='lex')
  sage: I = [x0^2+y0^2+x1^2+y1^2+x2^2+y2^2-1, (x1+x2+2*x0)^2+
(y1+y2+2*y0)^2+2*(x0^2+y0^2)-1,
  (x1+x2+2*x0)*x0+(y1+y2+2*y0)*y0+x0*x1+y0*y1+x0*x2+y0*y2,
  x0^2+y0^2+2*x1*x2+2*y1*y2]*R
  sage: G = I.groebner_basis()
  sage: min(G)
  x1^2 - 2*x1*x2 + y1^2 - 2*y1*y2 + x2^2 + y2^2 - 1

If your ideal were zero-dimensional, min(G) would be a polynomial in
just one variable. But here, we have
  sage: I.dimension()
  3
and thus we have three parameters. So, let us choose y2, x2 and y1 as
parameters, and see if a solution using the `solve` function with the
remaining three variables works:

  sage: solve(G, var('x0 y0 x1'))

I became impatient, and so I interrupted it after four minutes. But in
principle it should work that you solve min(G) for x1 in terms of
y1,x2,y2, and then insert into the other elements of G and solve that.

Another approach that failed: You can construct a polynomial ring with
parameters.
  sage: B.<y1,x2,y2> = QQ[]
  sage: R.<x0,y0,x1> = PolynomialRing(Frac(B), order='lex')
  sage: I = [x0^2+y0^2+x1^2+y1^2+x2^2+y2^2-1, (x1+x2+2*x0)^2+
(y1+y2+2*y0)^2+2*(x0^2+y0^2)-1,
  (x1+x2+2*x0)*x0+(y1+y2+2*y0)*y0+x0*x1+y0*y1+x0*x2+y0*y2,
  x0^2+y0^2+2*x1*x2+2*y1*y2]*R
  sage: I.0
  x0^2 + y0^2 + x1^2 + y1^2 + x2^2 + y2^2 - 1
  sage: I.0.coefficients()
  [1, 1, 1, y1^2 + x2^2 + y2^2 - 1]

So, you see that y1, x2 and y2 belong the the ring of coefficients,
they are no polynomial variables.

In that ring, the ideal I is of dimension zero,
  sage: I.dimension()
  0
such that the variety() method should work. But it doesn't:
  sage: I.variety(Frac(CC['y1','x2','y2']))
  verbose 0 (2135: multi_polynomial_ideal.py, variety) Warning:
falling back to very slow toy implementation.
  Traceback (most recent call last):
  ...
  /mnt/local/king/SAGE/sage-4.7.rc2/local/lib/python2.6/site-packages/
sage/rings/ring.so in sage.rings.ring.Ring.is_finite (sage/rings/
ring.c:5955)()
  NotImplementedError:

Here is the error in its pure form:
  sage: R.base_ring().is_finite()
 
---------------------------------------------------------------------------
  NotImplementedError                       Traceback (most recent
call last)

  /mnt/local/king/SAGE/sage-4.7.rc2/<ipython console> in <module>()

  /mnt/local/king/SAGE/sage-4.7.rc2/local/lib/python2.6/site-packages/
sage/rings/ring.so in sage.rings.ring.Ring.is_finite (sage/rings/
ring.c:5955)()

  NotImplementedError:

I think that is a bug, and I will open a trac ticket for it.

Cheers,
Simon

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to