class_docstr: Tests for the quantum_monte_carlo function
class_docstr_tok: ["Tests","for","the","quantum_monte_carlo","function"]
docstr: Test if a ValueError is raised when the wires and estimation_wires share a common wire
docstr_tok: ["Test","if","a","ValueError","is","raised","when","the","wires","and","estimation_wires","share","a","common","wire"]
code: def test_shared_wires(self):
      """Test if a ValueError is raised when the wires and estimation_wires share a common wire"""
      wires = range(2)
      estimation_wires = range(1, 3)
  
      with pytest.raises(
          ValueError, match="No wires can be shared between the wires"
      ):
          quantum_monte_carlo(
              lambda: None,
              wires=wires,
              target_wire=0,
              estimation_wires=estimation_wires,
          )()
  
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 TestQuantumMonteCarlo obj's underlying member method code with example usage: obj.test_shared_wires() without return types