  Microscopic control over polar molecules with tunable interactions would
enable realization of novel quantum phenomena. Using an applied electric field
gradient, we demonstrate layer-resolved state preparation and imaging of
ultracold potassium-rubidium molecules confined to two-dimensional planes in an
optical lattice. The coherence time of rotational superpositions in individual
layers is maximized by rotating the electric field relative to the optical trap
polarization to achieve state-insensitive trapping. Molecules in adjacent
layers interact via dipolar exchange of rotational angular momentum; by
adjusting the interaction strength between spatially separated ensembles of
molecules, we regulate the local chemical reaction rate. The observed resonance
width of the exchange process vastly exceeds the dipolar interaction energy, an
effect we attribute to the thermal energy. This work realizes precise control
of interacting molecules, enabling electric field microscopy on subwavelength
length scales and allowing access to unexplored physics in two-dimensional
systems.
