Research Spotlight: Averaged Invariants in Storage Rings with Synchrotron Motion

Research Spotlight: Averaged Invariants in Storage Rings with Synchrotron Motion

When we design a storage ring particle accelerator, we start from certain basic assumptions that are relaxed as we make progress in the design.

We begin by looking at the betatron motion—the horizontal and vertical oscillations that arise from alternating gradient strong focusing. This motion will tell us whether we can stably store a beam. We also look at synchrotron motion—the longitudinal oscillations of the particles in the beam because of time-of-flight dependence on energy and the radiofrequency cavities that accelerate the particles. One of the assumptions we start with is that the betatron and synchrotron motion is independent, or that they are uncoupled.

The benefit of assuming that they are uncoupled is that it allows us to start with three one-dimensional problems instead of one three-dimensional problem. However, they aren’t actually uncoupled. Betatron motion can be linearly coupled in, for example, circular optics or modified with nonlinear dynamics, such as with nonlinear integrable optics. Chromaticity—the dependence of the betatron frequency on the particle’s energy—also can couple the synchrotron motion with the betatron motion, so-called synchro-betatron coupling. This is a coupled nonlinear system that can lead to chaotic dynamics, emittance growth, and other bad things affecting the quality and lifetime of the beam.

Averaged Hamiltonians and Toy Models

Spurred by RadiaSoft’s collaboration on the FAST/IOTA project at Fermilab, we looked into if some sort of general statement can be made about the synchro-betatron coupling.

When we study the long-term dynamics in a storage ring, like the IOTA ring, we want to study the single-turn map. The single-turn map tells us, given some initial position of a particle, what its final position will be after going through the ring once. It turns out, the single-turn map contains all the dynamics of the accelerator, and analyzing it will let us make long-term predictions about the behavior of a beam of particles.

The dynamics of particles around a storage ring are described by a Hamiltonian which generates the single-turn map. This can get deep into the world of symplectic maps and Lie algebras, but the big picture idea is that if we can understand the dynamics of that Hamiltonian, we can understand the dynamics of the particles in the ring, whether the trajectories are stable or not, and so on.

To do this, RadiaSoft scientists first computed an analytic model to predict an averaged Hamiltonian for a particle accelerator ring. The theoretical calculation is high-level and generic, and in practice is probably tricky to calculate anything concrete for a real accelerator. But it does show that, while we might not be able to compute an averaged Hamiltonian in practice, it at least in principle exists. That existence is enough to suggest various stability properties of the accelerator.

What we found is that, outside of resonance issues that arise from the synchrotron tune being a rational number, we can compute a period-averaged Hamiltonian that tells us something about the average motion of the particles over many synchrotron oscillations. We lose some short-time wobbles and wiggles in the trajectory, but we can say broadly whether the dynamics will be well-behaved or not by looking at this averaged Hamiltonian.

To confirm our computation, we built a toy model of a nonlinear ring with synchrotron motion. This was straightforward to implement in a Jupyter notebook. We used a toy 1D single-turn map Hamiltonian that includes chromaticity, linear focusing, and an octupolar nonlinear term for the transverse dynamics, and a thin RF cavity and linear momentum compaction for the longitudinal dynamics.

So the model includes integrable nonlinear transverse dynamics (but no chaos since the octupole term is included as a constant-focusing term), as well as nonlinear synchrotron motion through a nonlinear RF cavity potential.

While the model may not be perfect for a particle accelerator, it lets us compute something with pen and paper and compare it to the simulations.

We found that our averaged Hamiltonian is very well-conserved in our toy model with linear synchrotron motion. In this case, we computed the averaged Hamiltonian analytically, because our simple model allowed that.

We then compared this averaged Hamiltonian, turn-by-turn, with the unaveraged perpendicular Hamiltonian—that is, the Hamiltonian that contains all the chromatic terms and transverse dynamics, but not the synchrotron motion. What we found is that the perpendicular Hamiltonian has a periodicity with the synchrotron motion, suggesting the existence of some underlying invariant. We also found that the averaged Hamiltonian is very close to invariant over the synchrotron period, suggesting it is that invariant.

Comparison of the conservation of the turn-by-turn transverse Hamiltonian, and the synchrotron period-averaged Hamiltonian.

We can also compare this near-conservation to the synchrotron period directly.

The conservation is in the so-called normal coordinates (see, e.g., É. Forest for a discussion of general linear normal forms) of the linear synchrotron motion, so when we extend to the nonlinear motion we don’t expect conservation since we have not computed the nonlinear normal forms.

