5

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 ...?"

David White
  • 29,779
A. Gupta
  • 346
  • 1
  • 11

1 Answers1

4

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.

David White
  • 29,779