Ask Your Question

ConfusedMark's profile - activity

2018-01-22 12:19:11 -0500 received badge  Great Question (source)
2018-01-21 07:49:40 -0500 received badge  Good Question (source)
2018-01-20 23:34:10 -0500 received badge  Nice Question (source)
2018-01-19 14:57:05 -0500 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 14:26:30 -0500 received badge  Nice Question (source)
2017-04-27 07:38:21 -0500 received badge  Student (source)
2017-04-27 04:57:38 -0500 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?