class_docstr: Tests of the automatic gradient method for CV circuits.
class_docstr_tok: ["Tests","of","the","automatic","gradient","method","for","CV","circuits","."]
docstr: Tests that the automatic gradient of a beamsplitter is correct.
docstr_tok: ["Tests","that","the","automatic","gradient","of","a","beamsplitter","is","correct","."]
code: def test_beamsplitter_gradient(self, theta, grad_fn_BS, tol):
      "Tests that the automatic gradient of a beamsplitter is correct."
  
      autograd_val = grad_fn_BS(theta)
      # qfunc evalutes to hbar * alpha * cos(theta)
      manualgrad_val = -hbar * alpha * np.sin(theta)
      assert autograd_val == pytest.approx(manualgrad_val, abs=tol)
  
imports: import pytest
  import autograd
  import numpy
  import pennylane.numpy
  import pennylane
label_desc: Use image node_id 2 for calling the TestCVGradient obj's underlying member method code with example usage: obj.test_beamsplitter_gradient(theta, grad_fn_BS, tol) without return types