§
    º³Ùg"E  ã                  ó*  — d Z ddlmZ ddlmZ ddlmZmZmZ ddlm	Z	m
Z
 ddlmZ ddlmZmZ ddlmZmZ dd	lmZ dd
lmZmZ ddlmZmZ ddlmZ ddlmZmZm Z   G d„ d¦  «        Z! G d„ de!¦  «        Z" G d„ de!¦  «        Z# G d„ d¦  «        Z$dS )a  "Management of pulse program parameters.

Background
==========

In contrast to ``QuantumCircuit``, in pulse programs, parameter objects can be stored in
multiple places at different layers, for example

- program variables: ``ScheduleBlock.alignment_context._context_params``

- instruction operands: ``ShiftPhase.phase``, ...

- operand parameters: ``pulse.parameters``, ``channel.index`` ...

This complexity is due to the tight coupling of the program to an underlying device Hamiltonian,
i.e. the variance of physical parameters between qubits and their couplings.
If we want to define a program that can be used with arbitrary qubits,
we should be able to parametrize every control parameter in the program.

Implementation
==============

Managing parameters in each object within a program, i.e. the ``ParameterTable`` model,
makes the framework quite complicated. With the ``ParameterManager`` class within this module,
the parameter assignment operation is performed by a visitor instance.

The visitor pattern is a way of separating data processing from the object on which it operates.
This removes the overhead of parameter management from each piece of the program.
The computational complexity of the parameter assignment operation may be increased
from the parameter table model of ~O(1), however, usually, this calculation occurs
only once before the program is executed. Thus this doesn't hurt user experience during
pulse programming. On the contrary, it removes parameter table object and associated logic
from each object, yielding smaller object creation cost and higher performance
as the data amount scales.

Note that we don't need to write any parameter management logic for each object,
and thus this parameter framework gives greater scalability to the pulse module.
é    )Úannotations)Úcopy)ÚAnyÚMappingÚSequence)ÚParameterVectorÚParameterVectorElement)Ú	Parameter)ÚParameterExpressionÚParameterValueType)ÚinstructionsÚchannels)Ú
PulseError)ÚSymbolicPulseÚWaveform)ÚScheduleÚScheduleBlock)ÚAlignmentKind)Úformat_parameter_valueÚ_validate_parameter_vectorÚ_validate_parameter_valuec                  ó8   — e Zd ZdZdd„Zd„ Zdd„Zdd	„Zdd
„ZdS )ÚNodeVisitora5  A node visitor base class that walks instruction data in a pulse program and calls
    visitor functions for every node.

    Though this class implementation is based on Python AST, each node doesn't have
    a dedicated node class due to the lack of an abstract syntax tree for pulse programs in
    Qiskit. Instead of parsing pulse programs, this visitor class finds the associated visitor
    function based on class name of the instruction node, i.e. ``Play``, ``Call``, etc...
    The `.visit` method recursively checks superclass of given node since some parametrized
    components such as ``DriveChannel`` may share a common superclass with other subclasses.
    In this example, we can just define ``visit_Channel`` method instead of defining
    the same visitor function for every subclasses.

    Some instructions may have special logic or data structure to store parameter objects,
    and visitor functions for these nodes should be individually defined.

    Because pulse programs can be nested into another pulse program,
    the visitor function should be able to recursively call proper visitor functions.
    If visitor function is not defined for a given node, ``generic_visit``
    method is called. Usually, this method is provided for operating on object defined
    outside of the Qiskit Pulse module.
    Únoder   c                ó\   — |                       t          |¦  «        ¦  «        } ||¦  «        S )zVisit a node.)Ú_get_visitorÚtype)Úselfr   Úvisitors      úT/granary/edev/quantum/lib/python3.11/site-packages/qiskit/pulse/parameter_manager.pyÚvisitzNodeVisitor.visit_   s)   € à×#Ò#¥D¨¡J¤JÑ/Ô/ˆØˆw�t‰}Œ}Ðó    c                ó¬   — |t           k    r| j        S 	 t          | d|j        › �¦  «        S # t          $ r |                      |j        ¦  «        cY S w xY w)zGA helper function to recursively investigate superclass visitor method.Úvisit_)ÚobjectÚgeneric_visitÚgetattrÚ__name__ÚAttributeErrorr   Ú__base__)r   Ú
