Ask Your Question

ConfusedMark's profile - activity

2022-07-06 06:25:34 +0200 received badge  Popular Question (source)
2020-07-31 17:40:17 +0200 asked a question Thicker plot in implicit_plot3d

I'm graphing a surface in implicit_plot3d and then cutting away part of it to reveal another surface that was hidden behind it. Is there a way to "thicken" the plotted surface, so that the edge is still visible in places where we are looking at it straight-on?

For a simple example, how can I graph the part of $x^2+y^2+z^2 = 1$ with $z \leq 1/2$, while making the sphere a bit thicker than the default?

2020-01-10 22:33:10 +0200 received badge  Popular Question (source)
2020-01-10 22:25:44 +0200 received badge  Editor (source)
2020-01-10 22:23:07 +0200 asked a question sage-shell-mode error with "cursor position requests"

Since the update to Sage 9.0, I am no longer able to use sage-shell-mode in emacs. After starting Sage in a buffer, when I send text via C-c C-r, it gives the warning "WARNING: your terminal doesn't support cursor position requests (CPR)." This happens no matter what terminal software I use: urxvt, xterm, gnome-terminal,...

I am still able to interact with Sage in the Sage buffer, but any subsequent attempts to send text over via C-c C-r give the error "text is read-only". Perhaps relevant, when I run "quit" in Sage, it closes and then shows some messages about "Task was destroyed but it is pending! task: <task pending="" name="Task-251" coro="&lt;Renderer.wait_for_cpr_responses." [...]"<="" p="">

Google catalogs a few other appearances of this error, but none of them seem to be relevant to my situation. Any ideas?

(Note: I am using the builds of Sage, emacs, etc shipped by Arch Linux. I didn't use Sage much over the holidays but ran updates to various software at that time, so I can't be totally sure it's the Sage update that broke it. But I haven't had any other symptoms in emacs.)

2019-10-30 16:50:29 +0200 asked a question Plotting polynomials defined over a number field

I have an element of a polynomial ring over a number field K. It's a pretty benign number field -- I have just adjoined a square root of 3, called 't'.

I want to be able to plot the polynomial (specifically, it's a polynomial of two variables, and I want an implicit plot of where it vanishes). How do I get Sage to coerce 't' to a real number and draw the plot? Of course this should involve fixing an embedding of my number field into RR, but it's just a square root, so this shouldn't be hard.

For a minimal example:

var('w')
K.<t> = NumberField(w^2-3)
R = PolynomialRing(K,2,'x,y')
R.inject_variables()
f = y - t*x
implicit_plot(f,(x,-3,3),(y,-3,3))

It (quite understandably) chokes with "TypeError: Unable to coerce -t to a rational". I would like to coerce t to be the positive real square root of 3 and draw the plot.

2019-09-16 18:27:04 +0200 received badge  Supporter (source)
2019-09-16 18:24:37 +0200 commented answer Check whether point is on a projective variety

Thank you so much! Didn't even think to try that.

2019-09-16 18:24:21 +0200 received badge  Scholar (source)
2019-09-16 18:08:25 +0200 asked a question Check whether point is on a projective variety

I have a projective variety X (defined via .subscheme(polynomials) on a projective space). I have a projective point P. How can I check whether my point is on my variety?

The obvious answer is to try X.point(P). This throws an error if it's not a point, and constructs a point on X otherwise. Is there something like this that will simply give me true or false, rather than an error?

2018-01-22 19:19:11 +0200 received badge  Great Question (source)
2018-01-21 14:49:40 +0200 received badge  Good Question (source)
2018-01-21 06:34:10 +0200 received badge  Nice Question (source)
2018-01-19 21:57:05 +0200 asked a question "Future-proof" Sage documents

I'm writing a paper and will be using a bundle of Sage scripts to help with various computations. I plan to post the script to the arxiv and submit it to a journal along with the paper.

I am curious whether there are any guidelines for writing Sage that is intended to be readable (and verifiable) in the medium- to long-term. Even assuming Sage is still around in 30 years, I am doubtful that current files will run. (For that matter, most of my programs won't run as soon as Sage switches to python3 due to the new print syntax.) I'd like to write the code in such a way that it could easily be adapted to whatever Sage-like software exists in the future, or such that future readers will at least be able trust the results of the computations.

In addition to generous comments, I plan to provide a human-readable file containing output of the main objects computed in the course of the work (matrices, algebraic expressions, ...). In my case, this is probably enough; the calculations are mostly just linear algebra at the end of the day. What else should I do? Has anyone ever worked with a university library or archive on for advice on writing future-proof Sage code?

Of course, this question applies to any paper relying on computer algebra calculations, not just those in Sage. I would also appreciate pointers to more broadly applicable articles on this topic.

I realize that old versions of Sage will probably still be accessible, and that a suitably-motivated mathematical historian might be able to get my code to compile. But this paper is not such a big deal -- I am looking for a solution that would lead someone to be able to reconstruct the results without so much effort.

2017-04-27 21:26:30 +0200 received badge  Nice Question (source)
2017-04-27 14:38:21 +0200 received badge  Student (source)
2017-04-27 11:57:38 +0200 asked a question Canonical maps between iterated polynomial rings

I have a very basic question, but I'm hoping to learn the "right" way to handle things before getting too far into a project.

I'm considering the following spaces.

R = PolynomialRing(QQ,2,'s')
P2 = ProjectiveSpace(2,R,'x')                     
TotalSpace = ProductProjectiveSpaces([2,1],QQ,names=['x','s'])

The coordinate ring of P2 is: "Multivariate Polynomial Ring in x0, x1, x2 over Multivariate Polynomial Ring in s0, s1 over Rational Field", whereas the coordinate ring of TotalSpace is "Multivariate Polynomial Ring in x0, x1, x2, s0, s1 over Rational Field". There is an obvious map P2.coordinate_ring() -> TotalSpace.coordinate_ring() (which is a map of QQ-algebras, but not R-algebras). How do I get my hands on this thing in Sage? The problem is that P2.coordinate_ring().gens() has only three elements (the xi's), and I'm not sure how to specify the images of the si's.

In general, is it correct to declare multiple rings like this, with the same names for the generators, if I would like the generators to be identified with each other? Or do I need to start with one and get the rest by adjoining things to that? How do I handle the "inject_variables()" commands in this situation?