Saturday, November 12, 2011

Codes for electrons and photons

The x-rays in a synchrotron are produced by high energy electrons traversing magnetic fields. The main devices that produce the magnetic fields are undulators or wigglers.

To model this process, therefore, first one needs to model the electrons in the ring, and to have a good model of the fields in the ring. This is the purpose of a tracking code. I focus on the code AT, since I have experience, and the elements representing the physics are easily accesible and available, so that one knows where to look if there are problems or questions.

To really know all the fields in the ring that act back on the electron beam, one must do measurements and modelling of the elements. For the insertion devices, there is the Mathematica based code Radia, which allows one to build an insertion device and compute the fields. One can also compute the kick map which will act on the electrons and can reduce the dynamic aperture and lifetime, particularly for narrow pole-width insertion devices.

Next, one needs to compute the radiation that will result from the electrons. For this, the code SRW is quite accurate and state-of the art. Next, one should model how this radiation can progress down the beam-line. For this purpose, the code Shadow is well developed.

In modeling both the electron beam dynamics and the radiation effects from undulators, one needs to have a model for the magnetic field of a given undulator. The field may be computed using a code such as Radia. But there are also representations of the field in terms of harmonics such as the Halbach representation. Here's a description of the symplectic integration routine for an analytical representation from Forest. One may also represent it via a kick map.  The latter two representations serve the purpose of the tracking of electrons for the purpose of tracking to determine dynamic aperture. Given the electron orbit, one can compute the radiation emitted. This can be done with e.g. SRW.

Thursday, September 15, 2011

Properties of electron and photon beams

Once one knows the electron beam properties, then one can calculate the radiation properties.
What are the basics? What photon beam is produced by a given electron beam as it goes through a bending magnet or undulator?
One computes the brightness via the Wigner function. Does this give the beam sizes also? The single electron brightness needs to be convolved with the beam distribution.

The basic result is that the photon beam sizes and divergences come from the electron beam sizes  and divergence and the single electron radiation size and divergence added in quadrature.

The beam sizes thus depend on the frequency and also which harmonic for an undulator.
Here is the paper by Tanaka and Kitamura describing the impact of energy spread on the photon beam sizes.

The horizontal beam size and divergence are given by:

To understand this, we need to understand the emittances and the Twiss parameters and the dispersion.

The same equations apply to the bunch length and energy spread. The longitudinal beta function is given to first order by
with αc the momentum compaction factor and μs equal to 2piνs.

For ESRF these are available here.  A good reference is this article by M. Sands.

The x-rays produced in synchrotrons are used in a variety of experiments.  The production of the radiation depends on the properties of the electron beam.

One should calculate the power radiated. One should understand polarization. One should understand coherence.  Then there are the standard things people compute and use to compare sources:
brightness (or brilliance) and flux.

As emittance decreases for storage ring light sources, one claimed benefit is in the coherence of the resulting light. And indeed, the claimed benefit for FEL based light sources is also with respect to coherence (among other properties).

The paper by Geloni et. al. examines this issue.  The recent paper by Bazarov (on arxiv) also explores this issue and has computations of the Wigner function out of undulators.

The electron beam loses electrons over time.

The lifetime itself may be divided into two pieces, a vacuum lifetime and a Touschek lifetime.

The vacuum lifetime is result of the scattering process of electrons off of the gas molecules in the beam pipe. The Touschek lifetime is the result of the scattering of electrons off of each other.

The bunch length may be measured with a streak camera. Its value depends on the current and is given by solving the Haissinski equation, below the microwave instability.
The vertical emittance may be measured.
The energy acceptance is challenging. It may be given by the RF acceptance or by the dynamic acceptance. Computing this quantity is the work of a tracking code.

In AT, one uses the function atcalc_TouschekPM.

So, the basic mechanism of the synchrotron light source involve highly relativistic electrons moving through magnetic fields. What happens?
Well, we have dipole magnets that bend the electrons, and basically create the circular trajectory. Then we have quadrupole magnets for focusing, sextupole magnets for chromatic effects and other stability issues. To better understand, and control the electrons, we also need to model them.
Since there are lots of magnets, one needs a code to do this. Here, there's some nice aspects and some messes.

Basically, the equations of motion are given by the Lorentz force law. Newton's laws give a differential equation that needs to be integrated to get the orbit. So one needs a code that can integrate through the magnets. There are conserved quantities, and the motion is symplectic. So one needs a symplectic integrator in order to not lose precision over time.

