class_docstr: Tests the auxillary functions
class_docstr_tok: ["Tests","the","auxillary","functions"]
docstr: Test fock_prob returns the correct Fock probabilities
docstr_tok: ["Test","fock_prob","returns","the","correct","Fock","probabilities"]
code: def test_fock_prob(self, tol):
      """Test fock_prob returns the correct Fock probabilities"""
  
      # an arbitrary two-mode Gaussian state generated using Strawberry Fields
      mu = np.array([0.6862, 0.4002, 0.09, 0.558]) * np.sqrt(hbar)
      cov = (
          np.array(
              [
                  [0.50750512, -0.04125979, -0.21058229, -0.07866912],
                  [-0.04125979, 0.50750512, -0.07866912, -0.21058229],
                  [-0.21058229, -0.07866912, 0.95906208, 0.27133391],
                  [-0.07866912, -0.21058229, 0.27133391, 0.95906208],
              ]
          )
          * hbar
      )
  
      # expected Fock state probabilities
      events = [(0, 0), (0, 1), (1, 1), (2, 3)]
      probs = [
          0.430461524043,
          0.163699407559,
          0.0582788388927,
          0.00167706931355,
      ]
  
      for idx, e in enumerate(events):
          res = fock_prob(cov, mu, e, hbar=hbar)
          assert res == pytest.approx(probs[idx], 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 1 for calling the TestAuxillaryFunctions obj's underlying member method code with example usage: obj.test_fock_prob(tol) without return types