class_docstr: Double excitation rotation.
  
  This operation performs an :math:`SO(2)` rotation in the two-dimensional subspace :math:`\{
  |1100\rangle,|0011\rangle\}`. More precisely, it performs the transformation
  
  .. math::
  
      &|0011\rangle \rightarrow \cos(\phi/2) |0011\rangle + \sin(\phi/2) |1100\rangle\\
      &|1100\rangle \rightarrow \cos(\phi/2) |1100\rangle - \sin(\phi/2) |0011\rangle,
  
  while leaving all other basis states unchanged.
  
  The name originates from the occupation-number representation of fermionic wavefunctions, where
  the transformation from :math:`|1100\rangle` to :math:`|0011\rangle` is interpreted as
  "exciting" two particles from the first pair of qubits to the second pair of qubits.
  
  **Details:**
  
  * Number of wires: 4
  * Number of parameters: 1
  * Number of dimensions per parameter: (0,)
  * Gradient recipe: The ``DoubleExcitation`` 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:`|1100\rangle\rightarrow \cos(
  \phi/2)|1100\rangle - \sin(\phi/2)|0011\rangle)`:
  
  .. code-block::
  
      dev = qml.device('default.qubit', wires=4)
  
      @qml.qnode(dev)
      def circuit(phi):
          qml.PauliX(wires=0)
          qml.PauliX(wires=1)
          qml.DoubleExcitation(phi, wires=[0, 1, 2, 3])
          return qml.state()
  
      circuit(0.1)
class_docstr_tok: ["Double","excitation","rotation",".","This","operation","performs","an",":","math",":","`","SO","(","2",")","`","rotation","in","the","two-dimensional","subspace",":","math",":","`","\\","{","|1100\\rangle",",","|0011\\rangle\\","}","`",".","More","precisely",",","it","performs","the","transformation","..","math",":",":","&","|0011\\rangle","\\rightarrow","\\cos","(","\\phi\/2",")","|0011\\rangle","+","\\sin","(","\\phi\/2",")","|1100\\rangle\\\\","&","|1100\\rangle","\\rightarrow","\\cos","(","\\phi\/2",")","|1100\\rangle","-","\\sin","(","\\phi\/2",")","|0011\\rangle",",","while","leaving","all","other","basis","states","unchanged",".","The","name","originates","from","the","occupation-number","representation","of","fermionic","wavefunctions",",","where","the","transformation","from",":","math",":","`","|1100\\rangle","`","to",":","math",":","`","|0011\\rangle","`","is","interpreted","as","''","exciting","''","two","particles","from","the","first","pair","of","qubits","to","the","second","pair","of","qubits",".","*","*","Details",":","*","*","*","Number","of","wires",":","4","*","Number","of","parameters",":","1","*","Number","of","dimensions","per","parameter",":","(","0",",",")","*","Gradient","recipe",":","The","``","DoubleExcitation","``","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",":","`","|1100\\rangle\\rightarrow","\\cos","(","\\phi\/2",")","|1100\\rangle","-","\\sin","(","\\phi\/2",")","|0011\\rangle",")","`",":","..","code-block",":",":","dev","=","qml.device","(","'default.qubit","'",",","wires=4",")","@","qml.qnode","(","dev",")","def","circuit","(","phi",")",":","qml.PauliX","(","wires=0",")","qml.PauliX","(","wires=1",")","qml.DoubleExcitation","(","phi",",","wires=","[","0",",","1",",","2",",","3","]",")","return","qml.state","(",")","circuit","(","0.1",")"]
docstr: Representation of the operator as a canonical matrix in the computational basis (static method).
  
  The canonical matrix is the textbook matrix representation that does not consider wires.
  Implicitly, this assumes that the wires of the operator correspond to the global wire order.
  
  .. seealso:: :meth:`~.DoubleExcitation.matrix`
  
  
  Args:
    phi (tensor_like or float): rotation angle
  
  Returns:
    tensor_like: canonical matrix
docstr_tok: ["Representation","of","the","operator","as","a","canonical","matrix","in","the","computational","basis","(","static","method",")",".","The","canonical","matrix","is","the","textbook","matrix","representation","that","does","not","consider","wires",".","Implicitly",",","this","assumes","that","the","wires","of","the","operator","correspond","to","the","global","wire","order",".","..","seealso",":",":",":","meth",":","`","~.DoubleExcitation.matrix","`","Args",":","phi","(","tensor_like","or","float",")",":","rotation","angle","Returns",":","tensor_like",":","canonical","matrix"]
code: def compute_matrix(phi):  # pylint: disable=arguments-differ
      r"""Representation of the operator as a canonical matrix in the computational basis (static method).
  
      The canonical matrix is the textbook matrix representation that does not consider wires.
      Implicitly, this assumes that the wires of the operator correspond to the global wire order.
  
      .. seealso:: :meth:`~.DoubleExcitation.matrix`
  
  
      Args:
        phi (tensor_like or float): rotation angle
  
      Returns:
        tensor_like: canonical matrix
      """
      return _double_excitations_matrix(phi, 0.0)
  
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 DoubleExcitation obj's underlying member method code with example usage: obj.compute_matrix(phi) and returns: _double_excitations_matrix