class_docstr: Encodes :math:`n` binary features into a basis state of :math:`n` qubits.
  
  For example, for ``features=np.array([0, 1, 0])`` or ``features=2`` (binary 10), the
  quantum system will be prepared in state :math:`|010 \rangle`.
  
  .. warning::
  
      ``BasisEmbedding`` calls a circuit whose architecture depends on the binary features.
      The ``features`` argument is therefore not differentiable when using the template, and
      gradients with respect to the argument cannot be computed by PennyLane.
  
  Args:
      features (tensor_like): binary input of shape ``(len(wires), )``
      wires (Any or Iterable[Any]): wires that the template acts on
  
  Example:
  
      Basis embedding encodes the binary feature vector into a basis state.
  
      .. code-block:: python
  
          dev = qml.device('default.qubit', wires=3)
  
          @qml.qnode(dev)
          def circuit(feature_vector):
              qml.BasisEmbedding(features=feature_vector, wires=range(3))
              return qml.state()
  
          X = [1,1,1]
  
      The resulting circuit is:
  
      >>> print(qml.draw(circuit, expansion_strategy="device")(X))
      0: ──X─┤  State
      1: ──X─┤  State
      2: ──X─┤  State
  
      And, the output state is:
  
      >>> print(circuit(X))
          [0.+0.j 0.+0.j 0.+0.j 0.+0.j 0.+0.j 0.+0.j 0.+0.j 1.+0.j]
  
      Thus, ``[1,1,1]`` is mapped to :math:`|111 \rangle`.
docstr: Representation of the operator as a product of other operators.
  
  .. math:: O = O_1 O_2 \dots O_n.
  
  
  
  .. seealso:: :meth:`~.BasisEmbedding.decomposition`.
  
  Args:
      features (tensor-like): binary input of shape ``(len(wires), )``
      wires (Any or Iterable[Any]): wires that the operator acts on
  
  Returns:
      list[.Operator]: decomposition of the operator
  
  **Example**
  
  >>> features = torch.tensor([1, 0, 1])
  >>> qml.BasisEmbedding.compute_decomposition(features, wires=["a", "b", "c"])
  [PauliX(wires=['a']),
   PauliX(wires=['c'])]
docstr_tok: ["Representation","of","the","operator","as","a","product","of","other","operators",".","..","math",":",":","O","=","O_1","O_2","\\dots","O_n",".","..","seealso",":",":",":","meth",":","`","~.BasisEmbedding.decomposition","`",".","Args",":","features","(","tensor-like",")",":","binary","input","of","shape","``","(","len","(","wires",")",",",")","``","wires","(","Any","or","Iterable","[","Any","]",")",":","wires","that","the","operator","acts","on","Returns",":","list","[",".Operator","]",":","decomposition","of","the","operator","*","*","Example","*","*",">",">",">","features","=","torch.tensor","(","[","1",",","0",",","1","]",")",">",">",">","qml.BasisEmbedding.compute_decomposition","(","features",",","wires=","[","``","a","''",",","``","b","''",",","``","c","''","]",")","[","PauliX","(","wires=","[","'","a","'","]",")",",","PauliX","(","wires=","[","'","c","'","]",")","]"]
code: def compute_decomposition(
      wires, basis_state
  ):  # 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:`~.BasisEmbedding.decomposition`.
  
      Args:
          features (tensor-like): binary input of shape ``(len(wires), )``
          wires (Any or Iterable[Any]): wires that the operator acts on
  
      Returns:
          list[.Operator]: decomposition of the operator
  
      **Example**
  
      >>> features = torch.tensor([1, 0, 1])
      >>> qml.BasisEmbedding.compute_decomposition(features, wires=["a", "b", "c"])
      [PauliX(wires=['a']),
       PauliX(wires=['c'])]
      """
      if not qml.math.is_abstract(basis_state):
          ops_list = []
          for wire, bit in zip(wires, basis_state):
              if bit == 1:
                  ops_list.append(qml.PauliX(wire))
          return ops_list
  
      ops_list = []
      for wire, state in zip(wires, basis_state):
          ops_list.append(qml.PhaseShift(state * np.pi / 2, wire))
          ops_list.append(qml.RX(state * np.pi, wire))
          ops_list.append(qml.PhaseShift(state * np.pi / 2, wire))
  
      return ops_list
  
file_path: pennylane/pennylane/templates/embeddings/basis.py
imports: import numpy
  import pennylane
  from pennylane.operation import Operation, AnyWires
  from pennylane.wires import Wires
label_desc: Use image node_id 5 for calling the BasisEmbedding obj's underlying member method code with example usage: obj.compute_decomposition(wires, basis_state) and returns: ops_list, ops_list