§
    º³ÙgÊ  ã                   ó’   — d Z ddlmZmZmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZ  G d„ d	e
¦  «        Z G d
„ de
¦  «        ZdS )zkFrequency instructions module. These instructions allow the user to manipulate
the frequency of a channel.
é    )ÚOptionalÚUnionÚTuple)ÚParameterExpression)ÚPulseChannel)ÚInstruction)Ú
PulseError)Údeprecate_pulse_funcc            	       óò   ‡ — e Zd ZdZe	 ddeeef         dede	e
         fˆ fd„¦   «         Zd„ Zedeeef         fd	„¦   «         Zedefd
„¦   «         Zedee         fd„¦   «         Zedefd„¦   «         Zˆ xZS )ÚSetFrequencyaä  Set the channel frequency. This instruction operates on ``PulseChannel`` s.
    A ``PulseChannel`` creates pulses of the form

    .. math::
        Re[\exp(i 2\pi f jdt + \phi) d_j].

    Here, :math:`f` is the frequency of the channel. The instruction ``SetFrequency`` allows
    the user to set the value of :math:`f`. All pulses that are played on a channel
    after SetFrequency has been called will have the corresponding frequency.

    The duration of SetFrequency is 0.
    NÚ	frequencyÚchannelÚnamec                 óR   •— t          ¦   «                              ||f|¬¦  «         dS )a  Creates a new set channel frequency instruction.

        Args:
            frequency: New frequency of the channel in Hz.
            channel: The channel this instruction operates on.
            name: Name of this set channel frequency instruction.
        ©Úoperandsr   N©ÚsuperÚ__init__©Úselfr   r   r   Ú	__class__s       €úY/granary/edev/quantum/lib/python3.11/site-packages/qiskit/pulse/instructions/frequency.pyr   zSetFrequency.__init__'   ó-   ø€ õ 	‰Œ×Ò 9¨gÐ"6¸TÐÑBÔBÐBÐBÐBó    c                 ój   — t          | j        t          ¦  «        st          d| j        › d�¦  «        ‚dS ©z§Called after initialization to validate instruction data.

        Raises:
            PulseError: If the input ``channel`` is not type :class:`PulseChannel`.
        zExpected a pulse channel, got z	 instead.N©Ú
isinstancer   r   r	   ©r   s    r   Ú	_validatezSetFrequency._validate7   óA   € õ ˜$œ,­Ñ5Ô5ð 	WÝÐU¸d¼lÐUÐUÐUÑVÔVÐVð	Wð 	Wr   Úreturnc                 ó   — | j         d         S )zNew frequency.r   ©r   r    s    r   r   zSetFrequency.frequency@   ó   € ð Œ}˜QÔÐr   c                 ó   — | j         d         S ©zmReturn the :py:class:`~qiskit.pulse.channels.Channel` that this instruction is
        scheduled on.
        é   r%   r    s    r   r   zSetFrequency.channelE   ó   € ð
 Œ}˜QÔÐr   c                 ó   — | j         fS ©z-Returns the channels that this schedule uses.©r   r    s    r   ÚchannelszSetFrequency.channelsL   ó   € ð ”ˆÐr   c                 ó   — dS ©zDuration of this instruction.r   © r    s    r   ÚdurationzSetFrequency.durationQ   ó	   € ð ˆqr   ©N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   Úfloatr   r   r   Ústrr   r!   Úpropertyr   r   r   r.   Úintr3   Ú__classcell__©r   s   @r   r   r      sQ  ø€ € € € € ðð ð ð
 #ð	Cð Cà˜Ð 3Ð3Ô4ðCð ðCð �sŒmð	Cð Cð Cð Cð Cñ ÔðCðWð Wð Wð ð ˜5 Ð(;Ð!;Ô<ð  ð  ð  ñ „Xð ð ð ˜ð  ð  ð  ñ „Xð ð ð˜% Ô-ð ð ð ñ „Xðð ð˜#ð ð ð ñ „Xðð ð ð ð r   r   c            	       óò   ‡ — e Zd ZdZe	 ddeeef         dede	e
         fˆ fd„¦   «         Zd„ Zedeeef         fd	„¦   «         Zedefd
„¦   «         Zedee         fd„¦   «         Zedefd„¦   «         Zˆ xZS )ÚShiftFrequencyz<Shift the channel frequency away from the current frequency.Nr   r   r   c                 óR   •— t          ¦   «                              ||f|¬¦  «         dS )a   Creates a new shift frequency instruction.

        Args:
            frequency: Frequency shift of the channel in Hz.
            channel: The channel this instruction operates on.
            name: Name of this set channel frequency instruction.
        r   Nr   r   s       €r   r   zShiftFrequency.__init__Z   r   r   c                 ój   — t          | j        t          ¦  «        st          d| j        › d�¦  «        ‚dS r   r   r    s    r   r!   zShiftFrequency._validatej   r"   r   r#   c                 ó   — | j         d         S )z'Frequency shift from the set frequency.r   r%   r    s    r   r   zShiftFrequency.frequencys   r&   r   c                 ó   — | j         d         S r(   r%   r    s    r   r   zShiftFrequency.channelx   r*   r   c                 ó   — | j         fS r,   r-   r    s    r   r.   zShiftFrequency.channels   r/   r   c                 ó   — dS r1   r2   r    s    r   r3   zShiftFrequency.duration„   r4   r   r5   r6   r@   s   @r   rB   rB   W   sK  ø€ € € € € ØFÐFàð
 #ð	Cð Cà˜Ð 3Ð3Ô4ðCð ðCð �sŒmð	Cð Cð Cð Cð Cñ ÔðCðWð Wð Wð ð ˜5 Ð(;Ð!;Ô<ð  ð  ð  ñ „Xð ð ð ˜ð  ð  ð  ñ „Xð ð ð˜% Ô-ð ð ð ñ „Xðð ð˜#ð ð ð ñ „Xðð ð ð ð r   rB   N)r:   Útypingr   r   r   Ú"qiskit.circuit.parameterexpressionr   Úqiskit.pulse.channelsr   Ú%qiskit.pulse.instructions.instructionr   Úqiskit.pulse.exceptionsr	   Úqiskit.utils.deprecate_pulser
   r   rB   r2   r   r   ú<module>rO      sè   ððð ð *Ð )Ð )Ð )Ð )Ð )Ð )Ð )Ð )Ð )à BÐ BÐ BÐ BÐ BÐ BØ .Ð .Ð .Ð .Ð .Ð .Ø =Ð =Ð =Ð =Ð =Ð =Ø .Ð .Ð .Ð .Ð .Ð .Ø =Ð =Ð =Ð =Ð =Ð =ð;ð ;ð ;ð ;ð ;�;ñ ;ô ;ð ;ð|0ð 0ð 0ð 0ð 0�[ñ 0ô 0ð 0ð 0ð 0r   