class_docstr: A global phase operation that multiplies all components of the state by :math:`e^{-i \phi}`.
  
  **Details:**
  
  * Number of wires: All (the operation acts on all wires)
  * Number of parameters: 1
  * Gradient recipe: None
  
  Args:
      phi (TensorLike): the global phase
      wires (Iterable[Any] or Any): unused argument - the operator is applied to all wires
      id (str): custom label given to an operator instance,
          can be useful for some applications where the instance has to be identified.
  
  **Example**
  
  .. code-block:: python3
  
      dev = qml.device("default.qubit", wires=2)
  
      @qml.qnode(dev)
      def circuit(phi=None, return_state=False):
          qml.PauliX(0)
          if phi:
              qml.GlobalPhase(phi)
          if return_state:
              return qml.state()
          return qml.expval(qml.PauliZ(0)), qml.expval(qml.PauliZ(1))
  
  The circuit yields the same expectation values with and without the global phase:
  
  >>> circuit()
  (tensor(-1., requires_grad=True), tensor(1., requires_grad=True))
  >>> circuit(phi=0.123)
  (tensor(-1., requires_grad=True), tensor(1., requires_grad=True))
  
  However, the states of the two systems differ by a global phase factor:
  
  >>> circuit(return_state=True)
  tensor([0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j], requires_grad=True)
  >>> circuit(return_state=True, phi=0.123)
  tensor([0.        +0.j        , 0.        +0.j        ,
          0.99244503-0.12269009j, 0.        +0.j        ], requires_grad=True)
  
  The operator can be applied with a control to create a relative phase between terms:
  
  .. code-block:: python3
  
      @qml.qnode(dev)
      def circuit():
          qml.Hadamard(0)
          qml.ctrl(qml.GlobalPhase(0.123), 0)
          return qml.state()
  
      >>> circuit()
      tensor([0.70710678+0.j        , 0.        +0.j        ,
              0.70176461-0.08675499j, 0.        +0.j        ], requires_grad=True)
class_docstr_tok: ["A","global","phase","operation","that","multiplies","all","components","of","the","state","by",":","math",":","`","e^","{","-i","\\phi","}","`",".","*","*","Details",":","*","*","*","Number","of","wires",":","All","(","the","operation","acts","on","all","wires",")","*","Number","of","parameters",":","1","*","Gradient","recipe",":","None","Args",":","phi","(","TensorLike",")",":","the","global","phase","wires","(","Iterable","[","Any","]","or","Any",")",":","unused","argument","-","the","operator","is","applied","to","all","wires","id","(","str",")",":","custom","label","given","to","an","operator","instance",",","can","be","useful","for","some","applications","where","the","instance","has","to","be","identified",".","*","*","Example","*","*","..","code-block",":",":","python3","dev","=","qml.device","(","``","default.qubit","''",",","wires=2",")","@","qml.qnode","(","dev",")","def","circuit","(","phi=None",",","return_state=False",")",":","qml.PauliX","(","0",")","if","phi",":","qml.GlobalPhase","(","phi",")","if","return_state",":","return","qml.state","(",")","return","qml.expval","(","qml.PauliZ","(","0",")",")",",","qml.expval","(","qml.PauliZ","(","1",")",")","The","circuit","yields","the","same","expectation","values","with","and","without","the","global","phase",":",">",">",">","circuit","(",")","(","tensor","(","-1.",",","requires_grad=True",")",",","tensor","(","1.",",","requires_grad=True",")",")",">",">",">","circuit","(","phi=0.123",")","(","tensor","(","-1.",",","requires_grad=True",")",",","tensor","(","1.",",","requires_grad=True",")",")","However",",","the","states","of","the","two","systems","differ","by","a","global","phase","factor",":",">",">",">","circuit","(","return_state=True",")","tensor","(","[","0.+0.j",",","0.+0.j",",","1.+0.j",",","0.+0.j","]",",","requires_grad=True",")",">",">",">","circuit","(","return_state=True",",","phi=0.123",")","tensor","(","[","0",".","+0.j",",","0",".","+0.j",",","0.99244503-0.12269009j",",","0",".","+0.j","]",",","requires_grad=True",")","The","operator","can","be","applied","with","a","control","to","create","a","relative","phase","between","terms",":","..","code-block",":",":","python3","@","qml.qnode","(","dev",")","def","circuit","(",")",":","qml.Hadamard","(","0",")","qml.ctrl","(","qml.GlobalPhase","(","0.123",")",",","0",")","return","qml.state","(",")",">",">",">","circuit","(",")","tensor","(","[","0.70710678+0.j",",","0",".","+0.j",",","0.70176461-0.08675499j",",","0",".","+0.j","]",",","requires_grad=True",")"]
docstr: Representation of the operator as a product of other operators (static method).
  
  .. note::
  
      The ``GlobalPhase`` operation decomposes to an empty list of operations.
      Support for global phase
      was added in v0.33 and was ignored in earlier versions of PennyLane. Setting
      global phase to decompose to nothing allows existing devices to maintain
      current support for operations which now have ``GlobalPhase`` in the
      decomposition pipeline.
  
  .. math:: O = O_1 O_2 \dots O_n.
  
  .. seealso:: :meth:`~.GlobalPhase.decomposition`.
  
  Args:
      phi (TensorLike): the global phase
      wires (Iterable[Any] or Any): unused argument - the operator is applied to all wires
  
  Returns:
      list[Operator]: decomposition into lower level operations
  
  **Example:**
  
  >>> qml.GlobalPhase.compute_decomposition(1.23)
  []