node_classs     r    r   zNodeVisitor._get_visitord   so   € à�ÒÐØÔ%Ð%ð	:Ý˜4Ð!?¨*Ô*=Ð!?Ð!?Ñ@Ô@Ð@øÝð 	:ð 	:ð 	:à×$Ò$ ZÔ%8Ñ9Ô9Ð9Ð9Ð9ð	:øøøs   ”, ¬$AÁAr   c                ó   — t           ‚©z§Visit ``ScheduleBlock``. Recursively visit context blocks and overwrite.

        .. note:: ``ScheduleBlock`` can have parameters in blocks and its alignment.
        ©ÚNotImplementedError©r   r   s     r    Úvisit_ScheduleBlockzNodeVisitor.visit_ScheduleBlocko   s
   € õ
 "Ð!r"   r   c                ó   — t           ‚)úFVisit ``Schedule``. Recursively visit schedule children and overwrite.r.   r0   s     r    Úvisit_SchedulezNodeVisitor.visit_Schedulev   ó   € å!Ð!r"   c                ó   — t           ‚)z9Called if no explicit visitor function exists for a node.r.   r0   s     r    r&   zNodeVisitor.generic_visitz   r5   r"   N©r   r   ©r   r   ©r   r   )	r(   Ú
__module__Ú__qualname__Ú__doc__r!   r   r1   r4   r&   © r"   r    r   r   H   s}   € € € € € ðð ð,ð ð ð ð
	:ð 	:ð 	:ð"ð "ð "ð "ð"ð "ð "ð "ð"ð "ð "ð "ð "ð "r"   r   c                  ój   — e Zd ZdZdd„Zdd„Zdd	„Zdd„Zd d„Zd!d„Z	d"d„Z
d#d„Zd$d„Zd%d„Zd&d„ZdS )'ÚParameterSetterz«Node visitor for parameter binding.

    This visitor is initialized with a dictionary of parameters to be assigned,
    and assign values to operands of nodes found.
    Ú	param_mapú-dict[ParameterExpression, ParameterValueType]c                ó   — || _         d S ©N)Ú
_param_map)r   r@   s     r    Ú__init__zParameterSetter.__init__†   s   € Ø#ˆŒˆˆr"   r   r   c                ó¬   — |                       |j        ¦  «        |_        |j        D ]}|                      |¦  «         Œ|                      |¦  «         |S r-   )Úvisit_AlignmentKindÚalignment_contextÚ_alignment_contextÚ_blocksr!   Ú_update_parameter_manager)r   r   Úelms      r    r1   z#ParameterSetter.visit_ScheduleBlock‹   sX   € ð
 #'×":Ò":¸4Ô;QÑ"RÔ"RˆÔØ”<ð 	ð 	ˆCØ�JŠJ�s‰OŒOˆOˆOà×&Ò& tÑ,Ô,Ð,Øˆr"   r   c                óŠ   ‡ — ˆ fd„|j         D ¦   «         |_        |                     ¦   «          ‰                      |¦  «         |S )r3   c                óD   •— g | ]\  }}|‰                      |¦  «        f‘ŒS r=   ©r!   )Ú.0Út0Úschedr   s      €r    ú
