  Ultracold polar molecules uniquely combine a rich structure of long-lived
internal states with access to controllable long-range, anisotropic
dipole-dipole interactions. In particular, the rotational states of polar
molecules confined in optical tweezers or optical lattices may be used to
encode interacting qubits for quantum computation or pseudo-spins for
simulating quantum magnetism. As with all quantum platforms, the engineering of
robust coherent superpositions of states is vital. However, for optically
trapped molecules, the coherence time between rotational states is typically
limited by inhomogeneous light shifts. Here we demonstrate a rotationally-magic
optical trap for RbCs molecules that supports a Ramsey coherence time of
0.78(4) seconds in the absence of dipole-dipole interactions. This extends to
>1.4 seconds at the 95% confidence level using a single spin-echo pulse. In our
magic trap, dipolar interactions become the dominant mechanism by which Ramsey
contrast is lost for superpositions that generate oscillating dipoles. By
changing the states forming the superposition, we tune the effective dipole
moment and show that the coherence time is inversely proportional to the
strength of the dipolar interaction. Our work unlocks the full potential of the
rotational degree of freedom in molecules for quantum computation and quantum
simulation.
