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",")"]
code: def matrix(self, wire_order=None):
      n_wires = len(wire_order) if wire_order else len(self.wires)
      return self.compute_matrix(self.data[0], n_wires=n_wires)
  
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 7 for calling the GlobalPhase obj's underlying member method code with example usage: obj.matrix(wire_order) and returns: self