code: def get_state_vector_sampler(n_sample):
      
      def sampling_by_measurement(circuit, meas):
          val = 0.0
          e = expect(circuit.run(returns="statevector"), meas)
          bits, probs = zip(*e.items())
          dists = np.random.multinomial(n_sample, probs) / n_sample
          return dict(zip(tuple(bits), dists))
      return sampling_by_measurement
docs: Returns a function which get the expectations by sampling the state vector