class_docstr: Unit tests for process_state_with_shots for the classical_shadow
  and shadow_expval measurements
class_docstr_tok: ["Unit","tests","for","process_state_with_shots","for","the","classical_shadow","and","shadow_expval","measurements"]
docstr: Test that the wire order is respected
docstr_tok: ["Test","that","the","wire","order","is","respected"]
code: def test_wire_order(self):
      """Test that the wire order is respected"""
      state = np.array([[1, 1], [0, 0]]) / np.sqrt(2)
  
      mp = qml.classical_shadow(wires=[0, 1])
      res = mp.process_state_with_shots(
          state, qml.wires.Wires([0, 1]), shots=1000
      )
  
      assert res.shape == (2, 1000, 2)
      assert res.dtype == np.int8
  
      # test that the first qubit samples are all 0s when the recipe is Z
      assert np.all(res[0][res[1, ..., 0] == 2][:, 0] == 0)
  
      # test that the second qubit samples contain 1s when the recipe is Z
      assert np.any(res[0][res[1, ..., 1] == 2][:, 1] == 1)
  
      res = mp.process_state_with_shots(
          state, qml.wires.Wires([1, 0]), shots=1000
      )
  
      assert res.shape == (2, 1000, 2)
      assert res.dtype == np.int8
  
      # now test that the first qubit samples contain 1s when the recipe is Z
      assert np.any(res[0][res[1, ..., 0] == 2][:, 0] == 1)
  
      # now test that the second qubit samples are all 0s when the recipe is Z
      assert np.all(res[0][res[1, ..., 1] == 2][:, 1] == 0)
  
imports: import copy
  import autograd.numpy
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.measurements import ClassicalShadowMP, Shots
  from pennylane.measurements.classical_shadow import ShadowExpvalMP
label_desc: Use image node_id 2 for calling the TestProcessState obj's underlying member method code with example usage: obj.test_wire_order() without return types