Contrary to popular belief, the modeling of gravitational lenses to determine the mass distribution of a lens is not a "black art." It is, however, an area in which the lensing community has communicated results badly. There are two main problems. First, many modeling results seem almost deliberately obfuscatory as to what models were actually used, what data were fit and what was actually constrained. Not only do many lens papers insist on taking well known density distributions from the dynamical literature and assigning them new names simply because they have been projected into two dimensions, but they then assign them a plethora of bizarre acronyms. Sometimes the model used is not actually the one named, for example using tidally truncated halos but calling them isothermal models. Second, there is a steady confusion between the parameters of models and the aspects of the mass distribution that have actually been constrained. Models with apparently very different parameters may be in perfect accord as to the properties of the mass distribution that are actually relevant to what is observed. Discussions of non-parametric mass models then confuse the issue further by conflating differences in parameters with differences in what is actually constrained to argue for non-parametric models when in fact they also are simply matching the same basic properties with lots of extra noise from the additional and uninteresting degrees of freedom. In short, the problem with lens modeling is not that it is a "black art," but that the practitioners try to make it seem to be a "black art" (presumably so that people will believe they need wizards). The most important point to take from this section is that any idiot can model a lens and interpret it properly with a little thinking about what it is that lenses constrain.

There are two issues to think about in estimating the mass distributions of gravitational lenses. The first issue is how to model the mass distribution with a basic choice between parametric and non-parametric models. In Section B.4.1 we summarize the most commonly used radial mass distributions for lens models. Ellipsoidal versions of these profiles combined with an external (tidal) shear are usually used to describe the angular structure, but there has been recent interest in deviations from ellipsoidal distributions which we discuss in Section B.4.4 and Section B.8. In Section B.4.7 we summarize the most common approaches for non-parametric models of the mass distribution. Since this is my review, I will argue that the parametric models are all that is needed to model lenses and that they provide a better basis for understanding the results than non-parametric models (but the reader should be warned that if Prasenjit Saha was writing this you would probably get a different opinion).

The second issue is to determine the aspects of the lens data that actually constrain the mass distribution. Among the things that can be measured for a lens are the relative positions of the components (the astrometric constraints), the relative fluxes of the images, the time delays between the images, the dynamical properties of the lens galaxy, and the microlensing of the images. Of these, the most important constraints are the positions. We can usually measure the relative positions of the lensed components very accurately (5 mas or better) compared to the arc second scales of the component separations. Obviously the accuracy diminishes when components are faint, and the usual worst case is having very bright lensed quasars that make it difficult to detect the lens galaxy. As we discuss in Section B.8, substructure and/or satellites of the lens galaxy set a lower limit of order 1-5 mas with which it is safe to impose astrometric constraints independent of the measurement accuracy. When the source is extended, the resulting arcs and rings discussed in Section B.10 provide additional constraints. These are essentially astrometric in nature, but are considerably more difficult to use than multiply imaged point sources. Our general discussion of how lenses constrain the radial (Section B.4.3) and angular structure (Section B.4.4) focus on the use of astrometric constraints, and in Section B.4.6 we discuss the practical details of fitting image positions in some detail.

The flux ratios of the images are one of the most easily measured constraints, but are cannot be imposed stringently enough to constrain radial density profiles because of systematic uncertainties. Flux ratios measured at a single epoch are affected by time variability in the source (Section B.5), microlensing by the stars in the lens galaxy in the optical continuum (see Part 4), magnification perturbations from substructure at all wavelengths (see Section B.8), absorption by the ISM of the lens (dust in the optical, free-free in the radio) and scatter broadening in the radio (see Section B.8 and Section B.9). Most applications of flux ratios have focused on using them to probe these perturbing effects rather than for studying the mean mass distribution of the lens. Where radio sources have small scale VLBI structures, the changes in the relative astrometry of the components can constrain the components of the relative magnification tensors without needing to use any flux information (e.g. Garrett et al. [1994], Rusin et al. [2002]).

