Take the 2-minute tour ×

I work in the field of accelerator physics and synchrotron radiation. High energy electrons circulating in large rings of magnets produce x-rays that are used for a variety of different kinds of science.

Running and improving these facilities requires controlling and modelling the electron beam as it circulates in the ring. A code to model this basically requires trackers to follow the electrons through the elements (something called a symplectic integrator), and then the computation of different parameters associated with this motion. The problem with these codes is that every facility has there own (maybe 4-5 different codes, some with multiple versions). In principle the code is not so complex. And as a modelling project, one might think it has some general interest. Who doesn't want to be able to create a track in space out of magnets and watch the electrons circulate?

There is a Matlab based code to do this called Accelerator Toolbox, but the creator of the code is no longer in the field. I put the code in Sourceforge under the name atcollab. The basic resource is a set of symplectic integrators written in C. These are then compiled into mex code and interfaced via Matlab. It has been useful to put the code on Sourceforge in order to exchange code, but the community of users is quite small and most are too busy to put that much time into collaboration. So in terms of really improving the code, I don't think it has been so successful.

Any piece of this picture could be recreated without that much difficulty, but overall it is a bit complex, and because each lab has their own installation with lots of added-on code and locally developed tools, people find it hard to really work together and share code. Somehow I think we need to involve a wider community in our development, or just use some standard tools. But for that, I suppose it needs to be of some general interest. I think symplectic integrators may have some general interest. And the part about a plug-in architecture to build up the ring ought to fit other patterns. Or the other option is to just accept that this is not a problem of general interest, and work harder within our small community.

Suggestions or anecdotes of analogous experience would be appreciated.

share|improve this question
Seems like cool stuff, but it is way over my head and probably most peoples. Not all of us have a particle accelerator in our basement that we can play with. To be honest, most open source projects have a hard time getting involvement for common problems let alone specialty ones. Maybe somebody else has some suggestions? Good luck! –  maple_shaft Nov 14 '11 at 12:14
Agreed that real general interest is tough. But I'd think there could be educational value for this tool, together with the larger community of people working in a related field that would like to learn more about it. That's really what I'd like to see- the topic being more accessible. People seem to be interested in the LHC and there is lhc@home to get involved in some way, or just learn something, and I think this is easier to understand than that. –  Boaz Nov 14 '11 at 12:34
What makes lhc@home great is that I only need a high school education in physics to understand the concept of it. Most people who are interested in the LHC are mildly curious. We have the attention span to watch a 1 hour documentary on the Science channel about the LHC, or easily install software on our PC's that assists in analyzing raw data. It allows us to feel like we are helping with only superficial knowledge. To contribute to this open source project requires a detailed understanding of physics. Does this make sense? When I get home I will look at it though, it seems neat. –  maple_shaft Nov 14 '11 at 13:05
Agreed, and its also true that running lhc@home is quite different from designing it. Actually, looking at the lhc@home page, it says that you can "help develop and exploit ... accelerators like LHC". So maybe there is some aspect where you put together magnets in a ring. I wouldn't expect many people to know how to write the code that tracks the particle through the magnetic field correctly. But really the whole thing is not so different from ray tracing software. The link I gave was to the integrators which are effectively written already. Thanks for the interest ms! –  Boaz Nov 14 '11 at 13:24

3 Answers 3

I think that the main thing you need to do is make contacts with more people in similar positions at other scynchrotrons. Share your code and ideas with with more people and you may be able to get them to share their code with you, or at the very least contribute to improving your code.

If there isn't enough overlap between what the communal project is doing and what each individual lab does then you will find it difficult to motivate your existing collaborators, let alone bring in new ones. You may want to discuss with your current collaborators what can be done to help more people use the software in the project. Maybe some people prefer to do something in a slightly different way to how you do it at the moment and that is a barrier to their inclusion.

To find new collaborators, you could hunt through scientific papers published by synchrotrons around the world, looking for people doing the same sort of work you are doing. Another option is to go to conferences and make more contacts that way.

Diamond Light Source, the UK Synchrotron facility, decided to release it's user facing Data Acquisition and Scientific data analysis software under GPL a few years ago. The OpenGda website has allowed us to make contact with a number of synchrotrons around the world who are starting to deploy GDA onto beamlines at their facilities.

You may want to look at the Computational Science stack exchange site, it is turning into quite a useful resource.

Also, talking about open science, for a great example of crowdsource science, take a look at foldit. Harnessing the tenacity, intuition and ingenuity of gamers allows science do do things like Decode AIDS Protein That Stumped Researchers For 15 Years In Just 3 Weeks.

