Quadrupole
A quadrupole is one of a sequence of configurations of  for example  electric charge or current, or gravitational mass that can exist in ideal form, but it is usually just part of a multipole expansion of a more complex structure reflecting various orders of complexity.

# Mathematical definition
The traceless quadrupole moment tensor of a system of charges (or masses, for example) is defined as
for a discrete system with individual charges q_n, or
for a continuous system with charge density \rho(x).
The quadrupole moment has 9 components, but because of the rotational symmetry and trace property, only 5 of these are independent. As with all types of moments except the monopole, the value of the quadrupole moment depends on the choice of the coordinate origin.  For example, the basic dipole can have a quadrupole moment if the origin is shifted away from the center of the two charges.  However, the quadrupole moment of the basic dipole can also be reduced to zero with a particular choice of the origin.
If each charge is the source of a "1/r" field, like the electric or gravitational field, the contribution to the field's potential from the quadrupole moment is:
where R is a vector with origin in the system of charges and n
is the unit vector in the direction of R.  Here, k is a constant that depends on the type of field, and the units being used.

# Electric quadrupole
The classic example of an electric quadrupole is shown in the picture.  There are two positive and two negative charges, arranged on the corners of a square.  The monopole moment (just the total charge) of this arrangement is zero.  Similarly, the dipole moment is zero, when the coordinate origin is at the center of the picture.  The quadrupole moment of this arrangement, however, cannot be reduced to zero, regardless of where we place the coordinate origin.  The electric potential of an electric charge quadrupole is given by 
where \epsilon_0 is the electric permittivity.

# Magnetic quadrupole
All known magnetic sources give dipole fields. However, to make a magnetic quadrupole it is possible to place two identical bar magnets parallel to each other such that the North pole of one is next to the South of the other and vice versa. Such a configuration cancels the dipole moment and gives a quadrupole moment, and its field will decrease at large distances faster than that of a dipole.
Magnetic quadrupoles like the one depicted on the right are being used to focus particle beams in a particle accelerator. There are four steel pole tips, two opposing magnetic north poles and two opposing magnetic south poles. The steel is magnetized by a large electric current that flows in the coils of tubing wrapped around the poles.
Changing magnetic quadrupole moments give production of electromagnetic radiation.

# Gravitational quadrupole
The mass quadrupole is very analogous to the electric charge quadrupole, where the charge density is simply replaced by the mass density.  The gravitational potential is then expressed as:
For example, because the Earth is rotating, it is oblate (flattened at the poles).  This gives it a nonzero quadrupole moment.  While the contribution to the Earth's gravitational field from this quadrupole is extremely important for artificial satellites close to Earth, it is less important for the Moon, because the \frac{1}{|\mathbf{R}|^3} term falls quickly.
The mass quadrupole moment is also important in General Relativity because, if it changes in time, it can produce gravitational radiation, similar to the electromagnetic radiation produced by change electric or magnetic quadrupoles.  (In particular, the second time derivative must be nonzero.)  The mass monopole represents the total mass-energy in a system, and does not change in time  thus it gives off no radiation.  Similarly, the mass dipole represents the center of mass of a system, which also does not change in time  thus it also gives off no radiation.  The mass quadrupole, however, can change in time, and is the lowest-order contribution to gravitational radiation.
The simplest and most important example of a radiating system is a pair of black holes with equal masses orbiting each other.  If we place the coordinate origin right between the two black holes, and one black hole at unit distance along the x-axis, the system will have no dipole moment.  Its quadrupole moment will simply be
where M is the mass of each hole, and x_i is the unit vector in the x-direction.  As the system orbits, the x-vector will rotate, which means that it will have a nonzero second time derivative.  Thus, the system will radiate gravitational waves.  Energy lost in this way was indirectly detected in the Hulse-Taylor binary.
Just as electric charge and current multipoles contribute to the electromagnetic field, mass and mass-current multipoles contribute to the gravitational field in General Relativity, because GR also includes "gravitomagnetic" effects.  Changing mass-current multipoles can also give off gravitational radiation.  However, contributions from the current multipoles will typically be much smaller than that of the mass quadrupole.