In a perturbation theory sense, computing the linear normal forms transforms the linear oscillations to a constant phase advance, so when we look at added nonlinear effects we haven’t canceled out sideband effects and we expect to see oscillations at harmonics of the fundamental. When we add nonlinear synchrotron motion, to account for the curvature in the RF cavity fields, we find oscillations in the invariant commensurate with twice the synchrotron period. This gives us a tell-tale signature that some invariant exists, but we aren’t computing the full normal coordinates, which can be hard to impossible to do effectively for more realistic systems.

Nonlinear side-bands in the linear normalized coordinates at approximately double the frequency of the synchrotron motion, as we might expect.

Signs of a Hamiltonian in a Real System

Now that we have an intuition for what will happen if we try to apply this reasoning to a complex system, we looked at an integrable Rapid Cycling Synchrotron design developed by Jeff Eldred at Fermilab.

We used Synergia to track the single-particle dynamics, and analyzed the on-momentum invariants for the characteristics we expected from our toy model. Sure enough, we see oscillatory, but bounded, behavior in the invariants that oscillates with the synchrotron period. This bounded behavior suggests there’s an underlying period-averaged Hamiltonian like the one we computed for the toy model, and that the averaged trajectories are integrable, even with the synchrotron motion.

Comparison of the Danilov-Nagaitsev invariants to the synchrotron motion. The periodic behavior is similar to what we observed in our toy model.

We found a periodic bursting behavior in the non-conservation of the Hamiltonian and second invariant of the lattice as computed in the usual on-momentum linear Twiss coordinates we might be familiar with for computing Courant-Snyder invariants. The periodicity suggests the existence of an underlying invariant, as simply averaging H over the period shows that there is not some spurious drift. The bursting in non-conservation coincides with the particle going from positive to negative energy offset. This corresponds to going to a region where the vertical and horizontal chromaticities are approximately equal, which permits exactly integrable dynamics for off-momentum particles, and a region where the chromaticities are not equal, but this is a subject for another paper.

Conclusion

This computation has strong implications for future nonlinear integrable optics accelerators like the iRCS we studied in this paper. A big concern was what synchro-betatron coupling will do to the integrability of nonlinear integrable optics, and in this paper we offer a mathematical treatment to better understand that question.

Our initial studies suggest that the dynamics will remain regular and well-behaved over long times, and that while we should look out for what synchro-betatron coupling could do, it’s not an immediate show-stopper. It also suggests a path forward for better understanding synchro-betatron coupling in general.

Read the full paper on arXiv here or check out the JINST publication here.

Want more RadiaSoft news and content? Sign up for our mailing list.

Meet Your Software Developer: Paul Moeller

Meet Your Software Developer: Paul Moeller

Curious about our team of software developers at RadiaSoft? You can meet them, one-on-one, in this ongoing Q&A series. Every month, we introduce you to another member of the RadiaSoft team and they tell you about their work, background, and some of the things that make them who they are.

Today, Paul Moeller talks about the advice he’d give to software developers, the new machine learning app he’s working on, and the thing he wants most from Sirepo users.

What do you do at RadiaSoft?

As a principal software developer, I work on Sirepo. That entails bringing various scientific codes to our browser-based framework and putting nice user interfaces on them. Almost all of them are open-source; some scientists created this software themselves or it passed through time with different people maintaining it. (For example, Zgoubi, a Fortran code, has been around since the ’70s and that’s one of the ones Sirepo supports.)

These scientific codes are out there for anyone to get, but it’s really hard for a regular person to actually run them. They’d have to get it to their computer, compile everything, and make it work. You might have to write a file and feed it into it, for example. We at RadiaSoft try to take all of that information out and build a schema for it, which is like making a map of all the inputs for a code and then arranging them to make logical sense and build a user interface for it. The nice thing about what we do, what Sirepo does, is make it so users don’t need to go through all that, they can just run these codes from their browsers.

What’s your educational and career background?

I always knew that I wanted to study computer science, even when I was in high school. I enjoyed working on software. So I went to a small undergrad called Clarke College in my hometown of Dubuque, Iowa. I also had a music minor in undergrad. Then I got my master’s degree at Loyola University in Chicago and got a job right after that in Chicago. I went to work for a company that wrote software for manufacturing, accounting, and logistics, similar to SAP and Oracle. I worked there for four years, then got married and moved to Boulder, Colorado.

I knew I wanted to live in Boulder because I had a sister who lived here for a while and always thought it was a great place. My wife went to CU then. I met Rob Nagler, our CTO. and joined him at Bivio Inc., and the company evolved into a consulting services business. We met David and that’s how we joined RadiaSoft. This is all over a 20 year span.

