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",")"]
code: def __init__(self, phi, wires, id=None):
      super().__init__(phi, wires=wires, id=id)
  
imports: import functools
  import numpy
  from scipy.sparse import csr_matrix
  import pennylane
  from pennylane.operation import Operation
label_desc: Use image node_id 3 to create a new DoubleExcitation object from inherited base classes: Operation with example: obj = DoubleExcitation(phi, wires, id)