class_docstr: Integration tests for the vn_entropy measurement function.
docstr: Test entropy for a QNode gradient with torch.
docstr_tok: ["Test","entropy","for","a","QNode","gradient","with","torch","."]
code: def test_IsingXX_qnode_entropy_grad_torch(
      self, param, wires, base, diff_method
  ):
      """Test entropy for a QNode gradient with torch."""
      import torch
  
      dev = qml.device("default.qubit.legacy", wires=2)
  
      @qml.qnode(dev, interface="torch", diff_method=diff_method)
      def circuit_entropy(x):
          qml.IsingXX(x, wires=[0, 1])
          return qml.vn_entropy(wires=wires, log_base=base)
  
      grad_expected_entropy = expected_entropy_grad_ising_xx(
          param
      ) / np.log(base)
  
      param = torch.tensor(
          param, dtype=torch.float64, requires_grad=True
      )
      entropy = circuit_entropy(param)
      entropy.backward()
      grad_entropy = param.grad
  
      # higher tolerance for finite-diff method
      tol = 1e-8 if diff_method == "backprop" else 1e-5
  
      assert qml.math.allclose(
          grad_entropy, grad_expected_entropy, atol=tol
      )
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane.workflow import INTERFACE_MAP
  from pennylane.measurements import Shots
  from pennylane.measurements.vn_entropy import VnEntropyMP
label_desc: Use image node_id 5 for calling the TestIntegration obj's underlying member method code with example usage: obj.test_IsingXX_qnode_entropy_grad_torch(param, wires, base, diff_method) and returns: qml