class_docstr: Testing that given p and dp, _compute_cfim() computes the correct outputs
class_docstr_tok: ["Testing","that","given","p","and","dp",",","_compute_cfim","(",")","computes","the","correct","outputs"]
docstr: Test that the classical fisher information matrix (CFIM) is
  constructed correctly for the trivial distirbution p=(1,0,0,...)
  and some dummy gradient dp
docstr_tok: ["Test","that","the","classical","fisher","information","matrix","(","CFIM",")","is","constructed","correctly","for","the","trivial","distirbution","p=","(","1,0,0",",","...",")","and","some","dummy","gradient","dp"]
code: def test_compute_cfim_trivial_distribution(self, n_params, n_wires):
      """Test that the classical fisher information matrix (CFIM) is
      constructed correctly for the trivial distirbution p=(1,0,0,...)
      and some dummy gradient dp"""
      # implicitly also does the unit test for the correct output shape
  
      dp = np.ones(2**n_wires * n_params, dtype=float).reshape(
          2**n_wires, n_params
      )
      p = np.zeros(2**n_wires)
      p[0] = 1
      res = _compute_cfim(p, dp)
      assert np.allclose(res, np.ones((n_params, n_params)))
  
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 2 for calling the TestComputeclassicalFisher obj's underlying member method code with example usage: obj.test_compute_cfim_trivial_distribution(n_params, n_wires) without return types