Clear Sky Science · en
Multi-facility virtual diagnostic for longitudinal phase space predictions
Peering Inside Particle Beams Without Breaking Them
Free-electron lasers and other powerful X-ray sources rely on exquisitely shaped bunches of electrons racing near the speed of light. Tuning these beams normally requires diagnostic tools that interrupt or destroy the beam, making it impossible to measure while experiments are running. This paper explores how machine learning can stand in as a “virtual instrument,” letting operators watch the internal structure of electron beams in real time without taking the machines offline.
Why Beam Shape Matters for Bright X-Rays
In a modern linear accelerator, the electrons are not just lined up in a simple queue. Each bunch has a rich internal structure: where electrons sit in time along the bunch and how their energies vary. Together, this is called the longitudinal phase space, and it largely determines how bright and stable an X-ray pulse will be. The gold-standard tool for mapping this structure is a transverse deflecting structure—a special radio-frequency cavity plus magnets and a screen that spread the beam into a two-dimensional picture. That picture reveals key quantities such as bunch length and energy spread, but the price is high: the beam is diverted to a screen and can no longer be used for experiments, and the system is complex and time-consuming to operate.

Teaching a Virtual Instrument to See the Beam
The authors propose a different approach: use machine learning to train a virtual diagnostic that can predict what the destructive instrument would have shown, based only on non-invasive measurements taken all the time. These include readings from beam position monitors, beam arrival time monitors, current transformers, and radio-frequency settings that shape the beam. By feeding many paired examples—real phase-space images from the deflecting structures together with their corresponding non-destructive readings—into artificial neural networks, the system learns the link between easily measured signals and the hidden internal structure of the beam. Once trained, the network can instantly infer the full longitudinal phase space image without touching the beam.
Testing the Idea at Three Different Machines
To see if one general recipe would work widely, the team applied the same overall network design and training strategy at three very different facilities: the MAX IV linear accelerator in Sweden and the FERMI and SwissFEL free-electron lasers in Italy and Switzerland. Each machine has its own layout, beam energies, and compression schemes, and its own transverse deflecting setups. The researchers systematically varied machine settings that are normally used to tune beam shape—such as radio-frequency phases, pulse compressor conditions, and laser heater strength—and recorded thousands of destructive images together with the accompanying non-destructive signals. Using these datasets, they trained networks that take in the non-destructive readings and output a full two-dimensional phase-space image.
Predicting Full Pictures and Key Numbers
The virtual diagnostics performed remarkably well across all four studied beamlines (MAX IV, FERMI, and the two SwissFEL branches Athos and Aramis). When judged by how closely the predicted and measured images matched, scores typically exceeded 90 percent, and in many cases hovered around 95 percent or better. The networks even reproduced fine details, such as subtle tails and internal substructures in the beam distribution. The authors also built simpler networks that skip the full image and instead predict only a few vital numbers extracted from it—like bunch length, total energy spread, and energy “chirp,” which describes how energy changes along the bunch. These compact models trained faster, used far fewer parameters, and still reached errors small enough to rival or beat what the physical diagnostic can resolve in practice.
How Stable Are These Predictions Over Time?
Real accelerators drift: small changes in radio-frequency phases, magnet calibrations, or diagnostics can gradually shift the relationship between inputs and beam structure. To test robustness, the team trained a virtual diagnostic at MAX IV using data from a single day, then applied it over the following four days without retraining. As the machine moved away from the original conditions, prediction quality steadily declined, and by the fifth day some outputs no longer resembled the measured phase space. Yet the system remained reasonably accurate for several days, even during a period when operators were deliberately changing settings for studies rather than maintaining a steady delivery mode. This suggests that, with periodic retraining or richer input signals, virtual diagnostics could be kept dependable over extended operation.

A New Way to Watch Beams in Real Time
For a general reader, the upshot is that the authors have shown machine learning can effectively “clone” a complex, beam-destroying instrument at multiple large facilities, using a shared framework that adapts across very different machines. Once trained, the virtual diagnostic runs in milliseconds, far faster and cheaper than detailed computer simulations and without interrupting experiments. It can reveal the internal time–energy structure of electron bunches and key summary parameters on the fly, opening the door to smarter optimization and feedback systems. Looking ahead, the same strategy could be extended to other diagnostics, shared between facilities through transfer learning, and combined with advanced data selection methods to further improve performance. In essence, the work points toward accelerators that are continuously self-aware of their internal beam structure, without ever having to look away from the experiments they serve.
Citation: Lundquist, J., Björklund Svensson, J., Dijkstal, P. et al. Multi-facility virtual diagnostic for longitudinal phase space predictions. Sci Rep 16, 12021 (2026). https://doi.org/10.1038/s41598-026-47195-1
Keywords: virtual diagnostics, particle accelerators, machine learning, free-electron lasers, beam monitoring