class_docstr: Tests Von Neumann entropy transform
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, interface
  ):
      """Test entropy for a QNode gradient with torch."""
      import torch
  
      dev = qml.device("default.qubit", wires=2)
  
      @qml.qnode(dev, interface=interface, diff_method="backprop")
      def circuit_state(x):
          qml.IsingXX(x, wires=[0, 1])
          return qml.state()
  
      eig_1 = (
          1
          + np.sqrt(
              1 - 4 * np.cos(param / 2) ** 2 * np.sin(param / 2) ** 2
          )
      ) / 2
      eig_2 = (
          1
          - np.sqrt(
              1 - 4 * np.cos(param / 2) ** 2 * np.sin(param / 2) ** 2
          )
      ) / 2
      eigs = [eig_1, eig_2]
      eigs = np.maximum(eigs, 1e-08)
  
      grad_expected_entropy = expected_entropy_grad_ising_xx(
          param
      ) / np.log(base)
  
      param = torch.tensor(
          param, dtype=torch.float64, requires_grad=True
      )
      entropy = qml.qinfo.vn_entropy(
          circuit_state, wires=wires, base=base
      )(param)
  
      entropy.backward()
      grad_entropy = param.grad
  
      assert qml.math.allclose(grad_entropy, grad_expected_entropy)
  
imports: import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 5 for calling the TestVonNeumannEntropy obj's underlying member method code with example usage: obj.test_IsingXX_qnode_entropy_grad_torch(param, wires, base, interface) and returns: qml