I'm performing a calculation of the Smith normal form of an integral matrix based on the SageMath worksheet. Is it sufficient in the paper to say something like "Using a software package like SageMath it can be checked that the Smith normal form of the matrix $A$ is ...?"

- 29,779

- 346
- 1
- 11
-
9If the code consists only of calling a function in SageMath and easily reproduced by anyone else, then that's probably sufficient. But if the code is longer but not too long, then it might be good if you include it and the output produced by SageMath in an appendix. If the code is longer than, say, a page, then I suggest that you put it in a public github repository and put the link to it in your paper. – Deane Yang Jan 19 '21 at 15:45
-
12"Using a software package like SageMath" : if you used SageMath, why not explicitly say that, and give credit where credit is due? – Carlo Beenakker Jan 19 '21 at 15:45
-
8Often software documentation/websites suggest specific way of citing their use in publications. For SageMath, see https://wiki.sagemath.org/Publications_using_SageMath – Max Alekseyev Jan 19 '21 at 18:44
-
4Related: How do we explain the use of a software on a math paper? and Computer calculations in a paper and Should computer code be included within publications that present numerical results?. – Timothy Chow Jan 20 '21 at 05:47
1 Answers
This question was essentially answered in the comments years ago, but I want to add a bit more detail in an answer here, so that it doesn't linger on the unanswered queue.
With any writing question, your first question should be what's best for the reader? If you are lucky, your paper will be read by many people, some of whom might want to build on it. Therefore, they should know precisely which software you used. It matters if it's Sage or if it's Mathematica. Not all software systems are open source, which matters for questions of correctness and reproducibility. In this case, if you're talking about a very small amount of code, you should also include that code. That will help the reader who wants to replicate your result or build on your paper. It also helps the referee, who might want to be sure the math in your paper is correct.
Even if there's a lot of code, you should make your code publicly available so that others can replicate your work. Many journals now require this, e.g., I have had to make my code available in PLOS ONE, and in Crime Science. Other times, I chose to make my code available even if the journal did not require it. Imagine yourself as a student. You'd want to have that code! We should work to build a culture where our methods are open for others who want to verify the work we did and build on it. Do the reader a favor and comment your code to make it easier to follow. This advice matches the other threads on related topics, mentioned by Timothy Chow.
Another organizing principle should be what do other researchers in my field do? Many, many other papers cite SageMath. A list of hundreds can be found here. You should look at how those papers do it. If the code is not the main thrust of the paper, then it's often best to put it in an appendix, where a reader interested to see your code will look, and others won't be thrown off by a block of code in the middle of your proofs. Since you used the Sage software, you should cite it, and a comment already pointed out how precisely to do that in your References section.

- 29,779