class_docstr: Tests that the template defines the correct decomposition.
class_docstr_tok: ["Tests","that","the","template","defines","the","correct","decomposition","."]
docstr: Test that template can deal with non-numeric, nonconsecutive wire labels.
docstr_tok: ["Test","that","template","can","deal","with","non-numeric",",","nonconsecutive","wire","labels","."]
code: def test_custom_wire_labels(self, tol):
      """Test that template can deal with non-numeric, nonconsecutive wire labels."""
  
      weights = [0.1, 0.2]
      dev = qml.device("default.qubit", wires=4)
      dev2 = qml.device("default.qubit", wires=["z", "a", "k", "e"])
  
      @qml.qnode(dev)
      def circuit():
          qml.UCCSD(
              weights,
              wires=range(4),
              s_wires=[[0, 1]],
              d_wires=[[[0, 1], [2, 3]]],
              init_state=np.array([0, 1, 0, 1]),
          )
          return qml.expval(qml.Identity(0)), qml.state()
  
      @qml.qnode(dev2)
      def circuit2():
          qml.UCCSD(
              weights,
              wires=["z", "a", "k", "e"],
              s_wires=[["z", "a"]],
              d_wires=[[["z", "a"], ["k", "e"]]],
              init_state=np.array([0, 1, 0, 1]),
          )
          return qml.expval(qml.Identity("z")), qml.state()
  
      res1, state1 = circuit()
      res2, state2 = circuit2()
  
      assert np.allclose(res1, res2, atol=tol, rtol=0)
      assert np.allclose(state1, state2, atol=tol, rtol=0)
  
file_path: pennylane/tests/templates/test_subroutines/test_uccsd.py
imports: import pytest
  import numpy
  from pennylane import numpy
  import pennylane
label_desc: Use image node_id 2 for calling the TestDecomposition obj's underlying member method code with example usage: obj.test_custom_wire_labels(tol) and returns: qml,  qml, qml,  qml