class_docstr: Test that the template defines the correct decomposition.
class_docstr_tok: ["Test","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=1e-8):
      """Test that template can deal with non-numeric, nonconsecutive wire labels."""
  
      def acquaintances(index, *_, **___):
          return qml.CNOT(index)
  
      weights = np.random.random(size=10)
  
      dev = qml.device("default.qubit", wires=5)
      dev2 = qml.device(
          "default.qubit", wires=["z", "a", "k", "e", "y"]
      )
  
      @qml.qnode(dev)
      def circuit():
          qml.templates.TwoLocalSwapNetwork(
              dev.wires,
              acquaintances,
              weights,
              fermionic=True,
              shift=False,
          )
          return qml.state()
  
      @qml.qnode(dev2)
      def circuit2():
          qml.templates.TwoLocalSwapNetwork(
              dev2.wires,
              acquaintances,
              weights,
              fermionic=True,
              shift=False,
          )
          return qml.state()
  
      assert np.allclose(circuit(), circuit2(), atol=tol, rtol=0)
  
imports: import pytest
  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