<listcomp>z2ParameterSetter.visit_Schedule.<locals>.<listcomp>›   s.   ø€ Ð#_Ð#_Ð#_Á	ÀÀE R¨¯ª°EÑ):Ô):Ð$;Ð#_Ð#_Ð#_r"   )r   Ú_Schedule__childrenÚ_renew_timeslotsrK   r0   s   ` r    r4   zParameterSetter.visit_Schedule—   sP   ø€ ð $`Ð#_Ð#_Ð#_ÈTÔM^Ð#_Ñ#_Ô#_ˆÔ Ø×ÒÑÔÐà×&Ò& tÑ,Ô,Ð,Øˆr"   r   c                óV   ‡ — t          ˆ fd„|j        D ¦   «         ¦  «        }||_        |S )z=Assign parameters to block's ``AlignmentKind`` specification.c              3  óB   •K  — | ]}‰                      |¦  «        V — Œd S rC   rO   )rP   Úparamr   s     €r    ú	<genexpr>z6ParameterSetter.visit_AlignmentKind.<locals>.<genexpr>£   s/   øè è € ÐSÐS°U˜tŸzšz¨%Ñ0Ô0ÐSÐSÐSÐSÐSÐSr"   )ÚtupleÚ_context_params)r   r   Únew_parameterss   `  r    rG   z#ParameterSetter.visit_AlignmentKind¡   s5   ø€ åÐSÐSÐSÐS¸dÔ>RÐSÑSÔSÑSÔSˆØ-ˆÔàˆr"   úinstructions.Instructionc                óz   ‡ — |                      ¦   «         r%t          ˆ fd„|j        D ¦   «         ¦  «        |_        |S )z¹Assign parameters to general pulse instruction.

        .. note:: All parametrized object should be stored in the operands.
            Otherwise parameter cannot be detected.
        c              3  óB   •K  — | ]}‰                      |¦  «        V — Œd S rC   rO   )rP   Úopr   s     €r    rY   z4ParameterSetter.visit_Instruction.<locals>.<genexpr>±   s-   øè è € Ð"JÐ"J°b 4§:¢:¨b¡>¤>Ð"JÐ"JÐ"JÐ"JÐ"JÐ"Jr"   )Úis_parameterizedrZ   ÚoperandsÚ	_operandsr0   s   ` r    Úvisit_Instructionz!ParameterSetter.visit_Instructionª   sE   ø€ ð × Ò Ñ"Ô"ð 	KÝ"Ð"JÐ"JÐ"JÐ"J¸D¼MÐ"JÑ"JÔ"JÑJÔJˆDŒNàˆr"   úchannels.Channelc                ó  — |                      ¦   «         ro|                      |j        ¦  «        }t          |t          ¦  «        s*t          |t
          ¦  «        r|dk     rt          d¦  «        ‚|                     |¬¦  «        S |S )z(Assign parameters to ``Channel`` object.r   z+Channel index must be a nonnegative integer)Úindex)ra   Ú_assign_parameter_expressionrg   Ú
