class_docstr: CosineWindow(wires)
  Prepares an initial state with a cosine wave function.
  
  The wave function is defined below where :math:`m` is the number of wires.
  
  .. math::
  
      |\psi\rangle = \sqrt{2^{1-m}} \sum_{k=0}^{2^m-1} \cos(\frac{\pi k}{2^m} - \frac{\pi}{2}) |k\rangle,
  
  .. figure:: ../../_static/templates/state_preparations/cosine_window.png
      :align: center
      :width: 65%
      :target: javascript:void(0);
  
  .. note::
  
      The wave function is shifted by :math:`\frac{\pi}{2}` units so that the window is centered.
  
  For more details see `Phys. Rev. D 106 (2022) <https://journals.aps.org/prd/abstract/10.1103/PhysRevD.106.034503>`_.
  
  .. seealso:: :class:`~.QuantumPhaseEstimation` and :class:`~.QFT`.
  
  Args:
      wires (Sequence[int] or int): the wire(s) the operation acts on
  
  **Example**
  
  >>> dev = qml.device('default.qubit', wires=2)
  >>> @qml.qnode(dev)
  ... def example_circuit():
  ...     qml.CosineWindow(wires=range(2))
  ...     return qml.probs()
  >>> print(example_circuit())
  [1.87469973e-33 2.50000000e-01 5.00000000e-01 2.50000000e-01]
docstr: Representation of the operator as a product of other operators (static method).
  It is efficiently decomposed from one QFT over all qubits and one-qubit rotation gates.
  
  Args:
      wires (Iterable, Wires): the wire(s) the operation acts on
  
  Returns:
      list[Operator]: decomposition into lower level operations
docstr_tok: ["Representation","of","the","operator","as","a","product","of","other","operators","(","static","method",")",".","It","is","efficiently","decomposed","from","one","QFT","over","all","qubits","and","one-qubit","rotation","gates",".","Args",":","wires","(","Iterable",",","Wires",")",":","the","wire","(","s",")","the","operation","acts","on","Returns",":","list","[","Operator","]",":","decomposition","into","lower","level","operations"]
code: def compute_decomposition(
      wires,
  ):  # pylint: disable=arguments-differ,unused-argument
      r"""Representation of the operator as a product of other operators (static method).
      It is efficiently decomposed from one QFT over all qubits and one-qubit rotation gates.
  
      Args:
          wires (Iterable, Wires): the wire(s) the operation acts on
  
      Returns:
          list[Operator]: decomposition into lower level operations
      """
  
      decomp_ops = []
  
      decomp_ops.append(qml.Hadamard(wires=wires[-1]))
      decomp_ops.append(qml.RZ(np.pi, wires=wires[-1]))
      decomp_ops.append(qml.adjoint(qml.QFT)(wires=wires))
  
      for ind, wire in enumerate(wires):
          decomp_ops.append(
              qml.PhaseShift(np.pi * 2 ** (-ind - 1), wires=wire)
          )
  
      return decomp_ops
  
file_path: pennylane/pennylane/templates/state_preparations/cosine_window.py
imports: import numpy
  import pennylane
  from pennylane.operation import StatePrepBase
  from pennylane import math
  from pennylane.wires import Wires, WireError
label_desc: Use image node_id 1 for calling the CosineWindow obj's underlying member method code with example usage: obj.compute_decomposition(wires) and returns: decomp_ops