class_docstr: Prepares a basis state on the given wires using a sequence of TShift gates.
  
  .. warning::
  
      ``basis_state`` influences the circuit architecture and is therefore incompatible with
      gradient computations.
  
  Args:
      basis_state (array): Input array of shape ``(n,)``, where n is the number of wires
          the state preparation acts on.
      wires (Iterable): wires that the template acts on
  
  **Example**
  
  .. code-block:: python
  
      dev = qml.device("default.qutrit", wires=4)
  
      @qml.qnode(dev)
      def circuit(basis_state, obs):
          qml.QutritBasisStatePreparation(basis_state, wires=range(4))
          return [qml.expval(qml.THermitian(obs, wires=i)) for i in range(4)]
  
      basis_state = [0, 1, 1, 0]
      obs = np.array([[1, 1, 0], [1, -1, 0], [0, 0, np.sqrt(2)]]) / np.sqrt(2)
  
  >>> print(circuit(basis_state, obs))
  [array(0.70710678), array(-0.70710678), array(-0.70710678), array(0.70710678)]
class_docstr_tok: ["Prepares","a","basis","state","on","the","given","wires","using","a","sequence","of","TShift","gates",".","..","warning",":",":","``","basis_state","``","influences","the","circuit","architecture","and","is","therefore","incompatible","with","gradient","computations",".","Args",":","basis_state","(","array",")",":","Input","array","of","shape","``","(","n",",",")","``",",","where","n","is","the","number","of","wires","the","state","preparation","acts","on",".","wires","(","Iterable",")",":","wires","that","the","template","acts","on","*","*","Example","*","*","..","code-block",":",":","python","dev","=","qml.device","(","``","default.qutrit","''",",","wires=4",")","@","qml.qnode","(","dev",")","def","circuit","(","basis_state",",","obs",")",":","qml.QutritBasisStatePreparation","(","basis_state",",","wires=range","(","4",")",")","return","[","qml.expval","(","qml.THermitian","(","obs",",","wires=i",")",")","for","i","in","range","(","4",")","]","basis_state","=","[","0",",","1",",","1",",","0","]","obs","=","np.array","(","[","[","1",",","1",",","0","]",",","[","1",",","-1",",","0","]",",","[","0",",","0",",","np.sqrt","(","2",")","]","]",")","\/","np.sqrt","(","2",")",">",">",">","print","(","circuit","(","basis_state",",","obs",")",")","[","array","(","0.70710678",")",",","array","(","-0.70710678",")",",","array","(","-0.70710678",")",",","array","(","0.70710678",")","]"]
docstr: Representation of the operator as a product of other operators.
  
  .. math:: O = O_1 O_2 \dots O_n.
  
  
   .. seealso:: :meth:`~.BasisState.decomposition`.
  
  Args:
      basis_state (array): Input array of shape ``(len(wires),)``
      wires (Any or Iterable[Any]): wires that the operator acts on
  
  Returns:
      list[.Operator]: decomposition of the operator
  
  **Example**
  
  >>> qml.QutritBasisStatePreparation.compute_decomposition(basis_state=[1, 2], wires=["a", "b"])
  [Tshift(wires=['a']),
  Tshift(wires=['b']),
  TShift(wires=['b'])]
docstr_tok: ["Representation","of","the","operator","as","a","product","of","other","operators",".","..","math",":",":","O","=","O_1","O_2","\\dots","O_n",".","..","seealso",":",":",":","meth",":","`","~.BasisState.decomposition","`",".","Args",":","basis_state","(","array",")",":","Input","array","of","shape","``","(","len","(","wires",")",",",")","``","wires","(","Any","or","Iterable","[","Any","]",")",":","wires","that","the","operator","acts","on","Returns",":","list","[",".Operator","]",":","decomposition","of","the","operator","*","*","Example","*","*",">",">",">","qml.QutritBasisStatePreparation.compute_decomposition","(","basis_state=","[","1",",","2","]",",","wires=","[","``","a","''",",","``","b","''","]",")","[","Tshift","(","wires=","[","'","a","'","]",")",",","Tshift","(","wires=","[","'","b","'","]",")",",","TShift","(","wires=","[","'","b","'","]",")","]"]
code: def compute_decomposition(
      basis_state, wires
  ):  # pylint: disable=arguments-differ
      r"""Representation of the operator as a product of other operators.
  
      .. math:: O = O_1 O_2 \dots O_n.
  
  
       .. seealso:: :meth:`~.BasisState.decomposition`.
  
      Args:
          basis_state (array): Input array of shape ``(len(wires),)``
          wires (Any or Iterable[Any]): wires that the operator acts on
  
      Returns:
          list[.Operator]: decomposition of the operator
  
      **Example**
  
      >>> qml.QutritBasisStatePreparation.compute_decomposition(basis_state=[1, 2], wires=["a", "b"])
      [Tshift(wires=['a']),
      Tshift(wires=['b']),
      TShift(wires=['b'])]
      """
  
      op_list = []
      for wire, state in zip(wires, basis_state):
          for _ in range(0, state):
              op_list.append(qml.TShift(wire))
      return op_list
  
imports: import pennylane
  from pennylane.operation import Operation, AnyWires
label_desc: Use image node_id 2 for calling the QutritBasisStatePreparation obj's underlying member method code with example usage: obj.compute_decomposition(basis_state, wires) and returns: op_list