== How It Works ==

Many kinds of atomic nuclei possess an intrinsic angular momentum $\mathbf s$, much like that of a gyroscope. The total angular momentum is fixed at $\|{\mathbf s}\| = h S$, where *h* is *Planck's constant* and *S* an integer or half-integer quantum number known as the nuclear *spin*. Nuclei with $S > 0$ (also called "spins") possess a *magnetic dipole* ${\mathbf m} = g\,{\mathbf s}$ proportional to $\mathbf s$, so that in an external magnetic field $\mathbf B_0$ their energy **m\cdot B**_{0} depends on their orientation relative to the field (much like a bar magnet). This energy is **quantized** into 2*S* + 1 discrete levels, where the vectors of the dipoles in each level have fixed components parallel and perpendicular to $\mathbf B_0$. It follows that nuclei with spin *S* = 1/2 are naturally occurring **two-state** quantum systems, or *qubits*, suitable for use in quantum information processing. In accord with their binary nature, these two states will be denoted by $\big|0\rangle$ (parallel to $\mathbf B_0$) and $\big|1\rangle$ (antiparallel).

Nuclear magnetic resonance (or *NMR*) spectroscopy uses the $S > 0$ nuclei of molecules to probe their chemical structure and dynamics. NMR is most commonly applied to the (spin 1/2) hydrogen nuclei in macroscopic liquid samples containing of order 10^{20} **identical** molecules. In these experiments, only the **sum** of the magnetic dipoles of each kind of nucleus over the entire *ensemble* of noninteracting spin systems (i.e. molecules) is observable. Even though the dipoles of the individual nuclei are quantized, these macroscopic sums behave like classical bar magnets and can point in any direction. In effect, therefore, the total magnetic dipole from each kind of nucleus acts like a magnetic gyroscope, which *precesses* about the applied magnetic field $\mathbf B_0$ at a fixed rate determined by the field strength, the type of nucleus, and its environment in the molecule. This is known as the *Larmour* precession frequency (see above Figure).

The spins within each individual molecule also interact with one another through chemical bonds, via what is called the *scalar* or *J-coupling* (as for example in the chloro-acrylate molecule shown in the above Figure). This further splits each spin's energy levels, depending on whether its neighboring spins are in the $\big|0\rangle$ or $\big|1\rangle$ states, as shown by the energy diagram for a two-spin molecule in the Figure below. As a result, each chemically distinct kind of spin in the molecule has its own Larmour frequency. In an NMR spectrometer, their precessing dipoles induce a current in the coils of the receiver, and the **Fourier transform** of this signal, when plotted as a function of the frequency, reveals a *multiplet* of peaks for each kind of spin, where the different peaks in each multiplet come from molecules in different spin states. The resulting spectrum is a sum of the spectra over all the individual molecules present in the sample, which are generally a mixture of all 2^{N} possible states for their *N* constituent spins. The next Figure below shows the pair of doublets from a two-spin molecule, wherein the peaks correspond to the spin-flips indicated by two-headed arrows in the energy level diagram.

When a radio-frequency field $\mathbf B_1$ perpendicular to $\mathbf B_0$ is applied at the Larmour frequency of a spin, it exerts a constant force on that spin which rotates its net magnetic dipole away from $\mathbf B_0$ (as shown in the first Figure above). In combination with the precession itself, this makes it possible apply any desired rotation to any spin. By selectively irradiating a given peak of a multiplet, it is also possible to operate on a given spin in only those molecules that are in a single spin state. That is, it is possible to perform **conditional** logic on the spins, as required for quantum information processing, with the significant difference that these operations are applied uniformly to the entire ensemble. To continue with the above two-spin example, we note that by irradiating only the left-most (highest energy) peak in the spectrum shown in Figure below, it is possible to flip one spin in just those molecules wherein the other is in the state $\big|1\rangle$, which is known as the *XOR* or *controlled-NOT* logic gate.

In practice, it is usually simpler and more efficient to **coherently average** the natural Hamiltonian of the system by a sequence of multiplet (rather than peak) selective radio-frequency pulses, interspersed with free evolution under scalar coupling, so as to obtain the desired effective propagator. On modern commercial NMR spectrometers these *pulse sequences* permit such a remarkable degree of coherent control over spin ensembles that it has been called *spin choreography*.