
    z	i/                     V    S r SSKJr  SSKrSSKJr  SSKJr  SSKJ	r	   " S S\5      r
g)	zGlobal Phase Gate    )OptionalN)Gate)ParameterValueType)StandardGatec                      ^  \ rS rSrSr\R                  rSS\S\	\
   4U 4S jjjrS rSS\4S jjrSS	 jrS
 rSrU =r$ )GlobalPhaseGate   zThe global phase gate (:math:`e^{i\theta}`).

Can be applied to a :class:`~qiskit.circuit.QuantumCircuit`

Mathematical representation:

.. math::
    \text{GlobalPhaseGate}\ =
        \begin{pmatrix}
            e^{i\theta}
        \end{pmatrix}
phaselabelc                 (   > [         TU ]  SSU/US9  g)zZ
Args:
    phase: The value of phase it takes.
    label: An optional label for the gate.
global_phaser   )r   N)super__init__)selfr
   r   	__class__s      l/home/james-whalen/.local/lib/python3.13/site-packages/qiskit/circuit/library/standard_gates/global_phase.pyr   GlobalPhaseGate.__init__(   s     	UG5A    c                     SSK Jn  UR                  [        R                  R                  U R                  5      SU R                  S9U l        g )Nr   )QuantumCircuitT)legacy_qubitsname)	qiskit.circuitr   _from_circuit_datar   GlobalPhase_get_definitionparamsr   
definition)r   r   s     r   _defineGlobalPhaseGate._define0   s>    1(;;$$44T[[A < 
r   	annotatedc                 4    [        U R                  S   * 5      $ )a  Return inverse GlobalPhaseGate gate.

:math:`\text{GlobalPhaseGate}(\lambda)^{\dagger} = \text{GlobalPhaseGate}(-\lambda)`

Args:
    annotated: when set to ``True``, this is typically used to return an
        :class:`.AnnotatedOperation` with an inverse modifier set instead of a concrete
        :class:`.Gate`. However, for this class this argument is ignored as the inverse
        is always another :class:`.GlobalPhaseGate` with an inverted
        parameter value.

Returns:
    GlobalPhaseGate: inverse gate.
r   )r   r   )r   r!   s     r   inverseGlobalPhaseGate.inverse:   s     A//r   c                     USL a  [        S5      eU R                  S   n[        R                  " [        R                  " SU-  5      //U=(       d    [
        S9$ )z/Return a numpy.array for the global_phase gate.Fz9unable to avoid copy while creating an array as requestedr   y              ?)dtype)
ValueErrorr   numpyarrayexpcomplex)r   r&   copythetas       r   	__array__GlobalPhaseGate.__array__K   sK    5=XYYA{{UYYrEz234E<LWMMr   c                 P    [        U[        5      (       a  U R                  U5      $ g)NF)
isinstancer   _compare_parameters)r   others     r   __eq__GlobalPhaseGate.__eq__R   s#    e_--++E22r   )r   )N)F)NN)__name__
__module____qualname____firstlineno____doc__r   r   _standard_gater   r   strr   r   boolr#   r.   r4   __static_attributes____classcell__)r   s   @r   r   r      sW     "--NB0 B# B B
0 0"N r   r   )r:   typingr   r(   qiskit.circuit.gater   "qiskit.circuit.parameterexpressionr   qiskit._accelerate.circuitr   r    r   r   <module>rE      s%       $ A 3=d =r   