In X-ray crystallography, a technique used to solve the phase problem by replacing one atom in the crystal with another or adding a heavy atom or ion to the crystal without altering its structure. The X-ray diffraction patterns of the crystals before and after replacement or addition are compared. The technique is used particularly in determining the structure of proteins.