class_docstr: Integration tests for the classical fisher information matrix CFIM
class_docstr_tok: ["Integration","tests","for","the","classical","fisher","information","matrix","CFIM"]
docstr: Integration test of classical_fisher() with torch for examples that have 0s in the probabilities and non-zero gradient
docstr_tok: ["Integration","test","of","classical_fisher","(",")","with","torch","for","examples","that","have","0s","in","the","probabilities","and","non-zero","gradient"]
code: def test_cfim_contains_zeros_torch(self, n_wires):
      """Integration test of classical_fisher() with torch for examples that have 0s in the probabilities and non-zero gradient"""
      import torch
  
      dev = qml.device("default.qubit", wires=n_wires)
  
      @qml.qnode(dev)
      def circ(params):
          qml.RZ(params[0], wires=0)
          qml.RX(params[1], wires=1)
          qml.RX(params[0], wires=1)
          return qml.probs(wires=range(n_wires))
  
      params = np.pi / 4 * torch.tensor([1.0, 1.0], requires_grad=True)
      cfim = classical_fisher(circ)(params)
      assert np.allclose(cfim.detach().numpy(), np.ones((2, 2)))
  
imports: import pytest
  import numpy
  import pennylane
  import pennylane.numpy
  from pennylane.qinfo import classical_fisher, quantum_fisher
  from pennylane.qinfo.transforms import _make_probs, _compute_cfim
label_desc: Use image node_id 7 for calling the TestInterfacesClassicalFisher obj's underlying member method code with example usage: obj.test_cfim_contains_zeros_torch(n_wires) and returns: qml