sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.34k stars 454 forks source link

singular/surf error #22590

Open zimmermann6 opened 7 years ago

zimmermann6 commented 7 years ago

the following example which was working with Sage 5.9 (cf Figure 9.1 page 193 of http://sagebook.gforge.inria.fr/) is no longer working with Sage 7.5.1:

  sage: R.<x,y,z> = QQ[]
  sage: J = R.ideal(x^2 * y * z - 18,
  ....:             x * y^3 * z - 24,
  ....:             x * y * z^4 - 6)
  sage: opts = {'axes':True, 'gridlines':True, 'frame':False,
  ....:    'aspect_ratio':1, 'axes_pad':0, 'fontsize':8,
  ....:    'xmin':-1.3, 'xmax':1.3, 'ymin':-1.3, 'ymax':1.3}
  sage: (ideal(J.0).plot() + ideal(J.1).plot()).show(**opts)

With Sage 7.5.1 I get:

TypeError: Singular error:
Close window to exit from `singularsurf`.
   ? calling `surf` failed
 (The shell returned the error code 32512.
   ? leaving surf.lib::plot

This is critical for the translation in german and in english of the book.

Component: graphics

Issue created by migration from https://trac.sagemath.org/ticket/22590

jdemeyer commented 7 years ago
comment:1

Obvious question: do you have surf installed on your system?

zimmermann6 commented 7 years ago
comment:2

Obvious question: do you have surf installed on your system?

it seems no. I thought Sage was self-content...

Paul

zimmermann6 commented 7 years ago
comment:3

now with surf installed, the last command opens a new window where it is written:

root_finder=d_chain_bisection;epsilon=0.0000000001;iterations=20000;
width=500; height=500; set_size; do_background=yes; background_red=255; background_green=255; background_blue=255;
rot_x=0.14; rot_y=-0.3;
surface=
x^2*y*z-18
;
draw_surface;
color_file_format = jpg;
filename = "/tmp/surf.jpg";
save_color_image;

Can you reproduce this? Is it really the expected behaviour?

Paul

jdemeyer commented 7 years ago
comment:4

Replying to @zimmermann6:

Obvious question: do you have surf installed on your system?

it seems no. I thought Sage was self-content...

Well, I never realized that Sage required surf for plotting ideals.

The doc of plot? is funny by the way:

        If you somehow manage to install surf, perhaps you can use
        this function to implicitly plot the real zero locus of this
        ideal (if principal).
zimmermann6 commented 7 years ago
comment:5

If you type (with J the ideal in the description):

J0=ideal(J.0)
J0.plot?

then you get a more specific help:

Signature:      J0.plot(*args, **kwds)
Docstring:     
   Plot the real zero locus of this principal ideal.

   INPUT:

   * "self" - a principal ideal in 2 variables

   * "algorithm" - set this to 'surf' if you want 'surf' to

        plot the ideal (default: None)

   * "*args" - optional tuples "(variable, minimum, maximum)"

        for plotting dimensions

   * "**kwds" - optional keyword arguments passed on to

        "implicit_plot"

but none of algorithm=None and algorithm='surf' do work.

zimmermann6 commented 7 years ago
comment:6

sorry I retract part of what I said in the description: the example in the book differs. However the failure is still there. If plot is not able to deal with 3D ideals, I believe the error message should be improved.