Much of the current research work in theoretical physics involves numerical computation. This is because calculations themselves are too complicated to be tackled analytically (i.e., with pencil and paper). The writing of a code suitable to carry out calculations of a specific type, especially one that is flexible, easy enough to use and relatively general in scope, is a major undertaking, one that can consume the better part of a doctoral thesis, for example.
Once the code is functioning, and the project for which it was initially written has been completed, the researcher who developed it often finds him/herself in the somewhat enviable position of having a tool that may be of interest to others, with which different, relevant and important problems may be investigated.
One issue that often comes up in conversation is: what is the accepted protocol for sharing a code with other investigators, or groups ?
First of all, why would anyone skip the all-important process of writing one’s own code, and rely instead on something that is, to a large extent, a “black box” ? Is it not more valuable, from the pedagogical standpoint, as well as reliable in the long run, to write a code from scratch ? The answer is, it depends, but not always. One would not expect an experimenter to build all of the instrumentation needed to carry out some measurements, especially if one is talking standard tools that can be purchased off the shelf. The same notion applies to computer codes, particularly if the research project as a whole should involve more than just computation . People may often simply deem it more efficient to utilize an existing, at least partly tested code, rather than going through the exercise of writing something that already exists, i.e., duplicating work done already by others.
I am not actually aware of any “accepted” protocol for code sharing, but it has been my experience that these situations can lead to unpleasant arguments among scientists. The issue, of course, is how best to give the person who first wrote the code, proper credit for his/her contribution, for without that code the completion of a (publishable) piece of work would not have been possible.
I have been in that situation myself, a lot of times; I have written large, fairly general-purpose codes that have been utilized by my students and postdocs, who in turn have then taken them with themselves after leaving my group, and could re-use (or, have re-used) them for different projects.
Do I expect to see my name featured by default on the author list of any paper that is based, at least in part, on calculations performed with my code ?
Of course not.
My general philosophy is that, the moment a code with its source is given out to anyone, the beneficiary is free to utilize it for his/her own purposes, and need not include the original writer of the code in the collaboration. Especially if the code is based on a novel computing idea or technology, one which may hold promises with respect to existing algorithms, it is in the developer’s best interest to have as many independent researchers as possible utilize it, and apply it to the widest variety of cases or physical systems.
Besides assessing the general effectiveness of the methodology, this mechanism generates citations to the original work of the developer, in which the technology is first proposed and/or illustrated, and it is the number of citations that gives a quantitative sense of the impact of the work on a field. That, to me, citation to one’s original work, is the only “reward” that the initial developer of the methodology should rightfully expect.
That in turn entails that it is in the developer’s best interest to distribute the code to colleagues without any strings attached, provide the proper documentation, and/or render its use as easy as possible to others.
A scientist should generally expect to have his/her name included on the author list of a manuscript describing research for which a code was used that said scientist had to either write from scratch or modify substantially (e.g., add extra functionality). If the technology was not novel, but still someone was asked to sit at a desk for a number of hours, to write and test new code, that person should be rewarded with authorship.
If it is instead just a matter of making trivial modifications to something that exists already, essentially “repackaging” the code for someone else’s use, and if the computing methodology is well-established (i.e., described in textbooks), then it seems to me that an acknowledgment of the contribution of that person, at the end of the manuscript, should suffice.
 A typical example is given by some brilliant theorist, developing a sophisticated approach based on complicated, abstruse but cool-looking formalism, capable of making stunning, if scarcely believable predictions. At that point one may want to run a computer simulation to find out if, on top of its unquestionable aesthetic value, the remarkable approach mentioned above may even get some physics right — something that would be welcome, if not really a requirement. Of course, the role of simulation in a hypothetical case of this type would be ancillary, secondary, just a “technical thing”, really nothing anyone should spend too much time discussing. We all know that, right, Schlupp ?