class_docstr: Tests that default.gaussian throws the correct error messages
class_docstr_tok: ["Tests","that","default.gaussian","throws","the","correct","error","messages"]
docstr: Test that default.gaussian raises an exception if sampling is attempted.
docstr_tok: ["Test","that","default.gaussian","raises","an","exception","if","sampling","is","attempted","."]
code: def test_sample_exception(self):
      """Test that default.gaussian raises an exception if sampling is attempted."""
  
      dev = qml.device("default.gaussian", wires=1)
  
      @qml.qnode(dev)
      def circuit():
          return qml.sample(qml.NumberOperator(0))
  
      with pytest.raises(
          NotImplementedError,
          match="default.gaussian does not support sampling NumberOperator",
      ):
          circuit()
  
imports: import numpy
  import numpy.random
  import pytest
  from scipy.linalg import block_diag
  from scipy.special import factorial
  import pennylane
  from pennylane import DeviceError
  from pennylane.devices.default_gaussian import fock_prob, rotation, squeezing, quadratic_phase, beamsplitter, two_mode_squeezing, controlled_addition, controlled_phase, vacuum_state, coherent_state, squeezed_state, displaced_squeezed_state, thermal_state
  from pennylane.wires import Wires
label_desc: Use image node_id 1 for calling the TestExceptions obj's underlying member method code with example usage: obj.test_sample_exception() and returns: qml