class_docstr: Tests circuits with sample-based measurements
docstr: Test a simple circuit with a single sample measurement for shot vectors
docstr_tok: ["Test","a","simple","circuit","with","a","single","sample","measurement","for","shot","vectors"]
code: def test_sample_shot_vector(self, shots):
      """Test a simple circuit with a single sample measurement for shot vectors"""
      x = np.array(0.732)
      shots = qml.measurements.Shots(shots)
      qs = qml.tape.QuantumScript(
          [qml.RY(x, wires=0)],
          [qml.sample(wires=range(2))],
          shots=shots,
      )
      result = simulate(qs)
  
      assert isinstance(result, tuple)
      assert len(result) == len(list(shots))
  
      assert all(isinstance(res, np.ndarray) for res in result)
      assert all(res.shape == (s, 2) for res, s in zip(result, shots))
      assert all(
          np.allclose(
              np.sum(res, axis=0).astype(np.float32) / s,
              [np.sin(x / 2) ** 2, 0],
              atol=0.1,
          )
          for res, s in zip(result, shots)
      )
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.devices.qubit import simulate, get_final_state, measure_final_state
label_desc: Use image node_id 8 for calling the TestSampleMeasurements obj's underlying member method code with example usage: obj.test_sample_shot_vector(shots) without return types