class_docstr: Single excitation rotation.
  
  .. math:: U(\phi) = \begin{bmatrix}
              1 & 0 & 0 & 0 \\
              0 & \cos(\phi/2) & -\sin(\phi/2) & 0 \\
              0 & \sin(\phi/2) & \cos(\phi/2) & 0 \\
              0 & 0 & 0 & 1
          \end{bmatrix}.
  
  This operation performs a rotation in the two-dimensional subspace :math:`\{|01\rangle,
  |10\rangle\}`. The name originates from the occupation-number representation of
  fermionic wavefunctions, where the transformation  from :math:`|10\rangle` to :math:`|01\rangle`
  is interpreted as "exciting" a particle from the first qubit to the second.
  
  **Details:**
  
  * Number of wires: 2
  * Number of parameters: 1
  * Number of dimensions per parameter: (0,)
  * Gradient recipe: The ``SingleExcitation`` operator satisfies a four-term parameter-shift rule
    (see Appendix F, https://doi.org/10.1088/1367-2630/ac2cb3):
  
  Args:
      phi (float): rotation angle :math:`\phi`
      wires (Sequence[int]): the wires the operation acts on
      id (str or None): String representing the operation (optional)
  
  **Example**
  
  The following circuit performs the transformation :math:`|10\rangle\rightarrow \cos(
  \phi/2)|10\rangle -\sin(\phi/2)|01\rangle`:
  
  .. code-block::
  
      dev = qml.device('default.qubit', wires=2)
  
      @qml.qnode(dev)
      def circuit(phi):
          qml.PauliX(wires=0)
          qml.SingleExcitation(phi, wires=[0, 1])
          return qml.state()
  
      circuit(0.1)
class_docstr_tok: ["Single","excitation","rotation",".","..","math",":",":","U","(","\\phi",")","=","\\begin","{","bmatrix","}","1","&","0","&","0","&","0","\\\\","0","&","\\cos","(","\\phi\/2",")","&","-\\sin","(","\\phi\/2",")","&","0","\\\\","0","&","\\sin","(","\\phi\/2",")","&","\\cos","(","\\phi\/2",")","&","0","\\\\","0","&","0","&","0","&","1","\\end","{","bmatrix","}",".","This","operation","performs","a","rotation","in","the","two-dimensional","subspace",":","math",":","`","\\","{","|01\\rangle",",","|10\\rangle\\","}","`",".","The","name","originates","from","the","occupation-number","representation","of","fermionic","wavefunctions",",","where","the","transformation","from",":","math",":","`","|10\\rangle","`","to",":","math",":","`","|01\\rangle","`","is","interpreted","as","``","exciting","''","a","particle","from","the","first","qubit","to","the","second",".","*","*","Details",":","*","*","*","Number","of","wires",":","2","*","Number","of","parameters",":","1","*","Number","of","dimensions","per","parameter",":","(","0",",",")","*","Gradient","recipe",":","The","``","SingleExcitation","``","operator","satisfies","a","four-term","parameter-shift","rule","(","see","Appendix","F",",","https",":","\/\/doi.org\/10.1088\/1367-2630\/ac2cb3",")",":","Args",":","phi","(","float",")",":","rotation","angle",":","math",":","`","\\phi","`","wires","(","Sequence","[","int","]",")",":","the","wires","the","operation","acts","on","id","(","str","or","None",")",":","String","representing","the","operation","(","optional",")","*","*","Example","*","*","The","following","circuit","performs","the","transformation",":","math",":","`","|10\\rangle\\rightarrow","\\cos","(","\\phi\/2",")","|10\\rangle","-\\sin","(","\\phi\/2",")","|01\\rangle","`",":","..","code-block",":",":","dev","=","qml.device","(","'default.qubit","'",",","wires=2",")","@","qml.qnode","(","dev",")","def","circuit","(","phi",")",":","qml.PauliX","(","wires=0",")","qml.SingleExcitation","(","phi",",","wires=","[","0",",","1","]",")","return","qml.state","(",")","circuit","(","0.1",")"]
docstr: Representation of the operator as a product of other operators (static method). :
  
  .. math:: O = O_1 O_2 \dots O_n.
  
  
  .. seealso:: :meth:`~.SingleExcitation.decomposition`.
  
  Args:
      phi (float): rotation angle :math:`\phi`
      wires (Iterable, Wires): wires that the operator acts on
  
  Returns:
      list[Operator]: decomposition into lower level operations
  
  **Example:**
  
  >>> qml.SingleExcitation.compute_decomposition(1.23, wires=(0,1))
  [Adjoint(T(wires=[0])),
   Hadamard(wires=[0]),
   S(wires=[0]),
   Adjoint(T(wires=[1])),
   Adjoint(S(wires=[1])),
   Hadamard(wires=[1]),
   CNOT(wires=[1, 0]),
   RZ(-0.615, wires=[0]),
   RY(0.615, wires=[1]),
   CNOT(wires=[1, 0]),
   Adjoint(S(wires=[0])),
   Hadamard(wires=[0]),
   T(wires=[0]),
   Hadamard(wires=[1]),
   S(wires=[1]),
   T(wires=[1])]
docstr_tok: ["Representation","of","the","operator","as","a","product","of","other","operators","(","static","method",")",".",":","..","math",":",":","O","=","O_1","O_2","\\dots","O_n",".","..","seealso",":",":",":","meth",":","`","~.SingleExcitation.decomposition","`",".","Args",":","phi","(","float",")",":","rotation","angle",":","math",":","`","\\phi","`","wires","(","Iterable",",","Wires",")",":","wires","that","the","operator","acts","on","Returns",":","list","[","Operator","]",":","decomposition","into","lower","level","operations","*","*","Example",":","*","*",">",">",">","qml.SingleExcitation.compute_decomposition","(","1.23",",","wires=","(","0,1",")",")","[","Adjoint","(","T","(","wires=","[","0","]",")",")",",","Hadamard","(","wires=","[","0","]",")",",","S","(","wires=","[","0","]",")",",","Adjoint","(","T","(","wires=","[","1","]",")",")",",","Adjoint","(","S","(","wires=","[","1","]",")",")",",","Hadamard","(","wires=","[","1","]",")",",","CNOT","(","wires=","[","1",",","0","]",")",",","RZ","(","-0.615",",","wires=","[","0","]",")",",","RY","(","0.615",",","wires=","[","1","]",")",",","CNOT","(","wires=","[","1",",","0","]",")",",","Adjoint","(","S","(","wires=","[","0","]",")",")",",","Hadamard","(","wires=","[","0","]",")",",","T","(","wires=","[","0","]",")",",","Hadamard","(","wires=","[","1","]",")",",","S","(","wires=","[","1","]",")",",","T","(","wires=","[","1","]",")","]"]
code: def compute_decomposition(phi, wires):
      r"""Representation of the operator as a product of other operators (static method). :
  
      .. math:: O = O_1 O_2 \dots O_n.
  
  
      .. seealso:: :meth:`~.SingleExcitation.decomposition`.
  
      Args:
          phi (float): rotation angle :math:`\phi`
          wires (Iterable, Wires): wires that the operator acts on
  
      Returns:
          list[Operator]: decomposition into lower level operations
  
      **Example:**
  
      >>> qml.SingleExcitation.compute_decomposition(1.23, wires=(0,1))
      [Adjoint(T(wires=[0])),
       Hadamard(wires=[0]),
       S(wires=[0]),
       Adjoint(T(wires=[1])),
       Adjoint(S(wires=[1])),
       Hadamard(wires=[1]),
       CNOT(wires=[1, 0]),
       RZ(-0.615, wires=[0]),
       RY(0.615, wires=[1]),
       CNOT(wires=[1, 0]),
       Adjoint(S(wires=[0])),
       Hadamard(wires=[0]),
       T(wires=[0]),
       Hadamard(wires=[1]),
       S(wires=[1]),
       T(wires=[1])]
  
      """
      # This decomposition was found by plugging the matrix representation
      # into transforms.two_qubit_decomposition and post-processing some of
      # the resulting single-qubit gates.
      decomp_ops = [
          qml.adjoint(qml.T)(wires=wires[0]),
          qml.Hadamard(wires=wires[0]),
          qml.S(wires=wires[0]),
          qml.adjoint(qml.T)(wires=wires[1]),
          qml.adjoint(qml.S)(wires=wires[1]),
          qml.Hadamard(wires=wires[1]),
          qml.CNOT(wires=[wires[1], wires[0]]),
          qml.RZ(-phi / 2, wires=wires[0]),
          qml.RY(phi / 2, wires=wires[1]),
          qml.CNOT(wires=[wires[1], wires[0]]),
          qml.adjoint(qml.S)(wires=wires[0]),
          qml.Hadamard(wires=wires[0]),
          qml.T(wires=wires[0]),
          qml.Hadamard(wires=wires[1]),
          qml.S(wires=wires[1]),
          qml.T(wires=wires[1]),
      ]
      return decomp_ops
  
imports: import functools
  import numpy
  from scipy.sparse import csr_matrix
  import pennylane
  from pennylane.operation import Operation
label_desc: Use image node_id 4 for calling the SingleExcitation obj's underlying member method code with example usage: obj.compute_decomposition(phi, wires) and returns: decomp_ops