class_docstr: Tests for the apply_controlled_Q function
class_docstr_tok: ["Tests","for","the","apply_controlled_Q","function"]
docstr: Tests if a ValueError is raised when the target wire is not contained within wires
docstr_tok: ["Tests","if","a","ValueError","is","raised","when","the","target","wire","is","not","contained","within","wires"]
code: def test_raises(self):
      """Tests if a ValueError is raised when the target wire is not contained within wires"""
      with pytest.raises(
          ValueError,
          match="The target wire must be contained within wires",
      ):
          apply_controlled_Q(
              lambda: ...,
              wires=range(3),
              target_wire=4,
              control_wire=5,
              work_wires=None,
          )()
  
file_path: pennylane/tests/transforms/test_qmc_transform.py
imports: import itertools
  import numpy
  import pytest
  from scipy.stats import unitary_group, norm
  import pennylane
  from pennylane.transforms.qmc import _apply_controlled_z, _apply_controlled_v, apply_controlled_Q, quantum_monte_carlo
  from pennylane.templates.subroutines.qmc import _make_V, _make_Z, make_Q
  from pennylane.wires import Wires
label_desc: Use image node_id 2 for calling the TestApplyControlledQ obj's underlying member method code with example usage: obj.test_raises() without return types