A symplectic integrator comes in different orders. To get good results, one usually needs at least fourth order. One needs this together with flexible ways to define the magnetic fields. One code that can do this is the Matlab based code called AT- Accelerator Toolbox. An attempt at an open source collaboration is here. The underlying integrators are coded in C, which can be compiled as Mex files, and the definition of the fields to create the ring is done with Matlab.

Non-linear dynamics is mainly relevant for injection efficiency and Touschek lifetime.
One may also want to optimize parameters to improve the non-linear dynamics. One example is the tune shift with amplitude.
For the case of sextupoles distributed around a synchrotron, the general result is

In terms of an efficient algorithm, one may compute this as:
Thsi = sindex(s);
       ti = sindex(t);
       b = b3vals(s)*b3vals(t);
       c =  sqrt(bx(si)*bx(ti));
       cx = cos(abs(mux(si) - mux(ti)) - muxT);
       c3x= cos(3*(abs(mux(si) - mux(ti)) - muxT));
       cxp2z = cos(abs(mux(si) - mux(ti)) + 2*abs((muz(si)-muz(ti))) - (muxT + 2* muzT));
       cxm2z = cos(abs(mux(si) - mux(ti)) - 2*abs((muz(si)-muz(ti))) - (muxT - 2* muzT));
      xdx = xdx + b * c ^ 3 * (3*cx/sx + c3x/s3x);
      xdz = xdz + b * c * bz(si) * (-4 * bx(ti) * cx / sx + 2 * bz(ti) * cxp2z / sxp2z - 2 * bz(ti) * cxm2z / sxm2z);
      zdz = zdz + b * c * bz(si) * bz(ti) * (4 * cx / sx + cxp2z / sxp2z + cxm2z / sxm2z);

Sunday, December 12, 2010


There are many sources of light in the world.  What do we usually think of when we ask where light comes from?  One obvious answer is the sun!  Another answer is a light bulb!   A third, very common source of light these days is a computer monitor or television screen, often using an LCD screen. A fourth, less common, but beautiful source of light is from some living creatures, in the form of bioluminescence.  Yet another source of light, which is perhaps less well known to the public, but well appreciated by scientists is the so-called synchrotron light sources.  These large scientific complexes produce x-rays that and are used in a variety of methods to help understand the nature and structure of many different things.

Now, physical theory says that light is a travelling electromagnetic field.   In the classical theory, these fields satisfy Maxwell's equations.  A quantum picture shows light as a stream of photons, particles whose energy is related to their wavelength by E=h nu.

What about the processes that create the light to begin with?  In the sun, the matter moves very quickly- at a high temperature- and the light is produced in these collisions, creating blackbody radiation, with the surface temperature being around 5800 K.  A light bulb is essentially a hot filament of metal, radiating as well as a sort of blackbody radiator.  In the case of bioluminescence, the light comes an electron changing energy levels in a molecule in the organism.  Finally, the light from the synchrotron light source comes from high energy electrons bending in a magnetic field.

In each case, the properties of the light depend on the properties of the source.  The light from the sun depends on the temperature of the sun for its spectrum, and on the size and distance of the size for its spatial and angular extent.  For a light bulb, it depends on the power emitted from the bulb, the material of the filament, and the size and shape of the bulb.  For bioluminescence, it depends on the molecules involved which determines the spectrum, and the amount and distribution of that molecule which determines the spatial extent.  Finally, in the case of the synchrotron light source, the properties depend on the energy and trajectory of the electrons for determining the spectrum, and the density  and distribution of the electrons to determine the spatial and angular extent of the resulting light.

The topic of synchrotron radiation from high energy electrons in storage rings is not so well known to the public, nor in fact to most scientists who use the radiation in their experiements.  It developed as an off-shoot to particle physics.  In order to understand the electron beam that is radiating, one needs to know about how the electron beam got there in the first place, and what sets the properties of the electron beam.  The former topic is the topic of accelerator physics.  It typically covers hardware as well as beam dynamics.

This blog will focus on the physics of synchrotron light sources after the acceleration has already occured.  The electrons still need to be maintained- or stored- in the large ring.  And the x-rays produced need to be guided and focussed towards the experiements.  Thus, we will cover some basics of the physics of electron beams in synchrotrons and photon beams following emission. And maybe some generalities on the light emission process that is relevant to many situations where light is produced.  In other words, we situate the physics of synchrotron radiation in storage rings within the broader topic of "light source physics".
Some topics:
Theoretical ways of modeling an electron beam.
Theoretical ways of modeling a light beam.
Software for analyzing electron beam.
Software for analyzing light beam.
Useful properties of photon beams, and their connection to the electron beam.
Ways of measuring electron beams.
Ways of measuring light beams.