class_docstr: Test that the measure_with_samples function works as expected
class_docstr_tok: ["Test","that","the","measure_with_samples","function","works","as","expected"]
docstr: Test that a probability measurement works as expected
docstr_tok: ["Test","that","a","probability","measurement","works","as","expected"]
code: def test_prob_measure(self):
      """Test that a probability measurement works as expected"""
      state = qml.math.array(two_qubit_state)
      shots = qml.measurements.Shots(100)
      mp = qml.probs(wires=range(2))
  
      result = measure_with_samples([mp], state, shots=shots)[0]
  
      assert result.shape == (4,)
      assert result[0] == 0
      assert result[3] == 0
      assert result[1] + result[2] == 1
  
imports: from random import shuffle
  import pytest
  import numpy
  import pennylane
  from pennylane.devices.qubit import simulate
  from pennylane.devices.qubit.simulate import _FlexShots
  from pennylane.devices.qubit import sample_state, measure_with_samples
  from pennylane.devices.qubit.sampling import _sample_state_jax
  from pennylane.measurements import Shots
label_desc: Use image node_id 3 for calling the TestMeasureSamples obj's underlying member method code with example usage: obj.test_prob_measure() without return types