share|improve this answer
Thanks Mark. Helpful suggestions. I do in fact have a lot of contacts at different synchrotrons and many are enthusiastic about improving coordination and working together. But people are also busy, and are also using the codes they are used to, and so creating a communal code is difficult. This is why I thought that if we could isolate some general features that others would be interested in, we could expand the users and developers. Support for such a project from one of the synchrotrons such as the GDA project you mention would also be helpful. The computation science site looks great! –  Boaz Nov 14 '11 at 17:37

Since you're asking about "suggestions or anecdotes", there is a relevant TED Talk "Open science now!" which also mentions at one moment the sharing of the source code¹.

More generally, there are a few problems with such open source projects:

  1. The scientific community doesn't have yet an open source and code sharing culture compared to the software developers. Since they are unwilling to open their source code to the community for review², they will have less chance to use an open source code daily.

  2. The scientific community is disparate. I mean, when I get a C# source code from CodePlex, I'm pretty sure it will compile fine with my latest Visual Studio, or I'll need to download and install just a couple of add-ins to make it work. At the opposite, a FORTRAN code written by a scientist is written to be highly optimized to run on the workstations in his lab. Chances are, when somebody will try to deploy the same project in another environment with slightly other configuration, it will not compile³, or not run as expected⁴.

  3. For an open source project, larger is the target audience, bigger is the chance to succeed. When publishing a Java application, you are targeting thousands and thousands of developers. C, Java, C#, JavaScript communities are so large that any open source library can be interesting to a few. At the opposite, "accelerator physics and synchrotron radiation", being a very interesting subject, is, well, too difficult to be understood by everyone.

  4. There are well known websites built by or for the communities of developers to share open source code. CodePlex is one example. Since plenty of developers visit those websites, you're pretty sure that if you post your code here, some will see it. At the opposite, there are no famous websites for open source code around "accelerator physics and synchrotron radiation" visited daily by thousands of people. If you want to share your code, you'll have to talk to people in live, and do much more effort in order to be known.

¹ Talking about science wiki projects that failed, Michael Nielsen adds (6:10): "It's not just science wikis either. Inspired by Facebook, many organizations have tried to create social networks for scientists, which will connect scientists to other people with similar interests, so they can share things like data, or code they write [...] If you join one of these sites, you'll discover they are essentially empty".

² Publish your computer code: it is good enough  by Nick Barnes in Nature, October 14th 2010, Vol. 467, 753.

³ Why scientific programming does not compute  by Zeeya Merali in Nature, October 14th 2010, Vol. 467, 777

⁴ I'm not saying that the scientists are writing bad code. It's more that they have different goals. Developers are trained to write compatible, readable and not so optimized code. If I'll start to do small changes to gain a few milliseconds of performance, making the code difficult to understand, my colleagues will ask me if I'm crazy. If a scientist will start to write code for readability and compatibility, and the code will run five days instead of four and a half, there will be problems.

share|improve this answer
+1, Yes, it is odd that while the world-wide-web was created to facilitate communication amongst researchers, 20 years later open science is still really in its infancy. –  Mark Booth Nov 16 '11 at 0:53
Good points MainMa, and I appreciated the TED video. I agree that in this case, its partly a general problem about the scientific community being more publishing oriented than working in common. And actually, the publishing part makes a lot of sense for the new results and research aspect. In this case, however, its really about building a well-designed, easy to use code when all the principles are already well-known. Certainly there are research questions one can ask with such a code. But the basics of such a code for particle tracking are not really research topics anymore. –  Boaz Nov 16 '11 at 7:16

I think that one way to break down such a project into something manageable is to first think about a common way to describe the metadata of your models in a declarative way. In other words, I mean some type of common schema or markup language for describing what a model "is" (the input) and what the results of the analysis are (the output).

I am guessing that each facility has wildly different ways of representing the input to their codes and likewise wildly different ways of representing the results of their analysis? I would even say that this is mainly what keeps people from being flexible about trying new implementations.

If you can introduce a usable information interchange format, it makes it a lot easier for folks to try your implementations. By the same token, folks writing/improving new implementations can use the mark-up schema as a starting point.

Something like this has been going on in the spectroscopy community for a long time. They have introduced markup languages for analytical spectroscopy (animl). I can't vouch for how successful the effort was, but the idea is sound.

share|improve this answer
+1 For introducing mentioning AnIML, as it looks interesting. –  Mark Booth Nov 16 '11 at 16:39
Indeed Angelo, this is a big problem. Each facility has its own approach to data representation. There is indeed an attempt at a common standard using xml. Have a look at Accelerator Markup Language (AML). Another data format that was developed is Self Describing Data Sets (SDDS) from APS. I guess the former (AML) is about representing the set of magnets, while the latter (SDDS) is more generally about results of calculations. –  Boaz Nov 17 '11 at 15:58

Your Answer