isinstancer   Úintr   Ú	__class__)r   r   Ú	new_indexs      r    Úvisit_ChannelzParameterSetter.visit_Channel·   s†   € à× Ò Ñ"Ô"ð 		3Ø×9Ò9¸$¼*ÑEÔEˆIõ ˜iÕ)<Ñ=Ô=ð TÝ! )­SÑ1Ô1ð T°YÀ²]°]Ý$Ð%RÑSÔSÐSð —>’>¨	�>Ñ2Ô2Ð2àˆr"   r   c                ól  — |                      ¦   «         rŸt          |j        t          ¦  «        r|                      |j        ¦  «        |_        |j        D ]C}|j        |         }t          |t          ¦  «        r|                      |¦  «        }||j        |<   ŒD|j        s|                     ¦   «          |S )z.Assign parameters to ``SymbolicPulse`` object.)ra   ri   Údurationr   rh   Ú_paramsÚdisable_validationÚvalidate_parameters)r   r   ÚnameÚpvalÚnew_vals        r    Úvisit_SymbolicPulsez#ParameterSetter.visit_SymbolicPulseÆ   sµ   € à× Ò Ñ"Ô"ð 	+å˜$œ-Õ)<Ñ=Ô=ð QØ $× AÒ AÀ$Ä-Ñ PÔ P�”àœð 1ð 1�Ø”| DÔ)�Ý˜dÕ$7Ñ8Ô8ð 1Ø"×?Ò?ÀÑEÔE�GØ)0�D”L Ñ&øØÔ*ð +Ø×(Ò(Ñ*Ô*Ð*àˆr"   r   c                ó   — |S )zzAssign parameters to ``Waveform`` object.

        .. node:: No parameter can be assigned to ``Waveform`` object.
        r=   r0   s     r    Úvisit_WaveformzParameterSetter.visit_Waveform×   s	   € ð
 ˆr"   r   c                óZ   — t          |t          ¦  «        r|                      |¦  «        S |S )zGAssign parameters to object that doesn't belong to Qiskit Pulse module.)ri   r   rh   r0   s     r    r&   zParameterSetter.generic_visitÞ   s.   € å�dÕ/Ñ0Ô0ð 	Ø×4Ò4°TÑ:Ô:Ð:àˆKr"   Ú
param_exprr   c                óÐ   — t          |¦  «        }|j        | j                             ¦   «         z  }|D ]#}|                     || j        |         ¦  «        }Œ$t          |¦  «        }|S )zDA helper function to assign parameter value to parameter expression.)r   Ú
parametersrD   ÚkeysÚassignr   )r   rz   Ú	new_valueÚupdatedrX   s        r    rh   z,ParameterSetter._assign_parameter_expressionå   sl   € å˜Ñ$Ô$ˆ	ØÔ'¨$¬/×*>Ò*>Ñ*@Ô*@Ñ@ˆØð 	Hð 	HˆEØ!×(Ò(¨°´ÀÔ0FÑGÔGˆIˆIÝ*¨9Ñ5Ô5ˆ	ØÐr"   úSchedule | ScheduleBlockc                óz  — t          |d¦  «        st          d|j        j        › d�¦  «        ‚|j        }|j        | j                             ¦   «         z  }t          ¦   «         }|j        D ]H}||vr| 	                    |¦  «         Œ| j        |         }t          |t          ¦  «        r
||j        z  }ŒI||_        dS )z?A helper function to update parameter manager of pulse program.Ú_parameter_managerz
Node type z has no parameter manager.N)Úhasattrr   rk   r(   rƒ   r|   rD   r}   ÚsetÚaddri   r   Ú_parameters)r   r   Úparam_managerr€   r\   rX   r   s          r    rK   z)ParameterSetter._update_parameter_managerî   sÐ   € å�tÐ1Ñ2Ô2ð 	_ÝÐ]¨$¬.Ô*AÐ]Ð]Ð]Ñ^Ô^Ð^àÔ/ˆØÔ*¨T¬_×-AÒ-AÑ-CÔ-CÑCˆå™œˆØ"Ô-ð 	7ð 	7ˆEØ˜GÐ#Ð#Ø×"Ò" 5Ñ)Ô)Ð)ØØœ¨Ô.ˆIÝ˜)Õ%8Ñ9Ô9ð 7Ø )Ô"6Ñ6�øØ$2ˆÔ!Ð!Ð!r"   N)r@   rA   r8   r9   ©r   r   ©r   r]   ©r   re   ©r   r   ©r   r   r7   )rz   r   )r   r�   )r(   r:   r;   r<   rE   r1   r4   rG   rd   rm   rv   rx   r&   rh   rK   r=   r"   r    r?   r?      sú   € € € € € ðð ð$ð $ð $ð $ð