What’s some advice you’d give to other software developers?

In general, computer scientists and developers get caught in the language and the technology being used rather than the problem they are trying to solve. You can’t have one hammer that hits every nail. There’s a big advantage to using different technologies for different issues, but also understand that the technology you’re using today will be very different or even obsolete in a few years. Remember that clients often come to you with the technology they want, rather than the problem they have.

Before joining RadiaSoft, what’s the strangest or most interesting job you’ve held?

Back in 1990, when I was in undergrad, I spent the summer working for Central City Opera as a festival staff member. A friend of mine from college and I traveled out to Colorado from Iowa and mopped rehearsal floors, picked up garbage, manned phones, and ushered the performances—all for $25 a day. As an usher I saw around 10 performances of La Traviata, Cosi Fan Tutte, and The Merry Widow each.

If you could invite a pioneer from your field to dinner, who would it be and why?

I would invite a young Steve Jobs, when he was young and crazy, right after he left Apple and when he was doing stuff with Pixar and Next. That would be an interesting time in his life to have a conversation. I really like his approach to making products because they are superior to their competitors. I’d be very curious to figure out what it is about him and how he makes decisions that result in such amazing products. That’s really the million dollar question.

Tell us about one of your current projects.

One project I’m working on is called Webcon. One of our senior research scientists, Jon Edelen, is heading that one up. It’s making a web app that lets you classify or apply machine learning to a dataset. It is a general purpose app which is kind of neat, as opposed to a lot of the work we do which is very specific, related to a beamline or a particular machine.

In Activait, you can upload a bunch of data, select what parts of the data you’re interested in, visualize it, partition it, and classify it. You can discover information from the raw data through classification and correlations.

In general, Activait can be used with any sort of data. It’s not only accelerator-science specific. There was one dataset I was looking at which tried to figure out whether you have diabetes or not. There were lots of inputs, like glucose levels. You let the machine learning just crunch away at it and predict. Machine learning is new to me and it’s an exciting project. It’s a product that’s live, but that we’re all actively working on. So it’s going to get better and better.

What is a talent, secret superpower, or fun fact about yourself that people wouldn’t guess?

I run a lot. If I’m not working, I’m most likely running. On weekends, I run short races, virtual races, these days. In the summertime, I’ll run 50 miles a week, fewer in bad winter weather. It’s definitely something I enjoy, but even five years earlier I would have said it was soccer. But eventually I got old enough that I thought, it’s better just to run rather than put myself in harm’s way.

What’s your favorite Slack emoji and why?

This is not one I use a lot, but one I like is the Walking the Dog emoji. It comes up a lot on our software team Slack channel because many people are walking dogs at various times. It’s what we use when we’re unavailable. Otherwise, I just stick to the thumbs-up emoji.

What’s something you wish people understood better about Sirepo?

I wish people understood that we’re always developing Sirepo and continually improving it. If you’ve used Sirepo and you think it’s nice, but it doesn’t do X thing. Let us know! I would love more feedback from active Sirepo users. It’s not a typical customer-service black hole with Sirepo. One of us will get back to you and you might even change the program for the better. We are totally open to supporting someone’s wishlist. Sirepo’s target customers are such a small portion of the world, it is something we can do. We’re very focused on a specific area, so the more buy-in we can get from people in those areas the better we can make the product for them.

Want to learn more about the RadiaSoft team? Visit our team page for full bios.

Sign up for our mailing list to get more RadiaSoft news and content.

What Is Sirepo? Software & Science Codes Overview

What Is Sirepo? Software & Science Codes Overview

In high energy physics, accelerator physics, and other science disciplines, simulation codes are a vital tool in the research arsenal. The codes often run through the command line, use specialized input files, and sometimes have their own build system.

Learning how to use these codes is hard and can take weeks or months. This means that despite being very useful, many of these codes have only a handful of expert users.

Sirepo was built to bring that kind of scientific computing to the cloud. It’s a gateway for those science codes to be used on a browser, to be accessed via graphical user interface (GUI). By wrapping these codes in GUIs and maintaining them on the backend, we provide a place for scientists to focus on their physics over IT and CS issues.

But even if you’re familiar with codes for accelerators or X-ray beamlines, you might still be thinking, what exactly is Sirepo?

We’ve put together this bird’s-eye view of Sirepo to answer that. Think of it as your crash-course.

In it, we’ll cover how Sirepo relates to various science codes (elegant, WARP, SRW, etc.); how it can help make running simulations easier; how you can share your models with colleagues; and more. Feel free to skip around, or if you want to see Sirepo in action, check out the tutorial video at the bottom of this article.

