Compact 3 D quantum memory