code: def non_sampling_sampler(circuit, meas):
      
      meas = tuple(meas)
      n_qubits = circuit.n_qubits
      return expect(circuit.run(returns="statevector"), meas)
docs: Calculate the expectations without sampling.