How much code to include in a Physics paper?

If the goal of your paper is to show that your code solves a particular problem or performs a specific task, then it is your responsibility to prove to the reviewers that your code does what it claims to do. The easiest way to do this is to include the code as part of the supporting information for your paper.

However, reproducibility—which is what you're asking about, to a certain extent—is a not-so-simple question when it comes to showing codes do what they're supposed to. For instance, a code that runs one way under one configuration may return a slightly (or perhaps _very) different result when run under another configuration. This doesn't mean that one result or the other is wrong—it just means that this behavior needs to be taken into account when evaluating the correctness of software.

One way to help this is to provide as much information as possible on your testing environment, so that any differences between the system on wich you were working and the conditions the reviewers and future potential users of your code will have can quickly be identified. This would be included, perhaps, as a text file that accompanies the code in the supporting information.


I would second @NPcompleteUser's answer about having the code and some sort of walkthrough for reproducing your results online. However your question about how much to include in the paper is very journal specific. There are a number of publications specifically for computational science with formats where large chunks of code are expected, but if it's a journal whose focus is more on the science than the techniques, I would just describe in words the tricky parts of your algorithm and give a footnote reference to the website where the code lives.


I would put the current version [of the code] on gist. Providing inputs and gnuplot (matplotlib/whatever) scripts for graph reproduction.