class_docstr: Test decompositions are generated correctly.
class_docstr_tok: ["Test","decompositions","are","generated","correctly","."]
docstr: Test the private function which samples the decomposition
docstr_tok: ["Test","the","private","function","which","samples","the","decomposition"]
code: def test_private_sample(
      self, coeffs, ops, time, seed, n
  ):  # pylint: disable=too-many-arguments
      """Test the private function which samples the decomposition"""
      ops_to_coeffs = dict(zip(ops, coeffs))
      normalization = qnp.sum(qnp.abs(coeffs))
  
      with qml.tape.QuantumTape() as tape:
          decomp = _sample_decomposition(coeffs, ops, time, n, seed)
  
      assert len(decomp) == n
      assert len(tape.operations) == 0  # no queuing
      for term in decomp:
          coeff = ops_to_coeffs[term.base]
          s = coeff / qml.math.abs(coeff)
  
          assert term.base in ops  # sample from ops
          assert term.coeff == (s * normalization * time * 1j / n)
  
imports: import copy
  from functools import reduce
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.math import allclose, isclose
  from pennylane.templates.subroutines.qdrift import _sample_decomposition
label_desc: Use image node_id 1 for calling the TestDecomposition obj's underlying member method code with example usage: obj.test_private_sample(coeffs, ops, time, seed, n) without return types