class_docstr: Tests for the QuantumMonteCarlo template
class_docstr_tok: ["Tests","for","the","QuantumMonteCarlo","template"]
docstr: Test if a ValueError is raised when a probability distribution is passed whose length
  cannot be mapped to qubits
docstr_tok: ["Test","if","a","ValueError","is","raised","when","a","probability","distribution","is","passed","whose","length","can","not","be","mapped","to","qubits"]
code: def test_wrong_size_p(self):
      """Test if a ValueError is raised when a probability distribution is passed whose length
      cannot be mapped to qubits"""
      p = np.ones(5) / 5
      with pytest.raises(
          ValueError,
          match="The probability distribution must have a length",
      ):
          QuantumMonteCarlo(p, self.func, range(3), range(3, 5))
  
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 4 for calling the TestQuantumMonteCarlo obj's underlying member method code with example usage: obj.test_wrong_size_p() without return types