{'fraction_non_alphanumeric': 0.034068099026094714, 'fraction_numerical': 0.010370976135603302, 'mean_word_length': 4.697268106734435, 'pattern_counts': {'":': 1, '<': 8, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Linac

A linac (linear accelerator) is a system that allows to accelerate charged particles through a linear trajectory by electromagnetic fields. This kind of accelerator finds several applications in fundamental research and industry. The main devices used to accelerate the particle beam will be introduced in the first part of the paper, while in the second part, the fundamentals of the longitudinal and transverse beam dynamics will be highlighted. A short paragraph is finally dedicated to radiofrequency quadrupoles (RFQ).


Introduction
A linear accelerator (linac) is a device that allows accelerating charged particles (electrons, protons, ions) along a straight trajectory [1,2]. The main advantage of linacs is their capability to produce high-energy, high-intensity charged particle beams of excellent quality in terms of beam emittance and energy spread. These devices find applications in different fields such as research, healthcare and industry [3][4][5][6][7][8].
The acceleration can be obtained with constant (DC) or time-varying electric fields. In the second case, we can have two types of linacs: radio frequency (rf) and induction. In this proceeding we will refer to rf linacs in which the particle acceleration is obtained by electromagnetic fields confined in resonant cavities fed by sinusoidal time-varying power sources. The design and the structure of a linac depend on the type of accelerated particles (e.g. electrons, protons or ions) and on the required final beam parameters in terms of energy, energy spread, emittance and current. In the design and in the choice of the technology, several constraints have also to be taken into account such as cost, available footprint and power consumption.
The main advantages [9] of linacs with respect to other possible accelerators (as synchrotrons or cyclotrons) are the fact that they can handle high peak current beams, they can run with high duty-cycle and they exhibit low synchrotron radiation losses (in the case of light particle acceleration as electron or positrons). On the contrary, the main drawback is the fact that they require a large number of cavities to reach a desired energy, since the beam passes only once in the accelerating structures. Moreover, synchrotron radiation damping (in the case of light particles) cannot be used to reduce the beam emittance unless to adopt complicated schemes.
Linacs are mainly used in fundamental physics research as injectors for synchrotrons and storage rings, free electron lasers and injectors for colliders. They also find a huge number of medical and industrial applications for cancer therapy, x rays generation, material treatment, food irradiation and ion implantation.
A linac conceptual scheme, where its technology complexity can be also assessed, is shown in Fig. 1. Particles are generated and pre-accelerated in the injector, and then accelerated by accelerating structures and focused by magnetic elements (quadrupoles and solenoids). Beam trajectory and dimensions along the linac are measured by different types of diagnostic devices (striplines, cavity beam position monitors and beam screens) depending on the particle beam and energy. In the figure are reported also the control, cooling and vacuum systems, the rf distribution and rf power sources. Acceleration process: particle velocity and energy The first historical linear accelerator was conceived by the Nobel prize Wilhelm Conrad Röntgen (1901). It consisted in a vacuum tube containing a cathode connected to the negative pole of a DC voltage generator of few kV. Electrons emitted by the heated cathode (by thermionic emission) were accelerated while flowing to another electrode connected to the positive generator pole (anode). Collisions between the energetic electrons and the anode produced x-rays and gave the possibility to do the first radiography.
In modern electrostatic accelerators high voltage is shared between a set of electrodes creating an accelerating field between them. This type of accelerator is better known as the Cockcroft-Walton accelerator [10]. Its main limitation in term of achievable energy, is due to the fact that all partial accelerating voltages add up at some point and insulation problems or discharges occur, thus limiting the maximum achievable voltage to a few tens of MV.
Electrostatic accelerators are still used for several applications as x ray generation, material analysis, or ion implantation. The simple scheme of a DC acceleration process between two electrodes is reported in Fig. 2 (1) where E0 (=m0c 2 ) is the particle rest energy, E is the total energy, m0 is the rest mass, m is the relativistic mass, v is the particle velocity, p (=mv) is the particle momentum, W=E-E0 is the kinetic energy and Ez is the accelerating field. In Eq. (2) dE/dz is the rate of energy gain per unit length and it is proportional to the accelerating field Ez.
Integrating Eq. (2) on the accelerating gap we obtain the energy gain per electrode pair E: (3) The behavior of  and  as a function of the kinetic energy is given in Fig. 3 for an electron and a proton.
From the plot it is evident that light particles (electrons) are practically fully relativistic (1, >>1) at relatively low energies (above 10 MeV) and reach a constant velocity (c). Thus, for this type of particles, the acceleration process occurs at constant velocity. On the contrary heavy particles (protons and ions) are typically weakly relativistic and reach a constant velocity only at very high energies. This means that their velocity changes during the acceleration process. As illustrated in the following, the possible velocity change during acceleration generates important differences in the accelerating structures design and beam dynamics between light and heavy particles.

Radiofrequency accelerators: the Wideröe linac
In the late 1920's propositions were made by Ising (1924) and implemented by Wideröe (1927) to overcome the limitation of electrostatic devices in terms of reachable energy [11][12][13]. The proposed scheme is illustrated in Fig. 4. An AC voltage generator feeds, alternately, a series of electrodes in such a way that particles do not experience any force while travelling inside the tubes (Drift Tubes) while are accelerated across the gaps. In particular, this last statement is true if the drift tube length (or, equivalently, the distances between the centers of the accelerating gaps Ln) increases with the particle velocity during the acceleration, such that the time of flight between gaps is kept constant and equal to half of the rf period. If this condition is satisfied, the particles are subject to a synchronous accelerating voltage and experience an energy gain of ∆E=q∆V at each gap.
In this type of structures, called Drift Tube Linac (DTL), a single rf generator can be used, in principle, to indefinitely accelerate the beam, avoiding the breakdown limitations that affect the electrostatic accelerators. The Wideröe linac is the first rf linac. As illustrated in Fig. 1(b), a rf acceleration process does not allow to accelerate a continuous particle beam but the beam needs to be "bunched" with a distance between bunches exactly equal to the rf period.
Let us now consider the acceleration between a pair of two electrodes. The behavior of the accelerating electric field and voltage are given by the following relations: The energy gain per electrode (supposing a symmetric accelerating field with respect to z=0) is given by: where  inj is the injection phase of a generic particle. T is called the "transit time factor" and is always less than 1.
It takes into account the fact that the rf voltage is oscillating in time while the beam is traversing the gap and that the effective peak accelerating voltage ( acc Vˆ) is in fact equal to the rf voltage (VRF) multiplied by this factor.
is the average accelerating field seen by the particle. 5 If we consider a Wideröe structure, the energy gain, at each gap, is equal to En=qVacc while the particle velocity increases accordingly to Eq. (4). In order to be synchronous with the accelerating field at the center of each gap, the time of flight (tn) between gaps is given by: where TRF is the generator rf period, n v is the average particle velocity between the gap n and n+1 and RF is the rf wavelength. Then, the distance between the centers of two consecutive gaps has to be increased as follows: The energy gain per unit length is then given by: ) increase pushes towards the use of small RF (high frequencies), but the concept of equipotential drift tubes cannot be applied at small RF and the power lost by free space radiation increases proportionally to the rf frequency.
All previous considerations combined with the fact that high frequency, high power rf sources became available only after the 2 nd world war (thanks to the radar technology applied to military purposes), pushed to develop more efficient accelerating structures than simple drift tubes. In order to avoid electromagnetic (e.m.) radiation processes and to allow the use of high frequency sources, the accelerating system had to be enclosed in a metallic volume: a rf cavity. In a rf cavity the e.m. field has a particular spatial configuration (resonant mode) whose components, including the accelerating field E z , oscillates at a specific frequency (called resonant frequency) characteristic of the mode. The mode is excited by the rf generator that is coupled to the cavity through waveguides, coaxial cable antennas or loops. The resonant modes are called Standing Wave (SW) modes since they have a spatial fixed configuration that oscillates in time. The spatial and temporal field profiles in a cavity have to be computed (analytically or numerically) by solving the Maxwell equations with the proper boundary conditions [14,15].
For a SW cavity the accelerating field on the z-axis can be written as:

 
As for the Wideroe structure, also in the Alvarez linac the accelerating field is concentrated between gaps and the beam crosses the drift tubes when the electric field is decelerating. The drift tubes are suspended by stems and quadrupole magnets (for transverse focusing) can fit inside them.
To maintain the synchronism between the beam and the accelerating field at each gap, the distance between the accelerating gaps Ln has to be varied according to the formula: (11) To maintain this synchronism, in principle, both the gap and the drift tube length can be varied. A generally applied criterion is to maintain a constant transit time factor according to Eq. (6).
Some examples of Alvarez structures can be found at CERN linac 4 [17] operating at 352 MHz frequency with 3 resonators tanks of 500 mm diameter, 19 m long, 120 Drift Tubes, that accelerate protons from 3 MeV to 50 MeV (=0.08 to 0.31). In this case the distance between gaps varies from 68mm to 264mm. High  cavities: cylindrical structures When the  of the particles increases (>0.5) one has to use higher rf frequencies (>400-500 MHz) to increase the accelerating gradient per unit length. It is possible to demonstrate that DTL structures become less efficient (effective accelerating voltage per unit length for a given input power) for such values of .
In this range of frequencies, cylindrical single or multiple cavities working in the TM010-like mode are used. For a pure cylindrical structure (usually called a "pillbox cavity") the first accelerating mode (i.e. the mode with non-zero longitudinal electric field on axis) is the TM010 mode. It has a well-known analytical solution (obtained solving Maxwell's equations), and its spatial configuration in the case of a pure cylindrical cavity is given in Fig.  6(a). For this mode the electric field has only a longitudinal component, while the magnetic one is purely azimuthal. The corresponding complex phasors are given by [14]: where a is the cavity radius, A is the mode amplitude and p01 (= 2.405) is the first zero of the Bessel function J0.
The resonant frequency of this mode is given by:  The geometry of real cylindrical cavities is somewhat different to that of a pillbox. In fact, one has to also consider the perturbation introduced by the beam pipe, the power couplers to rf generators and any antenna or pick-up used to monitor the accelerating field inside the cavity. For this reason, the actual accelerating mode is called the TM010-like mode. Real cavities and their couplers to the rf generators are designed using numerical codes that solve the Maxwell equations with the proper boundary conditions. A sketch of a cavity fed through a loop or a coaxial probe to an external generator is given in Fig. 6(b), where there are also reported the electric and magnetic field lines and the longitudinal electric field profile on axis. Details of the coupler design can be found in [18]. 8

SW cavity parameters: shunt impedance and quality factor
For a SW cavity the first figure of merit is the shunt impedance defined by [1,2,14,19]: where acc Vˆ is the accelerating voltage for a given dissipated power into the cavity (Pdiss). This parameter qualifies the efficiency of the cavity: the higher its value, the larger is the achievable accelerating voltage for a given dissipated power. As an example, at 1 GHz for a normal conducting (NC) copper cavity a typical shunt impedance of the order of 2 M can be obtained, while a superconducting (SC) cavity, at the same frequency, can reach values of the order of 1 T, due to the extremely lower dissipated power. It is also useful to refer to the following quantity called shunt impedance per unit length: where L is the cavity length, acc Ê .the average accelerating field and pdiss the dissipated power per unit length.
The quality factor of the accelerating mode is then defined by the ratio of the cavity stored energy (W) and the dissipated power on the cavity walls: For a NC cavity operating at 1 GHz the quality factor is of the order of 10 4 while, for an SC cavity, values of the order 10 9 to 10 10 can be achieved.
It can be easily demonstrated that the ratio R/Q is a pure geometric factor and it does not depend upon the cavity wall conductivity or operating frequency. This is the reason why it is always taken as a geometric design qualification parameter. The R/Q of a single cell is of the order of 100.

Multi-cell SW cavities
In linacs, rf cavities are used in systems of multi-cavities. In a multi-cell structure, there is one input coupler that feeds a system of coupled cavities as sketched in Fig. 8. The field of adjacent cells is coupled through the cell irises (and/or through properly designed coupling slots). It is quite easy to demonstrate that, for such structures the shunt impedance is N times the impedance of a single cavity. Moreover, with one source, it is possible to feed a set of cavities with a simplification of the power distribution system layout. On the other hand, the fabrication of multi-cell structures is more complicated than single-cell cavities.

-mode structures
The N-cell structure behaves like a system of N coupled oscillators with N coupled multi-cell resonant modes. As an example, the field configuration of a two-cell resonator is shown in Fig. 7. The mode in which the two cells oscillate with the same phase is called 0 mode, while the one with 180° phase shift is called -mode. It is quite easy to verify that the most efficient configuration (generally used for acceleration) is the -mode, which is shown in Fig. 8 for a system of five cells. In this system, in order to have a synchronous acceleration in each cell, the distance (d) between the centre of two adjacent cells has to be d= v/(2fRF) where v is the particle velocity. As sketched in Fig. 8 this allows to synchronize the beam passage in each cell with the accelerating field, granting a continuous acceleration process. 9 To maintain the synchronism, for ions and protons the cell length has to be increased and the linac will be made of a sequence of different accelerating structures matched to the ion/proton velocity. For electrons, after the injector, d=RF/2 and the linac is made by a series of identical accelerating structures.
Examples of this type of system are the LINAC 4 (CERN) PIMS (PI Mode Structure) that operates at fRF=352 MHz with >0.4 [17] while, for electrons, the superconducting cavities of the European X-FEL that operate with modules of nine coupled cells at 1.3 GHz [20][21].

/2 mode structures
It is possible to demonstrate that in a multi-cell system the different resonant modes are distributed in a curve called "dispersion curve". As an example, the case of a 9-cell structure is reported in Fig. 9. Each mode has a bandwidth proportional to the quality factor [19] and, over a certain number of coupled cavities, the overlap of the tails of adjacent modes can introduce problems for field equalization and structure operability. This limits the maximum number of multi-cell structures to around 10-15. Since the criticality of a working mode depend on the frequency separation between the working mode and the adjacent modes, the /2 mode, from this point of view, is the most "stable" one. Unfortunately, for this mode it is possible to demonstrate that the accelerating field is zero every two cells. One possible solution to use this mode is to put off-axis the empty cells (called coupling cells) like in the system schematically represented in Fig. 10(a). In spite of this mechanical complication with respect to a -mode system (see as example the mechanical drawing of Fig. 10(b)), this allows to increase the number of cells to more than 20 without problems.  These types of structures are used both for electrons than protons. As example in the Spallation Neutron Source [22] there is the Coupled Cavity Linac (CCL) section with 4 modules, each containing 12 accelerator segments. It operates at 805 MHz and accelerates the proton beam from 87 to 186 MeV in a length of about 55 meters.

Travelling wave structures
There is another possibility to accelerate particles: using travelling wave (TW) structures. In TW structures an e.m. wave travels together with the beam in a special guide in which the phase velocity of the wave matches the particle velocity. In this case the beam absorbs energy from the wave and it is continuously accelerated.
Typically, these structures are used for electrons because for such particles the velocity can be assumed constant all along the structure and equal to c, while it would be difficult to modulate the phase velocity for heavy particles that change their velocity during acceleration.
In the simple case of an e.m. wave propagating into a constant cross-section waveguide, the phase velocity is always larger than the speed of light and thus the e.m. wave will never be synchronous with a particle beam. As example in a circular waveguide ( Fig. 11(a)) the first propagating mode with Ez  0 is the TM01 mode, whose longitudinal electric field (neglecting the attenuation) can be expressed by the well know formula [23]: where a is the radius of the waveguide, * z k is the propagation constant, cut is the cut-off angular frequency of the waveguide equal to a cp 01 cut =  . The corresponding phase velocity is given by: which is always larger than c.
The behaviour of the propagation constant as a function of frequency is the well-known dispersion curve and is sketched in Fig. 11(a). It is important to remark that the phase velocity is not the velocity of the energy propagation into the structure, which, instead, is given by the group velocity (vg): (18) and is always smaller than c. In order to slow down the wave phase velocity, the structure through which the wave is travelling, is periodically loaded with irises. A sketch of an iris-loaded structure is given in Fig 11(b) and it can be designed to have the phase velocity equal to the speed of the particles allowing a net acceleration over large distances. The propagating field, in this case, is that of a special wave travelling within a spatial periodic profile (TM01-like mode) and, according to the Floquet's theorem [1,2,23], can be expressed as: In Eq. (19) the propagating constant does not have an analytical expression as in the case of constant crosssection waveguides and the dispersion curve for this type of structures is given in Fig. 11(b) and shows that, at a given frequency, the phase velocity can be equal to (or even slower than) c. In Eq. (19) we have also included the attenuation constant  [1/m] of the accelerating field due to the rf losses in the metallic walls. Typical values of  are in the range 0.2-0.3 1/m. 12 In a TW structure, the rf power enters into the cavity through an input coupler and flows through the cavity in the same beam direction. An output coupler, at the end of the structure, connected to a matched load, absorbs the residual power not transferred to the beam or dissipated in the cavity wall, avoiding reflections, as sketched in Fig. 11(c). If there is no beam, the input power simply dissipates on the cavity walls and the remainder is finally dissipated into the power load. In the presence of a beam current a fraction of this power is, indeed, transferred to the beam itself. TW structures allow acceleration over large distances (few meters, hundreds of cells) with just an input coupler and a relatively simple geometry.
For example, the SLAC electron Linac [24] is composed by more than one hundred 3 m long structures operating at 2.856 GHz while the SwissFEL linac by 96 structures, 2 m long operating at 5.712 GHz [25][26][27].
Similarly to what has been done for SW cavities, it is possible to define some figures of merit for TW structures as well. A complete description of these quantities is given, as example, in [1,2,19,28]. Here we want just to mention three quantities that are generally considered in the definition of the TW parameters. The first one is the attenuation constant , already mentioned, and defined as: where pdiss is the dissipated power per unit length and PF is the power flowing into the structure at a given section. The second one is the shunt impedance per unit length r defined as: where Eacc is the average accelerating field. The higher the value of r, the higher the available accelerating field for a given rf power. Typical values for a 3 GHz structure are 60 M/m. The last quantity is the filling time F defined as the time necessary to the rf wavefront to propagate from the input coupler to the end of a section of length L, and given by: Typical values of the group velocity vg are 1-2% the speed of light and, as a consequence, the filling times are of the order of few hundreds on ns up to 1 s. After one filling time the structure is completely filled of e.m. energy and the beam can be injected and efficiently accelerated. It can be demonstrated that the average accelerating field in a simple TW structure, can be expressed as being PIN the input power.
In Appendix I it is also shown how the SW field of a multi-cell structure can be written as the sum of two counter propagating travelling waves.

Linac technology
An extensive dissertation on linac technology is given in [19]. Here we limit to point out that the linac structures can be realized with normal conducting or superconducting technology depending on the required linac performances in term of average accelerating field, type of particles, rf pulse length (i.e. how many bunches we can contemporary accelerate), duty cycle (i.e. pulsed operation or continuous wave operation) and average beam current.
The materials used for linac structure fabrication are: oxygen-free high conductivity (OFHC) copper for normal conducting structures (both SW and TW) and niobium for superconducting cavities (SW only). OFHC copper is the most common material used for NC structures because it has a very good electrical (and thermal) conductivity, it has a low Secondary Emission Yield (SEY), that allows to minimize multipacting phenomena [29] 13 during structure power up, it shows good performance at high accelerating fields, it is easy to machine with very good roughness (up to the level of a few nm), it can be brazed or welded.
The most common material for the fabrication of SC cavities is niobium for several reasons [31][32][33][34][35][36][37]: it has a relatively high transition temperature (Tc=9.25 K), very low surface resistance when exposed to rf fields, it has a relatively high critical magnetic field, Hc=170-180 mT, it is chemically inert, can be machined and deep drawn, it is available either as bulk or sheet in any size, fabricated by forging and rolling, it can also be used as a coating (e.g. by sputtering) on NC materials like Cu; it has good thermal stability and has a relatively low cost.

9
Beam structure and rf structure Rf structures are fed, in general, by pulses with a certain repetition rate and duty cycle (DC), which is defined as the ratio between the pulse width (Trf_pulse) and the period (Trep) (DC=Trf_pulse/Trep). Each pulse includes from thousands up to several million rf periods as schematically represented in Fig. 12(a). The "beam structure" in a linac is correlated to the "rf structure" since a fraction of the rf pulse is used for beam acceleration (as represented in Fig. 12(b)). SC structures allow operation at very high DC (>1%) up to a continuous wave (CW) operation (DC=100%), because of the extremely low dissipated power, with relatively high accelerating field (>20 MV/m). This means that a continuous (bunched) beam can be accelerated. NC structures can operate in pulsed mode at lower DC (<0.1 %), because of the higher dissipated power with, in principle, larger peak accelerating field (>30 MV/m). In low DC linacs, depending on the application, from one up to few hundreds bunches can be, in general, accelerated.

Longitudinal beam dynamics of accelerated particles
In this second part of the paper the basic principles of the longitudinal and transverse beam dynamics will be illustrated. A complete dissertation is given as example in [1,2].

Synchronous phase
Let us consider a SW linac structure made by accelerating gaps (like a DTL) or cavities as shown in Fig. 13(a). In each gap the accelerating field oscillates in time and the accelerating voltage (V acc ) sketched in Fig. 13(b) can be expressed as: 14 We can assume that the "perfect" synchronism condition is fulfilled for an ideal particle that crosses each gap with a phase s with respect to the accelerating voltage. By definition this phase is called synchronous phase and the particle, synchronous particle. Then, the synchronous particle enters in each gap with a phase s (s=RFts) with respect to the rf voltage, has an energy gain (and a consequent change in velocity) that allows to enter in the subsequent gap with the same phase s with respect to the accelerating voltage and so on. For this particle the energy gain in each gap is simply given by: Looking at the plot of Fig. 13 one case easily understand that both s and -s are synchronous phases. Let us consider the first synchronous phase s (on the positive slope of the rf voltage). If we consider another "nonsynchronous" particle "near" to the synchronous one, that arrives later in the gap (t1>ts, 1>s), this particle will experience a higher voltage (i.e. gaining a slightly larger amount of energy) and thus will have an higher velocity than the synchronous one. Its time of flight to next gap will be reduced, partially compensating its initial delay with respect to the synchronous particle. Similarly, if we consider a particle that enters the gap before the synchronous one (t1<ts, 1<s), it will experience a smaller accelerating voltage, gaining a smaller amount of energy and its time of flight to next gap will increase, compensating the initial advantage with respect to the synchronous particle. On the contrary, if we consider the synchronous particle at phase -s and other particles "near" to it that arrive later or before in the gap, they will receive an energy gain that will increase further their distance with respect to the synchronous one. In conclusion, the synchronous phase on the positive slope of the rf voltage provides a longitudinal focusing of the beam allowing to have a stable beam acceleration. This mechanism is called "phase stability principle". On the contrary, the synchronous phase on the negative slope of the rf voltage is an unstable position.
Since it relies on particle velocity variations, longitudinal focusing does not work for fully relativistic beams (electrons). In this case acceleration "on crest" is more convenient.

Energy-phase equations
The previous intuitive approach can find a more rigorous mathematical formalism. To this purpose, the following variables,  and w, are used to describe a generic particle longitudinal position with respect to the synchronous one. They are defined as follows: 15 where t () is the arrival time (phase) of a generic particle at a certain gap and W is the kinetic energy of the same particle at a certain position along the linac. ts, s and Ws are the same quantities referred to the synchronous particle.
The energy gain per "accelerating cell" (considering as "accelerating cell" one gap plus the two half drift tubes in case of a DTL) of a generic particle and of the synchronous one are respectively: The delta energy gain is then given by: Dividing by the accelerating cell length L and assuming that is the average accelerating field over the cell (i.e. average accelerating gradient) we obtain: where we have approximated On the other hand, the phase variation per cell of a generic particle and of a synchronous particle are: where t is basically the time of flight between two accelerating cells. Considering the variation of  between two accelerating gaps, , and dividing by L we have that ( 1 ): The system of coupled (non-linear) differential equations represented by Eqs. (28) and (30), and reported in the following, describes the motion of a non-synchronous particle in the longitudinal plane with respect to the synchronous one: 1 In the MAT passage we have considered the following approximations:

Small amplitude energy-phase oscillations
Deriving the second equation of (31) with respect to z and assuming an adiabatic acceleration process (i.e. Assuming in the first equation of (31) small oscillations around the synchronous particle that allow to approximate Equation (33) and the condition (34) summarizes what we have intuitively described with the "phase stability principle": if we accelerate on the rising part of the positive rf wave we have a longitudinal force keeping the beam "focused" around the synchronous phase and oscillating during acceleration with spatial angular frequency s. The angular frequency can be simply obtained substituting in Eq. (33) z with sct (and then dz=scdt) and it is related to the angular spatial frequency by: T= ssc.
Each particle during acceleration describes in the longitudinal plane, an ellipse around the synchronous particle, as schematically represented in Fig. 14.
The maximum energy deviation is reached at =0 while the maximum phase excursion corresponds to w=0.
All particles in the bunch occupy an area in the longitudinal phase space called longitudinal emittance and the projections of the bunch in the energy and phase planes give the energy spread and the bunch length as schematically represented in Fig. 14.
From Eq. (33) it is also evident that the angular frequency scale with 1/ 3/2 that means that for ultrarelativistic electrons shrinks to zero and the beam is "frozen" and does not oscillate in the longitudinal plane.

Longitudinal dynamics of low energy electrons
From previous formulae it is clear that there is no motion in the longitudinal phase space for ultra-relativistic particles with >>1. This is the case of electrons, whose velocity is always close to the speed of light even at low energies. For electrons, accelerating structures are designed to provide an accelerating field synchronous with particles moving at v=c, as in the case of TW structures with phase velocity equal to c.
It is interesting to analyze what happens if we inject an electron beam generated in an electron gun (at low energy) directly in a TW structure (with vph=c) and the conditions that allow to capture the beam ( 2 ). The sketch is given in Fig. 15. Particles enter in the TW structure with velocity v<c and, initially, they are not synchronous with the accelerating field. In this part of the accelerator there is a so-called "phase slippage". After a certain distance they can reach enough energy (and velocity) to become synchronous with the accelerating wave ( Fig. 15(a)). This means that they are captured by the accelerator and, from this point on, they are permanently accelerated. If this does not happen (i.e. the energy increase is not enough to reach the velocity of the wave) they are lost.

Phase slippage
We will now describe with a more precise mathematical approach this phenomenon. The accelerating field of a TW structure can be expressed by: where  represents the phase of the particle with respect to the accelerating wave.
The equation of motion of a particle with a position z at time t accelerated by the TW is then, from the Lorentz force, given by: Integrating both terms of Eq. (36) between an initial and a final state [1,38] we can find which is the relation between  and  from an initial condition to a final one: (37) Supposing that the particle reaches, asymptotically, the value fin=1 we have: should be in the interval [-1,1]. This means that, for a given initial injection phase, we always have that in fin   sin sin  that means in fin    . This is the mathematical description of the phase slippage phenomenon as represented in Fig. 15 (b). Another important consequence of Eq. (38) is that, for a given accelerating field and rf frequency, there are only some possible injection phases for which we can capture the beam. Conversely, for a given injection energy (in) and phase in we can find which is the accelerating peak field ( acc Ê ) that is necessary, to have a relativistic beam at phase fin (i.e. that is necessary to capture the beam at phase fin).

Bunch compression
Equation (38) is useful to describe the bunch compression during the capture process. As the injected beam moves up to the crest, in fact, it experiences also a longitudinal bunching, which is caused by velocity modulation (hence the name "velocity bunching"). This is evident plotting the final phases as a function of the injection phases for different accelerating field acc Ê as reported, for example, in Fig. 16 This mechanism can be used to compress the electron bunches in the first stages of acceleration [39].

Capture efficiency and buncher
For a given Eacc we can easily calculate the range of the injection phases in actually accepted in the capture process (i.e. particles whose injection phases are within this range can be captured while the other are lost). Fig. 16(b) illustrate this concept. Assuming an accelerating voltage of Eacc=17 MV/m (and fRF=3 GHz), only the electrons that enter into the TW structure with a phase between -120 and -60 deg are captured, the other are lost. To reduce the number of lost particles there are, in principle two possibilities. The first one is to increase the accelerating voltage, thus increasing the range of phases. The other is to pre-shape the beam in order to increase the number of electrons that occupy the right phase interval. While the first solution requires more rf power to increase the accelerating field, this second approach can be pursued with a simple scheme as reported in Fig. 17, where a typical injector scheme is reported. The scheme foresees the use of a buncher. It is a SW cavity aimed at preforming the particle bunch gathering particles continuously emitted by a source by modulating the energy (and therefore the velocity) of the continuous emitted beam, using the longitudinal E-field of the SW cavity itself. After a certain drift space, the velocity modulation is "converted" in a density charge modulation. The density modulation depletes the regions corresponding to injection phase values incompatible with the capture process. The TW accelerating structure (capture section) is placed at an optimal distance from the buncher, to capture a large fraction of the charge and accelerate it up to relativistic energies. The amount of charge lost using this scheme is drastically reduced, while the capture section provides also further beam bunching. We will now describe more in detail the transverse motion of particles that are accelerated in a linac. The transverse beam dynamics is determined by the effect of the rf fields, by the magnetic elements (quadrupoles or solenoids) and by the collective effects such as space charge forces and wakefields.

Rf transverse forces: defocusing term
The rf fields that accelerate particles act also on the transverse beam dynamics, because of the off axis transverse components of the electric and magnetic field, as schematically represented in Fig. 18(a), where the electric field lines in a generic accelerating gap are reported. More precisely, considering the Maxwell's equations in vacuum and assuming an accelerating SW field of the type reported in Eq. (10), we can calculate the transverse force, as reported in the following: As an example, the transverse forces as a function of the longitudinal coordinate are reported in Fig. 18(b) for an accelerating gap of L= 3 cm, working at fRF=350 MHz, for a =0.1 and for two different injection phases. From the plot it is evident that the transverse forces are equal to zero in the center of the gap (except Fr|B in the case 0), while they have an opposite sign at the entrance and at the exit of the gap itself, as also visible in the schematic picture of Fig. 18(a). It is also evident that the electric field contribution is dominant and that, if the injection phase is negative (as required for longitudinal focusing) the two in/out contributions do not compensate, resulting in an integrated defocusing force. More precisely, from the previous formulae it is possible to calculate the transverse momentum increase due to the rf transverse forces. Assuming that the velocity and particle position do not change across the gap, we obtain to the first order:  21 The formula highlights the defocusing nature of such term (since sin<0), that scales as 1/ 2 . As a consequence, it disappears at relativistic regime (i.e. for electrons 3 ). For a correct evaluation of the defocusing effect in the non-relativistic regime we have also to take into account the velocity change across the accelerating gap, the transverse beam dimensions changes across the gap (with a general reduction of the transverse beam dimensions due to the focusing in the first part). Both contributions give a reduction of the defocusing force but the resulting one is still defocusing.

Rf focusing in electron linacs
We have pointed out that the rf defocusing term is negligible in electron linacs. It is important to mention that, for this type of linacs, there is a second order effect due to the non-synchronous harmonics of the accelerating field that give a net focusing contribution [40]. These harmonics generate a ponderomotive force i.e., a force in an inhomogeneous oscillating electromagnetic field. As discussed in [40] it is possible to demonstrate that we have an average focusing force given by this expression: where the term () is a factor that depends on the harmonic content of the accelerating field and is of the order of 0.1 [40]. This harmonic content is larger in SW cavities because of the presence of the wave that propagate in the opposite direction with respect to the beam (as pointed out in Appendix I). With accelerating gradients of few tens of MV/m it is quite easy to verify that this transverse gradient can easily reach the level of MV/m 2 .

Collective effects: space charge forces
Collective effects are phenomena related to the number of particles in a bunch, and, in linacs, they can play a crucial role in the longitudinal and transverse dynamics of intense beams. They are typically related to space charge effects and wakefield and here we will focus only on the former. This effect is generated by the Coulomb repulsion between particles. If we consider a uniform and infinite cylinder of charge with radius Rb moving along the longitudinal axis z with an average current I, it is quite easy to verify that the force experienced by a generic particle inside the cylinder at a radius rq is given by: This simple example gives us a couple of interesting information: the effect of space charge is of particular concern for low energy particles and high currents, because the space charge forces scale as 1/ 2 and linearly with the current I. In this particular example the force is linear with the displacement rq, but in general space charge forces are non-linear and depend on the beam particle distribution.

Magnetic focusing, transverse oscillations and -function
In the previous paragraphs we pointed out that the rf and space charge forces (or the natural divergence of the beam given by a generic source) give a defocusing effect and need to be compensated, in order to take under control, the transverse beam dynamics in a linac. For this reason, quadrupoles are used to focus the beam and, at low energies, also solenoids. We will consider, in particular, the first type of elements. As done in all accelerator machines with strong focusing magnets, quadrupoles are used in an alternating configuration, since they are focusing in one plane and defocusing into the other. In a linac they are interleaved by either accelerating gaps or accelerating structures. The type of magnetic configuration and the magnets distance depend on the type of particles, energy, beam intensity and beam dimensions requirements. Due to the alternating quadrupole focusing system, each particle (as in synchrotrons) performs transverse oscillations and the equation of motion in the transverse plane is of the type: The K(s) term takes into account the magnetic configuration and the rf defocusing term that exhibits a linear behavior with the particle displacement, while the FSC term is the non-linear space charge term.
If we neglect the space charge forces and we assume K 2 >0, the solution of the single particle trajectory described by the Eq. (44) is a pseudo-sinusoid described by the equation ( 4 ): where the characteristic -function depend on the magnetic and rf configuration along the linac and the constants 0 and 0 depend on the initial conditions of the particle at the entrance of the linac (i.e. position and angle). Fig. 19(a) shows, as an example, different particle trajectories corresponding to different initial conditions. It is quite easy to verify that, because of Eq. (45), all particles oscillations are contained within an envelope that scales with the square root of the -function, sketched, as an example in Fig 19(a) and also the final transverse beam dimensions (x,y(s)) vary along the linac within the same envelope.
Because of the regular magnetic and accelerating structure configuration, the -function is "locally" periodic, and it is useful to refer to the focusing period (Lp) that is the length after which the focusing structure is repeated (usually equal to N). The transverse phase advance per period is defined as: And, for transverse oscillation stability, should be in the range 0<< [1]. The quantity /Lp is called phase advance per unit length.

Smooth approximation of the transverse oscillations
In case of "smooth approximation" of the linac, we consider an average effect of the quadrupoles and rf and, as a consequence, a constant -function. Assuming a focusing structure of the type sketched in Fig 20, which alternates focusing quadrupoles with accelerating gaps (also called FODO lattice) we obtain a simple harmonic motion along s coordinate of the type: (47) In particular for this simple case, we obtain that the phase advance per unit length K0 is equal to [1]: where G [T/m] is the quadrupole gradient and l [m] is the quadrupole length, and all other quantities have been already defined in the previous sections ( 5 ). In the previous formula it is possible to recognize the two contributions of the magnetic focusing and of the rf defocusing (with opposite sign with respect to the previous one). This simplified approach allows to make several considerations. First of all, the rf defocusing term scales with fRF (=1/RF), and this sets a higher limit to the working frequency of the cavities (i.e. at lower particle energies it is better to operate at lower frequency). Moreover, as already pointed out, the rf defocusing term plays a crucial role at low energy, since the defocusing term scale as 1/() 3 .
If we consider also the space charge contribution and the simple case of an ellipsoidal beam of charge Q (that gives linear space charge forces) we obtain for K0 the following expression [1]:

General considerations on linac optics design for protons and ions
According to what illustrated, the beam dynamics is completely dominated by space charge and rf defocusing forces. Focusing is usually provided by quadrupoles that are also integrated in the drift tubes of DTL structures. The phase advance per period () should be, in general, in the range 30-80 deg [1,2]. This means that, at low energy, we need a strong focusing term (short quadrupole distance and high quadrupole gradient) to compensate for the rf defocusing, but the limited space in the drift tubes (proportional to ) limits this achievable integrated gradient and, as a consequence, the beam current. As  increases, the distance between focusing elements can increase:  in the DTL goes, as example, from 70 mm at 3 MeV, fRF=350 MHz to 250 mm at 40 MeV and can be increased to 4-10  at higher energy (>40 MeV). As already pointed out, the overall linac is made of a sequence of structures, matched to the beam velocity, and where the length of the focusing period increases with energy. As  increases, longitudinal phase error between cells of identical length becomes small, and we can have short sequences of identical cells (instead of cells all with different dimensions) with a reduction of the overall construction costs. From beam dynamics simulations it is possible to calculate the beam radius along the structures that allows to calculate the margin between beam radius and physical apertures.

General considerations on linac optics design for electrons
For electrons, space charge forces act only at low energy or high peak current. Below 10-20 MeV (injector) the beam dynamics optimization has to include emittance compensation schemes using, typically, solenoids. At higher energies, no space charge and no rf defocusing effects occur, but we have rf focusing due to the ponderomotive force in accelerating structures. In this part of the linac focusing periods up to several meters can occur. Nevertheless, the optics design has to take into account longitudinal and transverse wakefields (due to the higher frequencies used for acceleration) that can cause energy spread increase, head-tail oscillations and multibunch instabilities. The longitudinal bunch compression schemes based on magnets and chicanes have also to take into account, for short bunches, the interaction between the beam and the emitted synchrotron radiation in bending magnets (Coherent Synchrotron Radiation effects-CSR) [41,42]. All these effects are important especially in linacs for Free Electron Lasers (FEL) that require extremely good beam qualities, short bunches and high peak current.

Radio Frequency quadrupoles (RFQ)
At low proton (or ion) energies (0.01), space charge defocusing is strong and quadrupole focusing is not very effective (because of the low ). Moreover, cell lengths become small and conventional accelerating structures (DTL) are very inefficient. At these energies, it is used another type of structure, called Radio Frequency Quadrupole (RFQ), invented in the '60 by Kapchinskiy and Tepliakov [43]. These structures allow to simultaneously provide transverse focusing, acceleration and bunching of the beam. The sketch of the structure and the picture of a fabricated one are given in Fig. 21. The transverse focusing effect is due to the fact that the resonating mode of the cavity (between the four electrodes) is the quadrupole mode (TE210) whose electric field lines are sketched in Fig. 22(a). The working principle of a quadrupole electric mode is similar to that of a magnetic quadrupole with no field in the center of the structure and a transverse electric field that increases linearly with beam off-axis and that is focusing in one plane and defocusing in the other. The rf alternating voltage on the electrodes produces an alternating focusing channel with a period rf.
The acceleration process is achieved by means of a longitudinal modulation of the vanes with period RF. This creates a longitudinal component of the electric field (as given in Fig. 22(b)) that accelerates the beam (the modulation corresponds exactly to a series of rf gaps).
The third effect, i.e. the bunching, is generated by changing the modulation period (distance between electric field maxima), since it is designed to change the phase of the beam with respect to the rf field during beam acceleration, while the amplitude of the modulation can be varied to change the accelerating gradient. The continuous beam enters the first cell and it is bunched around the -90 deg phase (bunching cells), progressively the beam is bunched and accelerated (adiabatic bunching channel) and, only in the last cells we have a switch on a pure acceleration process. The process is illustrated in Fig. 22(c).
The mathematical description of this process would require a dedicated course and is out of the scope of the present proceeding. Details can be found in [1,44].

Choice of the frequency of operation and accelerating structures
The choice of the frequency and type of accelerating structures depends on several factors such as: type of particles to be accelerated, average beam current and duty cycle, available space and compactness, cost. Table I schematically illustrates how the accelerating structure parameters scale with frequency [19]. For NC structures r increases with frequency as f 1/2 and this pushes to adopt higher frequencies. Nevertheless, at high frequencies the beam-cavity interaction due to wakefields becomes more critical (w z  f 2 , w ⊥  f 3 ). On the other hand, for SC structures it can be demonstrated that the power losses increase with f 2 and, as a consequence, r scales with 1/f, this pushes to adopt lower frequencies.
Higher frequencies allow to achieve, in general, higher accelerating gradients in NC structures but require higher mechanical precision in the realization of the structures. Moreover, at very high frequencies (>10-12 GHz) power sources are either commercially not available or very expensive. On the other hand, at low frequencies one needs more bulk material and machines have generally a larger footprint.
In DTL, for protons and ions, the accelerating cell dimensions (that scale as c/fRF) become not practical at high frequency (as example at 3 GHz and beta=0.1 the accelerating cells are 10 mm) and also the insertion of magnetic elements in the drift tubes for transverse focusing is not possible. Also, the rf defocusing effects scale as 1/f and they do not allow a stable acceleration of the beam. 26 In general, a given accelerating structure has a curve of efficiency (shunt impedance per unit length) with respect to the particle energy and, if it works at given , the same structure, becomes not efficient at larger  and the transition to another type of structure is necessary.
As a general consideration normal conducting linacs require high peak power from power sources and also high average power in case of operation at relatively high DC (0.1-1%). For high duty cycle linacs (>1%) the use of superconducting structures is the only possible solution.
For all previous considerations, it is possible to make some general considerations schematically reported in Table II. In low duty cycle (<10 -3 ) electron linacs higher frequencies (up to X band) can be used for both SW than TW structures. Proton and ion linacs use low frequencies (40-500 MHz) up to 0.5 with RFQ or DTL structures. At higher energies (>0.5) SW multi cell structures at higher operating frequencies are used (from 500 MHz up to few GHz).
Superconducting multi cell cavities working on the -mode, are used in high duty cycle linacs starting from  larger than 0.5 and, in case of protons or ions, combined with low frequency structures in the first stages of acceleration. A complete review of superconducting accelerating cavities is given in [45].  Appendix I: SW field as a sum of two counter-propagating TW waves.
In a multi cell SW structure working on the -mode, the accelerating field can be expressed in a simplified form, as: (A5) For each H we have different trajectories in the longitudinal phase space as schematically reported in Fig. A1.
The oscillations are stable within a region bounded by a special curve called separatrix whose equation is: The region inside the separatrix is called rf bucket and the dimensions of the bucket shrink to zero if s=0. 28 Trajectories outside the rf bucket are unstable and the rf acceptance is defined as the maximum extension in phase and energy that we can accept in an accelerator. They are given by: (A7)