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 the application of the GaussianState gate to a state, since it
  uses a forked logic in the apply function.
docstr_tok: ["Test","the","application","of","the","GaussianState","gate","to","a","state",",","since","it","uses","a","forked","logic","in","the","apply","function","."]
code: def test_apply_gaussianstate(self, tol):
      """Test the application of the GaussianState gate to a state, since it
      uses a forked logic in the apply function."""
  
      gaussian_dev = qml.device("default.gaussian", wires=2)
  
      # start in the displaced squeezed state
      alpha = 0.542 + 0.123j
      a = abs(alpha)
      phi_a = np.angle(alpha)
      r = 0.652
      phi_r = -0.124
      gaussian_dev.apply(
          "DisplacedSqueezedState",
          wires=Wires([0]),
          par=[a, phi_a, r, phi_r],
      )
      gaussian_dev.apply(
          "DisplacedSqueezedState",
          wires=Wires([1]),
          par=[a, phi_a, r, phi_r],
      )
  
      cov = np.diag([0.5234] * 4)
      mu = np.array([0.432, 0.123, 0.342, 0.123])
      p = [cov, mu]
      w = list(range(2))
      expected_out = [cov, mu]
  
      gaussian_dev.apply("GaussianState", wires=Wires(w), par=p)
  
      # verify the device is now in the expected state
      assert gaussian_dev._state[0] == pytest.approx(
          expected_out[0], abs=tol
      )
      assert gaussian_dev._state[1] == pytest.approx(
          expected_out[1], abs=tol
      )
  
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 4 for calling the TestDefaultGaussianDevice obj's underlying member method code with example usage: obj.test_apply_gaussianstate(tol) without return types