class_docstr: Test for adjoint_vjp
docstr: Test that computing the VJP with batched cotangents for state measurements
  gives the correct results for a single trainable parameter.
docstr_tok: ["Test","that","computing","the","VJP","with","batched","cotangents","for","state","measurements","gives","the","correct","results","for","a","single","trainable","parameter","."]
code: def test_single_param_state_batched(self, cotangents, tol):
      """Test that computing the VJP with batched cotangents for state measurements
      gives the correct results for a single trainable parameter."""
      x = np.array(0.654)
      y = np.array(1.221)
  
      obs = [qml.state()]
      qs = QuantumScript(
          [qml.RY(x, wires=[0]), qml.RX(y, wires=[1])],
          obs,
          trainable_params=[0],
      )
  
      actual = adjoint_vjp(qs, cotangents)
      assert isinstance(actual, tuple)
      assert len(actual) == 1
  
      jac = np.array(
          [
              [-0.5 * np.sin(x / 2) * np.cos(y / 2)],
              [0.5j * np.sin(x / 2) * np.sin(y / 2)],
              [0.5 * np.cos(x / 2) * np.cos(y / 2)],
              [-0.5j * np.cos(x / 2) * np.sin(y / 2)],
          ]
      )
      expected = jac.T @ cotangents.T
      assert np.allclose(actual, expected, atol=tol)
  
imports: import pytest
  import pennylane
  from pennylane.devices.qubit import adjoint_jacobian, adjoint_jvp, adjoint_vjp
  from pennylane.tape import QuantumScript
  import pennylane.numpy
label_desc: Use image node_id 11 for calling the TestAdjointVJP obj's underlying member method code with example usage: obj.test_single_param_state_batched(cotangents, tol) without return types