# Spectral Line Inversions

Spectral lines carry a wealth of information on the physical properties of the medium in which they were formed. This information is encoded in the subtle details of their shape and their state of polarization. Spectral line inversion codes are tools designed to decipher this information, allowing one to extract the physical properties of the medium (atmosphere) in which the lines are formed.

Inversion codes typically have two distinct components: one that carries out the forward modeling of the spectral line, and another one that deals with the inversion problem itself. Several different approaches exist to tackle each one of these.

## The Forward Problem

The forward problem consists of finding the solution to the Radiative Transfer Equation (RTE) given the physical conditions of the atmosphere and a set of assumptions that determine the behavior of the light as it travels through the medium. The solution to the RTE is the spectrum of the intensity and polarization of the light. In terms of physical understanding, it is in these assumptions where the difference among the available codes stems. Broadly speaking, one can encounter three different approaches, listed here in order of increasing complexity:

1. The Milne-Eddington (ME) approximation makes the assumption that the properties of the atmosphere are constant with height, except for the source function, which is allowed to vary linearly with optical depth. Most of the parameters of the model atmosphere serve the purpose of parametrizing the shape of the spectral line, and don’t translate directly into thermodynamical physical quantities such as density or temperature.
2. The LTE (Local Thermodynamical Equilibrium) approximation assumes that the populations of the energy levels of the atoms depend only on the local values of temperature and density. Under this assumption, the RTE can still be solved analytically. Actual thermodynamical magnitudes (rather than parameters that describe the shape of the spectral line) go into the mathematical formulation and become an output of the spectral line inversion.
3. Non-LTE solutions to the RTE can be more or less comprehensive in the details of the physical modeling of particle-radiation interaction. They all have in common, however, that they take into account the non-local interaction between matter and light. The populations of the energy levels of the atoms are obtained by solving the Statistical Equilibrium Equations (SEE) which, in turn, depend on the solution of the RTE, and vice-versa. This is a complex non-linear problem that does not have an analytical solution. Different numerical techniques have been developed to tackle this problem in an iterative manner in order to find a self-consistent solution in the least amount of time.

Generally speaking, the ME and LTE assumptions are valid in the Photosphere, whilst the general non-LTE formulation is necessary to interpret Chromospheric radiation. However, the ME approach is not able to reproduce asymmetries in the spectral line morphology. Figure 1 (courtesy of R. Casini) shows a schematic of the general inversion problem. The green-shaded area encompasses the full forward calculation, which requires solving the radiative transfer and the statistical equilibrium equations in a self-consistent manner. As the arrows indicate, the solution to each one of these feeds back into the other.