class_docstr: Tests for the QuantumMonteCarlo template
class_docstr_tok: ["Tests","for","the","QuantumMonteCarlo","template"]
docstr: Tests that the id attribute can be set.
docstr_tok: ["Tests","that","the","id","attribute","can","be","set","."]
code: def test_id(self):
      """Tests that the id attribute can be set."""
      xs = np.linspace(-np.pi, np.pi, 2**5)
      probs = np.array([norm().pdf(x) for x in xs])
      probs /= np.sum(probs)
      func = lambda i: np.cos(xs[i]) ** 2
  
      target_wires = [0, "a", -1.1, -10, "bbb", 1000]
      estimation_wires = [
          "bob",
          -3,
          42,
          "penny",
          "lane",
          247,
          "straw",
          "berry",
          5.5,
          6.6,
      ]
  
      template = qml.QuantumMonteCarlo(
          probs,
          func,
          target_wires=target_wires,
          estimation_wires=estimation_wires,
          id="a",
      )
  
      assert template.id == "a"
  
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 10 for calling the TestQuantumMonteCarlo obj's underlying member method code with example usage: obj.test_id() without return types