class_docstr: Tests for the QuantumMonteCarlo template
class_docstr_tok: ["Tests","for","the","QuantumMonteCarlo","template"]
docstr: Test if a ValueError is raised when the number of target wires is incompatible with the
  expected number of target wires inferred from the length of the input probability
  distribution
docstr_tok: ["Test","if","a","ValueError","is","raised","when","the","number","of","target","wires","is","incompatible","with","the","expected","number","of","target","wires","inferred","from","the","length","of","the","input","probability","distribution"]
code: def test_unexpected_target_wires_number(self):
      """Test if a ValueError is raised when the number of target wires is incompatible with the
      expected number of target wires inferred from the length of the input probability
      distribution"""
      p = np.ones(4) / 4
      with pytest.raises(
          ValueError,
          match="The probability distribution of dimension 4 requires"
          " 3 target wires",
      ):
          QuantumMonteCarlo(p, self.func, range(4), range(4, 6))
  
imports: import numpy
  import pytest
  from scipy.stats import norm
  import pennylane
  from pennylane.templates.subroutines.qmc import QuantumMonteCarlo, _make_V, _make_Z, func_to_unitary, make_Q, probs_to_unitary
  from pennylane.wires import Wires
label_desc: Use image node_id 5 for calling the TestQuantumMonteCarlo obj's underlying member method code with example usage: obj.test_unexpected_target_wires_number() without return types