class_docstr: Test that the template defines the correct decomposition.
class_docstr_tok: ["Test","that","the","template","defines","the","correct","decomposition","."]
docstr: Test that BasisRotation template can deal with non-numeric, nonconsecutive wire labels.
docstr_tok: ["Test","that","BasisRotation","template","can","deal","with","non-numeric",",","nonconsecutive","wire","labels","."]
code: def test_custom_wire_labels(self, tol):
      """Test that BasisRotation template can deal with non-numeric, nonconsecutive wire labels."""
  
      weights = qml.math.array(
          [
              [-0.618452, -0.68369054 - 0.38740723j],
              [-0.78582258, 0.53807284 + 0.30489424j],
          ]
      )
  
      dev = qml.device("default.qubit", wires=2)
      dev2 = qml.device("default.qubit", wires=["z", "a"])
  
      @qml.qnode(dev)
      def circuit():
          qml.PauliX(wires=[0])
          qml.BasisRotation(
              wires=range(2),
              unitary_matrix=weights,
          )
          return qml.expval(qml.Identity(0)), qml.state()
  
      @qml.qnode(dev2)
      def circuit2():
          qml.PauliX(wires=["z"])
          qml.BasisRotation(
              wires=["z", "a"],
              unitary_matrix=weights,
          )
          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_basis_rotation.py
imports: import pytest
  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