class_docstr: A bookkeeping class for wires, which are ordered collections of unique objects.
  
  If the input `wires` can be iterated over, it is interpreted as a sequence of wire labels that have to be
  unique and hashable. Else it is interpreted as a single wire label that has to be hashable. The
  only exception are strings which are interpreted as wire labels.
  
  The hash function of a wire label is considered the source of truth when deciding whether
  two wire labels are the same or not.
  
  Indexing an instance of this class will return a wire label.
  
  .. warning::
  
      In order to support wire labels of any hashable type, integers and 0-d arrays are considered different.
      For example, running ``qml.RX(1.1, qml.numpy.array(0))`` on a device initialized with ``wires=[0]``
      will fail because ``qml.numpy.array(0)`` does not exist in the device's wire map.
  
  Args:
       wires (Any): the wire label(s)
class_docstr_tok: ["A","bookkeeping","class","for","wires",",","which","are","ordered","collections","of","unique","objects",".","If","the","input","`","wires","`","can","be","iterated","over",",","it","is","interpreted","as","a","sequence","of","wire","labels","that","have","to","be","unique","and","hashable",".","Else","it","is","interpreted","as","a","single","wire","label","that","has","to","be","hashable",".","The","only","exception","are","strings","which","are","interpreted","as","wire","labels",".","The","hash","function","of","a","wire","label","is","considered","the","source","of","truth","when","deciding","whether","two","wire","labels","are","the","same","or","not",".","Indexing","an","instance","of","this","class","will","return","a","wire","label",".","..","warning",":",":","In","order","to","support","wire","labels","of","any","hashable","type",",","integers","and","0-d","arrays","are","considered","different",".","For","example",",","running","``","qml.RX","(","1.1",",","qml.numpy.array","(","0",")",")","``","on","a","device","initialized","with","``","wires=","[","0","]","``","will","fail","because","``","qml.numpy.array","(","0",")","``","does","not","exist","in","the","device","'s","wire","map",".","Args",":","wires","(","Any",")",":","the","wire","label","(","s",")"]
docstr: Returns a new Wires object which is a subset of this Wires object. The wires of the new
  object are the wires at positions specified by 'indices'. Also accepts a single index as input.
  
  Args:
      indices (List[int] or int): indices or index of the wires we want to select
      periodic_boundary (bool): controls periodic boundary conditions in the indexing
  
  Returns:
      Wires: subset of wires
  
  **Example**
  
  >>> wires = Wires([4, 0, 1, 5, 6])
  >>> wires.subset([2, 3, 0])
  <Wires = [1, 5, 4]>
  >>> wires.subset(1)
  <Wires = [0]>
  
  If ``periodic_boundary`` is True, the modulo of the number of wires of an index is used instead of an index,
  so that  ``wires.subset(i) == wires.subset(i % n_wires)`` where ``n_wires`` is the number of wires of this
  object.
  
  >>> wires = Wires([4, 0, 1, 5, 6])
  >>> wires.subset([5, 1, 7], periodic_boundary=True)
  <Wires = [4, 0, 1]>
docstr_tok: ["Returns","a","new","Wires","object","which","is","a","subset","of","this","Wires","object",".","The","wires","of","the","new","object","are","the","wires","at","positions","specified","by","'indices","'",".","Also","accepts","a","single","index","as","input",".","Args",":","indices","(","List","[","int","]","or","int",")",":","indices","or","index","of","the","wires","we","want","to","select","periodic_boundary","(","bool",")",":","controls","periodic","boundary","conditions","in","the","indexing","Returns",":","Wires",":","subset","of","wires","*","*","Example","*","*",">",">",">","wires","=","Wires","(","[","4",",","0",",","1",",","5",",","6","]",")",">",">",">","wires.subset","(","[","2",",","3",",","0","]",")","<","Wires","=","[","1",",","5",",","4","]",">",">",">",">","wires.subset","(","1",")","<","Wires","=","[","0","]",">","If","``","periodic_boundary","``","is","True",",","the","modulo","of","the","number","of","wires","of","an","index","is","used","instead","of","an","index",",","so","that","``","wires.subset","(","i",")","==","wires.subset","(","i","%","n_wires",")","``","where","``","n_wires","``","is","the","number","of","wires","of","this","object",".",">",">",">","wires","=","Wires","(","[","4",",","0",",","1",",","5",",","6","]",")",">",">",">","wires.subset","(","[","5",",","1",",","7","]",",","periodic_boundary=True",")","<","Wires","=","[","4",",","0",",","1","]",">"]
code: def subset(self, indices, periodic_boundary=False):
      """
      Returns a new Wires object which is a subset of this Wires object. The wires of the new
      object are the wires at positions specified by 'indices'. Also accepts a single index as input.
  
      Args:
          indices (List[int] or int): indices or index of the wires we want to select
          periodic_boundary (bool): controls periodic boundary conditions in the indexing
  
      Returns:
          Wires: subset of wires
  
      **Example**
  
      >>> wires = Wires([4, 0, 1, 5, 6])
      >>> wires.subset([2, 3, 0])
      <Wires = [1, 5, 4]>
      >>> wires.subset(1)
      <Wires = [0]>
  
      If ``periodic_boundary`` is True, the modulo of the number of wires of an index is used instead of an index,
      so that  ``wires.subset(i) == wires.subset(i % n_wires)`` where ``n_wires`` is the number of wires of this
      object.
  
      >>> wires = Wires([4, 0, 1, 5, 6])
      >>> wires.subset([5, 1, 7], periodic_boundary=True)
      <Wires = [4, 0, 1]>
  
      """
  
      if isinstance(indices, int):
          indices = [indices]
  
      if periodic_boundary:
          # replace indices by their modulo
          indices = [i % len(self._labels) for i in indices]
  
      for i in indices:
          if i > len(self._labels):
              raise WireError(
                  f"Cannot subset wire at index {i} from {len(self._labels)} wires."
              )
  
      subset = tuple(self._labels[i] for i in indices)
      return Wires(subset, _override=True)
  
imports: import functools
  import itertools
  from collections.abc import Iterable, Sequence
  import numpy
  from pennylane.pytrees import register_pytree
label_desc: Use image node_id 22 for calling the Wires obj's underlying member method code with example usage: obj.subset(indices, periodic_boundary) and returns: Wires