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 on a single wire works as expected
docstr_tok: ["Test","that","a","probability","measurement","on","a","single","wire","works","as","expected"]
code: def test_prob_measure_single_wire(self):
      """Test that a probability measurement on a single wire works as expected"""
      state = np.array([[1, -1j], [0, 0]]) / np.sqrt(2)
      shots = qml.measurements.Shots(100)
  
      mp0 = qml.probs(wires=0)
      mp1 = qml.probs(wires=1)
  
      result0 = measure_with_samples([mp0], state, shots=shots)[0]
      result1 = measure_with_samples([mp1], state, shots=shots)[0]
  
      assert result0.shape == (2,)
      assert result1.shape == (2,)
  
      assert result0[0] == 1
      assert result0[1] == 0
      assert result1[0] != 0
      assert result1[1] != 0
      assert result1[0] + result1[1] == 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 4 for calling the TestMeasureSamples obj's underlying member method code with example usage: obj.test_prob_measure_single_wire() without return types