class_docstr: Tests for the sample function
class_docstr_tok: ["Tests","for","the","sample","function"]
docstr: Test the output of combining expval, var and sample
docstr_tok: ["Test","the","output","of","combining","expval",",","var","and","sample"]
code: def test_sample_combination(self):
      """Test the output of combining expval, var and sample"""
      n_sample = 10
  
      dev = qml.device("default.qubit", wires=3, shots=n_sample)
  
      @qml.qnode(dev, diff_method="parameter-shift")
      def circuit():
          qml.RX(0.54, wires=0)
  
          return (
              qml.sample(qml.PauliZ(0)),
              qml.expval(qml.PauliX(1)),
              qml.var(qml.PauliY(2)),
          )
  
      result = circuit()
  
      assert len(result) == 3
      assert np.array_equal(result[0].shape, (n_sample,))
      assert circuit._qfunc_output[0].shape(dev, Shots(n_sample)) == (
          n_sample,
      )
      assert isinstance(result[1], np.float64)
      assert isinstance(result[2], np.float64)
  
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 2 for calling the TestSample obj's underlying member method code with example usage: obj.test_sample_combination() and returns: qml,  qml,  qml