Two types of measurements, time delays (Section B.5) and microlensing by the stars or other compact objects in the lens galaxy (Part 4) constrain the surface density near the lensed images. Microlensing also constrains the fraction of that surface density that can be in the form of stars. To date, time delays have primarily been used to estimate the Hubble constant rather than the surface density, but if we view the Hubble constant as a known quantity, consider only time delay ratios, or simply want to compare surface densities between lenses, then time delays can be used to constrain the mass distribution. We discuss time delays separately because of their close association with attempts to measure the Hubble constant. Using microlensing variability to constrain the mass distribution is presently more theory than practice due to a lack of microlensing light curves for almost all lenses. However, the light curves of the one well monitored lens, Q2337+0305, appear to require a surface density composed mainly of stars as we would expect for a lens where we see the images deep in the bulge of a nearby spiral galaxy (Kochanek [2004]). We will not discuss this approach further in Part 2.

Any independent measurement of the mass of a component will also help to constrain the structure of the lenses. At present this primarily means making stellar dynamical measurements of the lens galaxy and comparing the dynamical mass estimates to those from the lens geometry. We discuss this in detail in Section B.4.9. For lenses associated with clusters, X-ray, weak lensing or cluster velocity dispersion measurements can provide estimates of the cluster mass. While this has been done in a few systems (e.g. X-rays, Morgan et al. [2001], Chartas et al. [2002]; weak lensing, Fischer et al. [1997]; velocity dispersions, Angonin-Willaime, Soucail & Vanderriest [1994]), the precision of these mass estimates is not high enough to give strong constraints on lens models. X-ray observations are probably more important for locating the positions of groups and clusters relative to the lens than for estimating their masses.

The most useful way of thinking about lensing constraints on mass distributions is in terms of multipole expansions (e.g. Kochanek [1991a], Trotter, Winn & Hewitt [2000], Evans & Witt [2003], Kochanek & Dalal [2004]). An arbitrary surface density () can be decomposed into multipole components,

(B.43) |

where the individual components are angular averages over the surface density

(B.44) |

The first three terms are the monopole
(_{0}), the
dipole (*m* = 1) and the quadrupole (*m* = 2) of the lens.
The Poisson equation
^{2}
=
2 is separable in polar
coordinates, so a multipole decomposition of the effective potential

(B.45) |

will have terms that depend only on the corresponding multipole of the
surface density,
^{2}
_{cm}()
cos(*m* ) =
2_{cm}()
cos(*m* ).
The monopole of the potential is simply

(B.46) |

and its derivative is the bend angle for a circular lens,

(B.47) |

just as we derived earlier (Eqn. B.3). The higher order multipoles are no more complicated, with

(B.48) |

The angular multipoles are always composed of two parts. There is an
interior pole
_{cm,int}() due to the multipole
surface density interior to
(the integral from
0 < *u* < )
and an exterior pole
_{cm,ext}()
due to the multipole surface density exterior to
(the integral from
< *u* <
).
The higher order multipoles produce deflections in both the radial

(B.49) |

and tangential

(B.50) |

directions, where the radial deflection depends on the derivative of
_{cm} and
the tangential deflection depends only on
_{cm}.
This may seem rather formal, but the multipole expansion provides the basis
for understanding which aspects of mass distributions will matter for lens
models. Obviously it is the lowest order angular multipoles which are most
important. The most common angular term added to lens models is the
external shear

(B.51) |

with dimensionless amplitudes
_{c}
and
_{s}
and axis _{}.
The external (tidal) shear and any accompanying mean convergence are the
lowest order perturbations from any object near the lens that have
measurable effects on a gravitational lens (see Eqn. B.26). While models
usually consider only external (tidal) shears where these coefficients
are constants, in reality
_{c},
_{s}
and _{} are
functions of radius (i.e. Eqn. B.48). Along with the external shear,
there is an internal shear

(B.52) |

due to the quadrupole moment of the mass interior to a given radius. We
introduce the mean radius of the lensed images
<> to make
_{c} and
_{s}
dimensionless with magnitudes that can be easily compared to the
external shear amplitudes
_{c}
and
_{s}.
Arguably the critical radius of the lens is a better physical choice,
but the mean image radius will be close to
the critical radius and using it avoids any trivial covariances between the
internal shear strength and the monopole mass. Usually the internal
quadrupole
is added as part of an ellipsoidal model for the central lens galaxy,
but it is useful in analytic studies to consider it separately.