class_docstr: Tests for the sample function
class_docstr_tok: ["Tests","for","the","sample","function"]
docstr: Test that we can provide no observable and no wires to sample
  function when using a shot vector
docstr_tok: ["Test","that","we","can","provide","no","observable","and","no","wires","to","sample","function","when","using","a","shot","vector"]
code: def test_providing_no_observable_and_no_wires_shot_vector(self):
      """Test that we can provide no observable and no wires to sample
      function when using a shot vector"""
      num_wires = 2
  
      shots1 = 1
      shots2 = 10
      shots3 = 1000
      dev = qml.device(
          "default.qubit",
          wires=num_wires,
          shots=[shots1, shots2, shots3],
      )
  
      @qml.qnode(dev)
      def circuit():
          qml.Hadamard(wires=0)
          qml.CNOT(wires=[0, 1])
          return qml.sample()
  
      res = circuit()
  
      assert isinstance(res, tuple)
  
      expected_shapes = [
          (num_wires,),
          (shots2, num_wires),
          (shots3, num_wires),
      ]
      assert len(res) == len(expected_shapes)
      assert all(
          r.shape == exp_shape
          for r, exp_shape in zip(res, expected_shapes)
      )
  
      # assert first wire is always the same as second
      # pylint: disable=unsubscriptable-object
      assert np.all(res[0][0] == res[0][1])
      assert np.all(res[1][:, 0] == res[1][:, 1])
      assert np.all(res[2][:, 0] == res[2][:, 1])
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane.measurements import MeasurementShapeError, Sample, Shots
  from pennylane.operation import EigvalsUndefinedError, Operator
label_desc: Use image node_id 15 for calling the TestSample obj's underlying member method code with example usage: obj.test_providing_no_observable_and_no_wires_shot_vector() and returns: qml