Want to jump ahead? Here’s where we’re going

What is Sirepo?

Sirepo is a digital cloud-based framework for running simulation codes in your browser. It is the software that houses the simulation code, which is why we call it a scientific gateway.

Under the umbrella of Sirepo are a number of apps. These are the codes that Sirepo supports with graphical user interfaces you can access via web browser. These apps all share a similar visual language and interface, making it easy for users to switch between different codes.

Take the popular physics simulation code elegant. Sirepo/elegant is an app that runs elegant in your browser without you having to download, install, or keep the code up-to-date. Through Sirepo, elegant is prepackaged and ready to be used.

We at RadiaSoft believe that science is made better by the free flow of information and tools.  That’s why we built Sirepo in the first place, to aid the accelerator community. Therefore, like the codes it supports, Sirepo is open-source.

Simulation codes running on Sirepo

The physics codes Sirepo currently supports fall into three families: codes for particle accelerators, codes for X-ray optics, and codes with electrostatic PIC capabilities.

The library of supported codes on Sirepo is always expanding. Below we’ll get into a few of the most popular codes and what they do to give you an idea of how versatile the Sirepo gateway can be.

particle accelerator

elegant

This is a particle accelerator code for electron linacs, synchrotrons, and much more.

According to its user manual, “elegant stands for ‘ELEctron Generation ANd Tracking,’ a somewhat out-of-date description of a fully 6D accelerator program that now does much more than generate particle distributions and track them. elegant, written entirely in the C programming language, uses a variant of the MAD input format to describe accelerators, which may be either transport lines, circular machines, or a combination thereof. Program execution is driven by commands in a namelist format.”

SRW

Its full name is Synchrotron Radiation Workshop and it’s an X-ray optics code for synchrotron radiation and coherent X-ray beamlines, such as what you find at the ALS or NSLS-II.

“Frequency-domain near-field methods are used for the SR calculation, and the Fourier-optics based approach is generally used for the wavefront propagation simulation.

“The code enables both fully- and partially-coherent radiation propagation simulations in steady-state and in frequency-/time-dependent regimes. Besides the SR applications, the code can be efficiently used for various simulations involving conventional lasers and other sources. SRW versions interfaced to Python and to IGOR Pro (WaveMetrics), as well as cross-platform library with C API, are available,”according to its GitHub repo.

OPAL

OPAL or “Object Oriented Parallel Accelerator Library” is a particle accelerator code for linacs and electron guns with 3D space charge. OPAL is open-source and you can learn more about it here.

Synergia

This is a particle accelerator code for single or multiple bunch rings with 3D PIC. It’s a hybrid Python/C++ package. Learn more about Synergia here.

Zgoubi

Originally developed in the 1970s, Zgoubi is a particle accelerator code for electron and ion spin dynamics in rings. Learn more about Zgoubi here.

Imports/exports

Sirepo is designed to aid both the beginner and advanced coder. While a GUI interface is beneficial in many ways, there may be operations and tasks a researcher wishes to carry out in the command line.

This is why there are easy exports to other file formats, like a simple zipped file or Python source file. (Accessible from the top menu bar in your workspace, pictured here.)

Similarly, one can import full lattice files for whichever accelerator they wish to model.

Making collaboration easy

Sharing and collaboration is not so smooth when done in the command line. First, software versions must be the same across all instances, or unexpected input file bugs can appear. Second, the files must all reach their destination intact and in full.

This sounds easy, but is harder to do in practice. And any mistakes mean a wrinkle in results or make a simulation impossible to reproduce.

Great science thrives in collaboration. Unlike traditional command line codes, a simulation in Sirepo is easy to share via link sharing.

Every simulation you create in Sirepo has a unique sharing URL, available in the top menu. Simply copy it and send to whomever you wish, and they will have access to an exact copy. It’s as easy as sending an email or a Slack message.

One thing to note is that Sirepo URL sharing is not like Google Docs. The link you share provides the recipient with a separate copy, not access to the original simulation. This way, you don’t have to worry about anyone altering your simulation.

A walkthrough of Sirepo

It’s important to remember that Sirepo itself is just the container for the codes above and others. Its features change with the codes’ own capabilities. But no matter which one you use, the interface will stay the same.

That said, the best way to understand Sirepo is to see it for yourself.

We recommend this video tutorial of how to build a FODO cell in elegant:

Further resources

More specific information, we have a number of resources available.


Check out Sirepo for yourself today. Sirepo Basic is free to use.

Want more RadiaSoft news and content? Sign up for our mailing list.