ð 
ð 
ð 
ðð ð ð ðð ð ð ð	ð 	ð 	ð 	ðð ð ð ðð ð ð ð"ð ð ð ðð ð ð ðð ð ð ð3ð 3ð 3ð 3ð 3ð 3r"   r?   c                  óX   — e Zd ZdZd„ Zdd„Zdd„Zdd	„Zdd„Zdd„Z	dd„Z
dd„Zdd„ZdS )ÚParameterGetterz¥Node visitor for parameter finding.

    This visitor initializes empty parameter array, and recursively visits nodes
    and add parameters found to the array.
    c                ó,   — t          ¦   «         | _        d S rC   )r…   r|   ©r   s    r    rE   zParameterGetter.__init__  s   € Ý™%œ%ˆŒˆˆr"   r   r   c                ó:   — | xj         |j        j         z  c_         dS )z¯Visit ``ScheduleBlock``. Recursively visit context blocks and search parameters.

        .. note:: ``ScheduleBlock`` can have parameters in blocks and its alignment.
        N)r|   rƒ   r0   s     r    r1   z#ParameterGetter.visit_ScheduleBlock  s   € ð 	ˆŒ˜4Ô2Ô=Ñ=ˆŒˆˆr"   r   c                ó0   — | xj         |j         z  c_         dS )zNVisit ``Schedule``. Recursively visit schedule children and search parameters.N©r|   r0   s     r    r4   zParameterGetter.visit_Schedule  ó   € àˆŒ˜4œ?Ñ*ˆŒˆˆr"   r   c                ón   — |j         D ],}t          |t          ¦  «        r| xj        |j        z  c_        Œ-dS )z<Get parameters from block's ``AlignmentKind`` specification.N)r[   ri   r   r|   )r   r   rX   s      r    rG   z#ParameterGetter.visit_AlignmentKind  sE   € àÔ)ð 	4ð 	4ˆEÝ˜%Õ!4Ñ5Ô5ð 4Ø�” 5Ô#3Ñ3�”øð	4ð 	4r"   r]   c                óD   — |j         D ]}|                      |¦  «         ŒdS )z¹Get parameters from general pulse instruction.

        .. note:: All parametrized object should be stored in the operands.
            Otherwise, parameter cannot be detected.
        N)rb   r!   )r   r   r`   s      r    rd   z!ParameterGetter.visit_Instruction"  s0   € ð ”-ð 	ð 	ˆBØ�JŠJ�r‰NŒNˆNˆNð	ð 	r"   re   c                ó0   — | xj         |j         z  c_         dS )z'Get parameters from ``Channel`` object.Nr”   r0   s     r    rm   zParameterGetter.visit_Channel-  r•   r"   r   c                ó’   — |j                              ¦   «         D ],}t          |t          ¦  «        r| xj         |j         z  c_         Œ-dS )z-Get parameters from ``SymbolicPulse`` object.N)r|   Úvaluesri   r   )r   r   Úop_values      r    rv   z#ParameterGetter.visit_SymbolicPulse1  sP   € àœ×.Ò.Ñ0Ô0ð 	7ð 	7ˆHÝ˜(Õ$7Ñ8Ô8ð 7Ø�” 8Ô#6Ñ6�”øð	7ð 	7r"   r   c                ó   — dS )zyGet parameters from ``Waveform`` object.

        .. node:: No parameter can be assigned to ``Waveform`` object.
        Nr=   r0   s     r    rx   zParameterGetter.visit_Waveform7  s	   € ð
 	ˆr"   r   c                ó^   — t          |t          ¦  «        r| xj        |j        z  c_        dS dS )zFGet parameters from object that doesn't belong to Qiskit Pulse module.N)ri   r   r|   r0   s     r    r&   zParameterGetter.generic_visit>  s5   € å�dÕ/Ñ0Ô0ð 	/ØˆOŒO˜tœÑ.ˆOŒOˆOˆOð	/ð 	/r"   Nr8   r9   r‰   rŠ   r‹   rŒ   r�   r7   )r(   r:   r;   r<   rE   r1   r4   rG   rd   rm   rv   rx   r&   r=   r"   r    r�   r�     sÍ   € € € € € ðð ð ð  ð  ð
>ð >ð >ð >ð+ð +ð +ð +ð4ð 4ð 4ð 4ðð ð ð ð+ð +ð +ð +ð7ð 7ð 7ð 7ðð ð ð ð/ð /ð /ð /ð /ð /r"   r�   c                  ó^   — e Zd ZdZd„ Zedd„¦   «         Zd„ Zdd„Zdd„Z	dd„Z
dd„Zdd„ZdS )ÚParameterManageraŠ  Helper class to manage parameter objects associated with arbitrary pulse programs.

    This object is implicitly initialized with the parameter object storage
    that stores parameter objects added to the parent pulse program.

    Parameter assignment logic is implemented based on the visitor pattern.
    Instruction data and its location are not directly associated with this object.
    c                ó,   — t          ¦   «         | _        dS )z.Create new parameter table for pulse programs.N)r…   r‡   r‘   s    r    rE   zParameterManager.__init__N  s   € å™5œ5ˆÔÐÐr"   Úreturnúset[Parameter]c                ó   — | j         S )z1Parameters which determine the schedule behavior.)r‡   r‘   s    r    r|   zParameterManager.parametersR  s   € ð ÔÐr"   c                ó8   — | j                              ¦   «          dS )z-Remove the parameters linked to this manager.N)r‡   Úclearr‘   s    r    r¥   zParameterManager.clearW  s   € àÔ×ÒÑ Ô Ð Ð Ð r"   Úboolc                ó*   — t          | j        ¦  «        S )z1Return True iff the instruction is parameterized.)r¦   r|   r‘   s    r    ra   z!ParameterManager.is_parameterized[  s   € å�D”OÑ$Ô$Ð$r"   Úparameter_nameÚstrúlist[Parameter]c                ó*   ‡— ˆfd„| j         D ¦   «         S )af  Get parameter object bound to this schedule by string name.

        Because different ``Parameter`` objects can have the same name,
        this method returns a list of ``Parameter`` s for the provided name.

        Args:
            parameter_name: Name of parameter.

        Returns:
            Parameter objects that have corresponding name.
        c                ó*   •— g | ]}|j         ‰k    ¯|‘ŒS r=   ©rs   )rP   rX   r¨   s     €r    rS   z3ParameterManager.get_parameters.<locals>.<listcomp>k  s%   ø€ ÐSÐSÐS˜%°e´jÀNÒ6RÐ6R�Ð6RÐ6RÐ6Rr"   r”   )r   r¨   s    `r    Úget_parameterszParameterManager.get_parameters_  s"   ø€ ð TÐSÐSÐS 4¤?ÐSÑSÔSÐSr"   Úpulse_programr   Ú
