Solid-state quantum memory using the 31P nuclear spin