code: def wavefunction(self) -> pyquil.Wavefunction:
          
          assert self.status == 'done'
          assert self._ket is not None
          wavefn = state_to_wavefunction(self._ket)
          return wavefn
docs: Return the wavefunction of a completed program.