value_dictúddict[ParameterExpression | ParameterVector | str, ParameterValueType | Sequence[ParameterValueType]]c                óÐ   ‡— |                       |¦  «        Šˆfd„‰                     ¦   «         | j        z  D ¦   «         }|r%t          |¬¦  «        }|                     |¦  «        S |S )aq  Modify and return program data with parameters assigned according to the input.

        Args:
            pulse_program: Arbitrary pulse program associated with this manager instance.
            value_dict: A mapping from Parameters to either numeric values or another
                Parameter expression.

        Returns:
            Updated program data.
        c                ó"   •— i | ]}|‰|         “ŒS r=   r=   )rP   ÚkÚunrolled_value_dicts     €r    ú
<dictcomp>z6ParameterManager.assign_parameters.<locals>.<dictcomp>€  s.   ø€ ð 
ð 
ð 
Ø*+ˆAÐ" 1Ô%ð
ð 
ð 
r"   )r@   )Ú_unroll_param_dictr}   r‡   r?   r!   )r   r¯   r°   Ú	valid_mapr   rµ   s        @r    Úassign_parametersz"ParameterManager.assign_parametersm  s‡   ø€ ð$ #×5Ò5°jÑAÔAÐð
ð 
ð 
ð 
Ø/B×/GÒ/GÑ/IÔ/IÈDÔL\Ñ/\ð
ñ 
ô 
ˆ	ð ð 	0Ý%°	Ð:Ñ:Ô:ˆGØ—=’= Ñ/Ô/Ð/ØÐr"   Únew_nodec                óv   — t          ¦   «         }|                     |¦  «         | xj        |j        z  c_        dS )zŒA helper function to update parameter table with given data node.

        Args:
            new_node: A new data node to be added.
        N)r�   r!   r‡   r|   )r   rº   r   s      r    Úupdate_parameter_tablez'ParameterManager.update_parameter_tableˆ  s>   € õ "Ñ#Ô#ˆØ�Š�hÑÔÐØÐÔ˜GÔ.Ñ.ÐÔÐÐr"   Úparameter_bindsú]Mapping[Parameter | ParameterVector | str, ParameterValueType | Sequence[ParameterValueType]]ú&Mapping[Parameter, ParameterValueType]c                ó¼  — i }d„ | j         D ¦   «         }| j         D ]"}||j                                      |¦  «         Œ#d„ | j         D ¦   «         }|                     ¦   «         D ]4}||v r"||                              ||         ¦  «         Œ(||         g||<   Œ5|                     ¦   «         D ]¯\  }}t          |t          ¦  «        r4t          ||¦  «         |                     t          ||¦  «        ¦  «         ŒNt          |t          ¦  «        rG||         D ]=}t          ||¦  «        }	|	r$|                     t          ||¦  «        ¦  «         Œ8|||<   Œ>Œª|||<   Œ°|S )zù
        Unroll parameter dictionary to a map from parameter to value.

        Args:
            parameter_binds: A dictionary from parameter to value or a list of values.

        Returns:
            A dictionary from parameter to value.
        c                ó   — i | ]
}|j         g “ŒS r=   r­   ©rP   rX   s     r    r¶   z7ParameterManager._unroll_param_dict.<locals>.<dictcomp>¢  s   € ÐGÐGÐG¨e˜5œ: rÐGÐGÐGr"   c                ó\   — i | ])}t          |t          ¦  «        ¯|j        j        |j        “Œ*S r=   )ri   r	   Úvectorrs   rÂ   s     r    r¶   z7ParameterManager._unroll_param_dict.<locals>.<dictcomp>¥  sB   € ð 
ð 
ð 
àÝ˜%Õ!7Ñ8Ô8ð
ØŒLÔ˜uœ|ð
ð 
ð 
r"   )r|   rs   Úappendr}   Úitemsri   r   r   ÚupdateÚzipr©   r   )
r   r½   ÚoutÚparam_name_dictrX   Úparam_vec_dictrs   Ú	parameterÚvalueÚis_vecs
             r    r·   z#ParameterManager._unroll_param_dict’  sª  € ð ˆØGÐG°t´ÐGÑGÔGˆØ”_ð 	6ð 	6ˆEØ˜EœJÔ'×.Ò.¨uÑ5Ô5Ð5Ð5ð
