This page gives a general description of how lasers and masers are described and simulated for Project Elara.
Note: For specific modelling of free-electron laser components, including electron guns and undulators, please see Numerical modelling of electron beams.
Physical foundations of lasers
All lasers, including free-electron lasers (and masers), produce electromagnetic waves that are tightly collimated into a beam. This beam is mathematically described by the Gaussian beam, which is a solution to Maxwell’s equations that is given (in cylindrical coordinates by:
The Gaussian beam represents the beam produced by an idealized laser, and can be derived from some basic physical assumptions along with physically-imposed boundary conditions (here whenever we say “lasers” we mean “lasers and masers”). This holds for (nearly) all lasers, regardless of their mode of operation, since it is a product of the specific boundary conditions imposed by the design of laser cavities, which have a large number of commonalities across different designs.
In particular, the goal of a laser cavity is to achieve resonance: the amplification of electromagnetic energy along a specific axis to create a powerful, highly-collimated beam. For lasers that operate in the visible light range, this is also known as optical resonance. This is typically accomplished by means of two mirrors, a fully-reflective (also called silvered) mirror, and a partially-reflective (also called semi-silvered) mirror. The two mirrors are connected by a tube that allows light (or microwaves for masers) to pass through unimpeded. Within the tube, it is common (though not always) to find a material that fills the interior of the tube: this is called the gain medium, and it can be everything from a gas (carbon dioxide, helium, neon, and hydrogen are all possibilities) to a semiconductor (in laser diodes) to some type of plastic (for certain types of masers). The gain medium acts as both a source that generates the electromagnetic field and a material that amplifies the electromagnetic field within the laser cavity: it is said to be pumped when it receives (is “pumped with”) energy from an external source, like an electric arc, flash lamp, or even another laser. A general diagram of a laser cavity is shown below:
The partially reflective mirror allows some of the electromagnetic waves in the cavity to escape while reflecting the rest of the rest back into the cavity, ensuring that energy is continually built up within the cavity to further amplify the field. The escaped waves are what we observe as a characteristic laser beam, and gives lasers their distinctive properties.

An image of a He-Ne laser, a common laser type. The walls of its optical cavity are glass (transparent), while two mirrors at the end achieve optical resonance necessary for amplification.
To be able to model lasers (and masers) effectively, it is necessary to have an in-depth understanding of the Gaussian beam solution, and how it arises from the boundary conditions imposed by the physical construction and materials used within the laser cavity. We will describe this, and more, in depth throughout the guide.
Standard derivation of the Gaussian beam
The most basic derivation of the Gaussian beam starts by assuming that the electric field is transverse (perpendicular) to the axis of propagation, and takes the form:
Where is the direction the beam propagates (the optical axis or transmission axis). By substituting this into the Helmholtz equation, we get the paraxial Helmholtz equation1:
Note that if we define the paraxial Helmholtz equation can also be written in a more familiar form:
We can now solve the paraxial Helmholtz equation. Since laser cavities are typically cylindrical, it is conventional to use cylindrical coordinates instead of Cartesian coordinates . If we transform the PDE to cylindrical coordinates, the paraxial Helmholtz equation reads:
Now, by assuming that the beam has azimuthal symmetry (that is, it doesn’t depend on the azimuthal angle ), the derivative with respect to drops out, giving us:
To derive the Gaussian beam solution in particular, we assume that takes the form of a Gaussian profile2:
Where describes the beam width, and describes the beam curvature. It is possible to prove why the beam must take this form, though it is not exactly a simple derivation. A heuristic is that since we know that any physical EM wave must go to zero as and , we must pick an appropriate function that decays smoothly to infinity, so a Gaussian makes sense. Meanwhile, must be a function of to satisfy the requirement that a beam must diverge over space as per the predictions of electromagnetic theory. We can then work backwards to find the correct such that the beam diverges exactly at the diffraction limit, giving us the Gaussian beam solution.
Alternative derivation of the Gaussian beam
If we don’t start with any approximation and use the standard Helmholtz equation , we can also derive the Gaussian beam, albeit through a much more convoluted process. The idea is to first do separation of variables in cylindrical coordinates. Assuming some basic boundary conditions (namely that the solution doesn’t explode at zero or infinite distance), this gives you the general solution in terms of , which are the Bessel functions of the first kind. The general solution reads as follows:
Here, the coefficients are unknown and must be determined. A more rigorous and step-by-step derivation can be found in Solving for the fields in a hollow waveguide. Now, if we assume azimuthal symmetry (symmetry about ) and assume continuous coefficients (such that the sum becomes an integral), we have:
Where we choose the mode since it is the lowest-order (and thus the dominant) mode. Factoring out everything that does not explicitly depend on ( is independent of ) we have:
Now, to get the Gaussian beam solution, we assume that the beam is symmetric and its energy is concentrated along the optical axis, so it can be modelled by a Gaussian function in the form:
Where and are some undetermined constants. This gives us:
Here, the extra factor of in comes from the fact that the integral is an (inverse) Hankel transform. This particular transform has a well-known solution in the form , where is a constant that is related to . This gives us:
This is not quite the correct solution but it is pretty close, and if we choose our Gaussian ansatz more carefully, then we can derive the exact solution.3
Applicability of the Gaussian beam solution
Ideally, the electric field of any laser - including a free-electron laser - would be both internally and externally described by Gaussian beam. A more accurate representation that accounts for the imperfections in a Gaussian beam is that the electric field is described by a superposition of Hermite-Gaussian modes, which are each labelled , where are integers. The lowest mode () is the ideal case and corresponds to the Gaussian beam, while higher-order modes describe small correction to describe realistic laser/maser beams. However, in practice, numerically obtaining this result is not as simple. First, we must impose periodic boundary conditions azimuthally (that is, ) with as . Since the electric field and its derivative are non-vanishing on the partially-transmissive side of the laser cavity, neither Dirichlet or Neumann boundary conditions would suffice; rather, it would be necessary to use a complicated partially-absorbent layer to describe the fact that some light can escape from the semi-silvered side. This requires a much more complicated model, which we’ll discuss next.
Modelling realistic laser resonant cavities
As we discussed prior, to solve for an exact solution for the electromagnetic field both inside and outside a laser cavity, we cannot just a priori assume the Gaussian beam solution. Rather, we must solve the full boundary-value problem of the Helmholtz equation; crucially, we will not use the paraxial approximation here, as we want to find an exact solution. The exact details for solving this boundary-value problem are given in RF cavity simulation with aperture.
Conventional laser/maser modelling
To model conventional lasers, which are by definition quantum devices (from stimulated emission in the LASER acronym), requires a combination of classical and quantum models. Lasers can vary greatly in terms of pumping mechanism (or lack thereof), lasing wavelength, number of levels, etc. so it is not easy to come up with a model general enough to describe all (quantum) laser systems.
Accordingly, to be able to create a basic model that can be numerically and analytically-solved, we must use some approximations. First, we assume that even in three-level or four-level systems, the transition that leads to stimulated emission is the dominant contribution to the laser’s overall operation. This assumption can be justified (to some extent) by the fact that even three- and four-level systems generally have just one transition that produces stimulated emission, whereas the other transitions are in generally either non-radiative or produce spontaneous emission.
Second, we assume that we can separately analyze the macroscopic and microscopic behavior of lasers. In more technical terms, this means that we can analyze lasers at a macroscopic level with classical electrodynamics (i.e. with electric and magnetic fields that obey the Maxwell equation) while analyzing the microscopic behavior of laser with quantum electrodynamics. This is justified by the fact that while lasers function because of quantum phenomena (involving individual atoms and photons), the light they produce at macroscopic scales (where we consider quadrillions of atoms and photons) is accurately described by the Maxwell equations. This also means that we can use the model we already described for modelling basic laser cavities to model the macroscopic-scale behavior of lasers, saving us a lot of work!
Next, let’s look at modelling the microscopic behavior of lasers. The most common quantum model of lasers is the Jaynes-Cummings model, which describes the interaction of an atom with a quantized electromagnetic field. It is based on the Jaynes-Cummings Hamiltonian, given by4:
There is a bit of explaining to do Here, is the oscillation frequency of the electromagnetic field (also called the resonant frequency of the system), and is the transition frequency, where is the difference in the upper and lower energy levels in the two-level system. is based on the geometric characteristics of the laser cavity, which restricts the electromagnetic field to only certain modes, each described by integer . Considering only the fundamental mode (), a laser cavity of length would have , where is the speed of light and is the wavenumber of the electromagnetic field, which is always for the -th mode.
Note: the Jaynes-Cummings model requires to be set as an input parameter, and it doesn’t tell us what the value of should be. Instead, one usually obtains based on consulting a database (such as NIST’s atomic spectra database) for the type(s) of atom(s) that the laser’s gain medium is filled with.
Continuing on, is the Rabi frequency and is a function of both and . Lastly, is the spin operator, which is used as a simplified model of the atom (it doesn’t mean the atom actually has spin, it is just a model that approximates the two dominant energy levels of the atom). Lastly, is the quantized electric field operator, given by:
Where are the creation and annihilation operators that model the emission and absorption of photons, is the energy associated with zero-point fluctuations of the electromagnetic field in the cavity, and is the volume of the cavity. is the Pauli -operator, which corresponds to the matrix:
Phew, that’s a lot! Luckily, there exists free and open-source software like QuTiP that can be used to solve the Jaynes-Cummings model, which (among other things) helps us understand the intensity of the radiation through time, as well as the population of the upper and lower levels. These are all crucial for understanding stimulated emission and the overall performance of the laser.
Note: An excellent online video series on quantum optics (including the Jaynes-Cummings model) from LMU Munich University can be found at this YouTube link.
Free-electron laser/maser modelling
Free-electron lasers/masers are an exception to the standard methods of modelling lasers because unlike regular lasers, they operate via classical principles. (Note however that most conventional lasers are modelled using a mixture of classical and quantum methods). More specifically, they use clever techniques to amplify synchrotron radiation from electrons accelerated via a magnetic field and achieve coherence.
The basics of free electron masers and a theoretical model has already been discussed in Free-electron maser physics and Numerical modelling of electron beams. Accordingly, we use the same coordinate conventions as in Free-electron maser physics, where is the optical axis, is the direction parallel to the north-south axis of the magnets, and the direction perpendicular to the magnets. In that same article, we arrived at a model given by:
Where is the velocity of the electrons, is the magnetostatic field generated by the magnets in the undulator cavity, are the fields of the moving electrons, and are the radiation fields of standing waves in the cavity. This is quite a complicated model so let’s first try to solve it analytically with suitable approximations. First, we use the result from Free-electron maser physics, where we derived that takes the form:
Thus we have , where and is the spatial period of the magnets. We will also use the approximate solution of the Lorentz force equation from Numerical modelling of electron beams, which tells us that:
Where we set for electrons. This solution is true assuming that the electron is not moving beyond , that is, moving at slower than 50% of the speed of light, and that the electric field doesn’t affect the electrons. The first assumption can be kept for the purposes of our simplified solution, but the second must be altered. This is because the electric field in an undulator does affect the electrons. As the synchrotron radiation of the electrons is reflected by the walls of the cavity, it forms standing waves, which corresponds to an electric field given by:
Where is the frequency of the waves’ oscillations in time, and comes from the boundary conditions of the problem. Now, the electrons do not move with uniform velocity, but rather their velocities follow a roughly Gaussian distribution. This means the probability distribution of electron velocities would follow:
Where here, is the probability (density) for an electron to have velocity (we assume no upper bound for the max velocity of electrons here, other than ). This means that the electric field in the cavity is, in general, a sum of all possible :
This means that while the electric field is spatially monochromatic, it is not monochromatic in time, as the electrons emit radiation of different temporal frequencies depending on their velocity, leading to interference. However, this changes when we also consider the effects of the standing waves on the electrons, which comes from the electromagnetic field confined within the optical (resonant) cavity.
Since the Lorentz force is linear in the non-relativistic regime, we can simply add a linear correction to compensate for the effects of the standing waves (we ignore the time component for now, since the spatial variation of the electric field is dominant in determining the electron trajectories except for very, very long distances). By substitution of the Lorentz force for an electric field, we have:
The electric field is only along , so this simplifies to:
This differential equation is nonlinear, so we must linearize it with . Thus we have:
Which gives us the solution:
The complete solution is obtained by adding our correction . Assuming that the fundamental mode () is dominant, we have:
Notice how the electrons are no longer moving at a constant speed along , but rather speed up and slow down in a harmonic fashion. This is the phenomenon of microbunching, where the electrons longitudinally move forwards and backwards in “bunches” based on their oscillation frequency , which is restricted to specific values of . This means that each bunch of electrons is in phase with one another, leading to constructive interference between the radiation they emit, so the electric field is no longer an integral over ; rather, it becomes just a sum:
This is a generalized result (Fourier series) for a closed-off undulator with perfectly-reflecting mirrors on both sides in one dimension. Applying the specific boundary conditions we discussed at the start of the guide - as well as applying the paraxial approximation - gives us the Gaussian beam as the particular solution.
Achieving resonance in free electron lasers
For a free-electron laser, a key factor in its performance is how well its radiative frequency matches with the resonant frequency of the laser cavity.
Numerical simulations for free electron lasers/masers
General foundations
A free-electron laser (or maser) is quite complicated to simulate, as it is a multiphysics problem: interactions between at least four (if not more) dynamical systems must be considered:
- The magnetostatic field generated by the magnets inside the undulator
- The electron beam and its trajectory in the static magnetic field of the undulator magnets
- The electromagnetic radiation ( field) caused by the transverse (synchrotron) and longitudinal (pondermotive) acceleration of the electrons
- The electromagnetic waves propagating in the laser/maser cavity, which requires solving the (paraxial) Helmholtz equation for the electric/magnetic fields as an eigenvalue problem to obtain the modal decomposition of the field within the cavity
While theoretical models (like the one outlined in Free-electron maser physics) can be solved exactly in simple, idealized cases, they cannot be solved exactly for most cases. It is then necessary (and almost always necessary in general) to use a numerical solver. For this, it is possible to write custom code in association with general PDE/ODE solvers like FreeFEM (for the magnetic fields) and SciPy (for numerical integration of beam trajectories).
Software implementations
However, there exist dedicated software specifically designed for computer simulations of particle beams and undulators, such as the open-source OSCARS software from Brookhaven National Laboratory with extensive examples and support for importing CAD models (a must-have for realistic free electron laser/maser designs). It is recommended to use these when possible, instead of custom-written solvers, for improved performance and accuracy.
For visualization, an exported .vtk file is very useful, as it can be exported to professional visualization software like Paraview.
Reference table
The fundamental parameters of an undulator are:
| Name | Symbol | Units |
|---|---|---|
| Electron energy | keV, MeV, GeV | |
| Electron beam voltage | kV, MV, GV (for high-energy installations) | |
| Undulator magnetic field strength | T, Gauss | |
| Undulator (spatial) period | cm | |
| Number of magnet pairs along axis | dimensionless |
Note that some of these are interrelated. For instance, (where is the elementary charge).
Footnotes
-
From the Wikipedia article on the paraxial Helmholtz equation ↩
-
See Section 2.4, Paraxial Wave Equation and Gaussian Beams from the MIT OpenCourseWare course Fundamentals of Photonics: Quantum Electronics. Despite the name, note that the derivation is entirely classical. ↩
-
Also see this Physics SE article for a more rigorous semi-derivation ↩
-
See the Wikipedia article on the Jaynes-Cummings model and also the article on detuning. ↩