class_docstr: Test the default gaussian device. The test ensures that the device is properly
  applying gaussian operations and calculating the correct observables.
class_docstr_tok: ["Test","the","default","gaussian","device",".","The","test","ensures","that","the","device","is","properly","applying","gaussian","operations","and","calculating","the","correct","observables","."]
docstr: Test that apply fails for incorrect state preparation
docstr_tok: ["Test","that","apply","fails","for","incorrect","state","preparation"]
code: def test_apply_errors(self, gaussian_dev):
      """Test that apply fails for incorrect state preparation"""
  
      with pytest.raises(
          ValueError,
          match="incorrect size for the number of subsystems",
      ):
          p = [thermal_state(0.5)]
          gaussian_dev.apply("GaussianState", wires=Wires([0]), par=[p])
  
      with pytest.raises(
          ValueError, match="Incorrect number of subsystems"
      ):
          p = U
          gaussian_dev.apply(
              "InterferometerUnitary", wires=Wires([0]), par=[p]
          )
  
      with pytest.raises(
          qml.wires.WireError, match="Did not find some of the wires"
      ):
          p = U2
          # dev = DefaultGaussian(wires=4, shots=1000, hbar=hbar)
          gaussian_dev.apply(
              "InterferometerUnitary", wires=Wires([0, 1, 2]), par=[p]
          )
  
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 7 for calling the TestDefaultGaussianDevice obj's underlying member method code with example usage: obj.test_apply_errors(gaussian_dev) without return types