ð 
àœð
ñ 
ô 
ˆð
 #×'Ò'Ñ)Ô)ð 	?ð 	?ˆDØ�Ð&Ð&Ø Ô%×,Ò,¨^¸DÔ-AÑBÔBÐBÐBà)7¸Ô)=Ð(>� Ñ%Ð%à /× 5Ò 5Ñ 7Ô 7ð 	'ð 	'ÑˆI�uÝ˜)¥_Ñ5Ô5ð 'Ý*¨9°eÑ<Ô<Ð<Ø—
’
�3˜y¨%Ñ0Ô0Ñ1Ô1Ð1Ð1Ý˜I¥sÑ+Ô+ð 'Ø,¨YÔ7ð +ð +�EÝ6°u¸eÑDÔD�FØð +ØŸ
š
¥3 u¨eÑ#4Ô#4Ñ5Ô5Ð5Ð5à%*˜˜E™
˜
ð+ð "'��I‘�Øˆ
r"   N)r¡   r¢   )r¡   r¦   )r¨   r©   r¡   rª   )r¯   r   r°   r±   r¡   r   )rº   r   )r½   r¾   r¡   r¿   )r(   r:   r;   r<   rE   Úpropertyr|   r¥   ra   r®   r¹   r¼   r·   r=   r"   r    rŸ   rŸ   D  sÄ   € € € € € ðð ð!ð !ð !ð ð ð  ð  ñ „Xð ð!ð !ð !ð%ð %ð %ð %ðTð Tð Tð Tðð ð ð ð6/ð /ð /ð /ð+ð +ð +ð +ð +ð +r"   rŸ   N)%r<   Ú
__future__r   r   Útypingr   r   r   Úqiskit.circuit.parametervectorr   r	   Úqiskit.circuit.parameterr
   Ú"qiskit.circuit.parameterexpressionr   r   Úqiskit.pulser   r   Úqiskit.pulse.exceptionsr   Úqiskit.pulse.libraryr   r   Úqiskit.pulse.scheduler   r   Ú"qiskit.pulse.transforms.alignmentsr   Úqiskit.pulse.utilsr   r   r   r   r?   r�   rŸ   r=   r"   r    ú<module>rÛ      sÿ  ðð%ð %ðL #Ð "Ð "Ð "Ð "Ð "Ø Ð Ð Ð Ð Ð Ø )Ð )Ð )Ð )Ð )Ð )Ð )Ð )Ð )Ð )à RÐ RÐ RÐ RÐ RÐ RÐ RÐ RØ .Ð .Ð .Ð .Ð .Ð .Ø VÐ VÐ VÐ VÐ VÐ VÐ VÐ VØ /Ð /Ð /Ð /Ð /Ð /Ð /Ð /Ø .Ð .Ð .Ð .Ð .Ð .Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ø <Ð <Ð <Ð <Ð <Ð <ðð ð ð ð ð ð ð ð ð ð4"ð 4"ð 4"ð 4"ð 4"ñ 4"ô 4"ð 4"ðn3ð 3ð 3ð 3ð 3�kñ 3ô 3ð 3ðD@/ð @/ð @/ð @/ð @/�kñ @/ô @/ð @/ðFyð yð yð yð yñ yô yð yð yð yr"   