docstr_tok: ["Representation","of","the","operator","as","a","product","of","other","operators","(","static","method",")",".","..","note",":",":","The","``","GlobalPhase","``","operation","decomposes","to","an","empty","list","of","operations",".","Support","for","global","phase","was","added","in","v0.33","and","was","ignored","in","earlier","versions","of","PennyLane",".","Setting","global","phase","to","decompose","to","nothing","allows","existing","devices","to","maintain","current","support","for","operations","which","now","have","``","GlobalPhase","``","in","the","decomposition","pipeline",".","..","math",":",":","O","=","O_1","O_2","\\dots","O_n",".","..","seealso",":",":",":","meth",":","`","~.GlobalPhase.decomposition","`",".","Args",":","phi","(","TensorLike",")",":","the","global","phase","wires","(","Iterable","[","Any","]","or","Any",")",":","unused","argument","-","the","operator","is","applied","to","all","wires","Returns",":","list","[","Operator","]",":","decomposition","into","lower","level","operations","*","*","Example",":","*","*",">",">",">","qml.GlobalPhase.compute_decomposition","(","1.23",")","[","]"]
code: def compute_decomposition(
      phi, wires=None
  ):  # pylint:disable=arguments-differ,unused-argument
      r"""Representation of the operator as a product of other operators (static method).
  
      .. note::
  
          The ``GlobalPhase`` operation decomposes to an empty list of operations.
          Support for global phase
          was added in v0.33 and was ignored in earlier versions of PennyLane. Setting
          global phase to decompose to nothing allows existing devices to maintain
          current support for operations which now have ``GlobalPhase`` in the
          decomposition pipeline.
  
      .. math:: O = O_1 O_2 \dots O_n.
  
      .. seealso:: :meth:`~.GlobalPhase.decomposition`.
  
      Args:
          phi (TensorLike): the global phase
          wires (Iterable[Any] or Any): unused argument - the operator is applied to all wires
  
      Returns:
          list[Operator]: decomposition into lower level operations
  
      **Example:**
  
      >>> qml.GlobalPhase.compute_decomposition(1.23)
      []
  
      """
      return []
  
imports: from functools import lru_cache
  from scipy import sparse
  import pennylane
  from pennylane.operation import AnyWires, AllWires, CVObservable, Operation
label_desc: Use image node_id 6 for calling the GlobalPhase obj's underlying member method code with example usage: obj.compute_decomposition(phi, wires) and returns: list