  We present a novel approach to the detection of weak magnetic fields that
takes advantage of recently developed techniques for the coherent control of
solid-state electron spin quantum bits. Specifically, we investigate a magnetic
sensor based on Nitrogen-Vacancy centers in room-temperature diamond. We
discuss two important applications of this technique: a nanoscale magnetometer
that could potentially detect precession of single nuclear spins and an optical
magnetic field imager combining spatial resolution ranging from micrometers to
millimeters with a sensitivity approaching few femtotesla/Hz$^{1/2}$.
