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."""
      basis_state = [0, 1, 2]
  
      dev = qml.device("default.qutrit", wires=3)
      dev2 = qml.device("default.qutrit", wires=["z", "a", "k"])
  
      @qml.qnode(dev)
      def circuit(obs):
          qml.QutritBasisStatePreparation(basis_state, wires=range(3))
          return qml.expval(qml.THermitian(A=obs, wires=0))
  
      @qml.qnode(dev2)
      def circuit2(obs):
          qml.QutritBasisStatePreparation(
              basis_state, wires=["z", "a", "k"]
          )
          return qml.expval(qml.THermitian(A=obs, wires="z"))
  
      obs = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
      circuit(obs)
      circuit2(obs)
  
      assert np.allclose(dev.state, dev2.state, atol=tol, rtol=0)
  
file_path: pennylane/tests/templates/test_state_preparations/test_qutrit_basis_state_prep.py
imports: import pytest
  import numpy
  import pennylane
label_desc: Use image node_id 5 for calling the TestDecomposition obj's underlying member method code with example usage: obj.test_custom_wire_labels(tol) and returns: qml, qml