§
    ¹³ÙgX  ã                  ó"  — d Z ddlmZ ddlmZmZmZmZ ddlZddl	m
Z
mZ ddlm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 d	dlmZmZmZmZ erddlmZ dZ G d„ de¦  «        Z  G d„ de¦  «        Z! G d„ d¦  «        Z" G d„ d¦  «        Z#dS )z8Circuit operation representing an ``if/else`` statement.é    )Úannotations)ÚOptionalÚUnionÚIterableÚTYPE_CHECKINGN)ÚClassicalRegisterÚClbit)Úexpr)ÚInstructionSet)ÚCircuitErroré   )ÚControlFlowBuilderBlockÚInstructionPlaceholderÚInstructionResources)ÚControlFlowOp)Úpartition_registersÚunify_circuit_resourcesÚvalidate_conditionÚcondition_resources©ÚQuantumCircuit)ÚIfElseOpc                  óº   ‡ — e Zd ZdZ	 	 ddˆ fd„Zed„ ¦   «         Zed„ ¦   «         Zej        d„ ¦   «         Zej        d„ ¦   «         Zed„ ¦   «         Z	dd„Z
d„ Zˆ xZS )r   aÇ  A circuit operation which executes a program (``true_body``) if a
    provided condition (``condition``) evaluates to true, and
    optionally evaluates another program (``false_body``) otherwise.

    If provided, ``false_body`` must be of the same ``num_qubits`` and
    ``num_clbits`` as ``true_body``.

    The classical bits used in ``condition`` must be a subset of those attached
    to the circuit on which this ``IfElseOp`` will be appended.
    NÚ	conditionú=tuple[ClassicalRegister, int] | tuple[Clbit, int] | expr.ExprÚ	true_bodyr   Ú
false_bodyúQuantumCircuit | NoneÚlabelú
str | Nonec                ó  •— ddl m} t          ||¦  «        s t          dt	          |¦  «        › d�¦  «        ‚|j        }|j        }t          ¦   «                              d||||g|¬¦  «         t          |¦  «        | _
        dS )aÅ  
        Args:
            condition: A condition to be evaluated in real time during circuit execution which,
                if true, will trigger the evaluation of ``true_body``. Can be
                specified as either a tuple of a ``ClassicalRegister`` to be
                tested for equality with a given ``int``, or as a tuple of a
                ``Clbit`` to be compared to either a ``bool`` or an ``int``.
            true_body: A program to be executed if ``condition`` evaluates
                to true.
            false_body: A optional program to be executed if ``condition``
                evaluates to false.
            label: An optional label for identifying the instruction.
        r   r   úLIfElseOp expects a true_body parameter of type QuantumCircuit, but received ú.Úif_else©r   N)Úqiskit.circuitr   Ú
isinstancer   ÚtypeÚ
num_qubitsÚ
num_clbitsÚsuperÚ__init__r   Ú
_condition)	Úselfr   r   r   r   r   r)   r*   Ú	__class__s	           €úX/granary/edev/quantum/lib/python3.11/site-packages/qiskit/circuit/controlflow/if_else.pyr,   zIfElseOp.__init__6   s¬   ø€ ð* 	2Ð1Ð1Ð1Ð1Ð1õ ˜) ^Ñ4Ô4ð 	ÝðKÝ8<¸Y¹¼ðKð Kð Kñô ð ð
 Ô)ˆ
ØÔ)ˆ
å‰Œ×Ò˜ J°
¸YÈ
Ð<SÐ[`ÐÑaÔaÐaå,¨YÑ7Ô7ˆŒˆˆó    c                ó   — | j         S ©N)Ú_params©r.   s    r0   ÚparamszIfElseOp.params\   s
   € àŒ|Ðr1   c                ó   — | j         S r3   ©r-   r5   s    r0   r   zIfElseOp.condition`   s
   € àŒÐr1   c                ó   — || _         d S r3   r8   )r.   Úvalues     r0   r   zIfElseOp.conditiond   s   € àˆŒˆˆr1   c                ó2  — ddl m} |\  }}t          ||¦  «        s t          dt	          |¦  «        › d�¦  «        ‚|j        | j        k    s|j        | j        k    r0t          d| j        › d| j        › d|j        › d|j        › d�	¦  «        ‚|�€t          ||¦  «        s t          dt	          |¦  «        › d�¦  «        ‚|j        | j        k    s|j        | j        k    r0t          d	| j        › d| j        › d|j        › d|j        › d�	¦  «        ‚||g| _        d S )
Nr   r   r"   r#   z‹Attempted to assign a true_body parameter with a num_qubits or num_clbits different than that of the IfElseOp. IfElseOp num_qubits/clbits: ú/z" Supplied body num_qubits/clbits: zMIfElseOp expects a false_body parameter of type QuantumCircuit, but received zŒAttempted to assign a false_body parameter with a num_qubits or num_clbits different than that of the IfElseOp. IfElseOp num_qubits/clbits: )r&   r   r'   r   r(   r)   r*   r4   )r.   Ú
parametersr   r   r   s        r0   r6   zIfElseOp.paramsh   sß  € ð 	2Ð1Ð1Ð1Ð1Ð1à *Ñˆ	�:å˜) ^Ñ4Ô4ð 	ÝðCÝ04°Y±´ðCð Cð Cñô ð ð
 Ô 4¤?Ò2Ð2°iÔ6JÈdÌoÒ6]Ð6]Ýðcà/3¬ðcð càAEÄðcð cð 5>Ô4Hðcð cð LUÔK_ðcð cð cñô ð ð Ð!Ý˜j¨.Ñ9Ô9ð Ý"ðHÝ48¸Ñ4DÔ4DðHð Hð Hñô ð ð
 Ô$¨¬Ò7Ð7¸:Ô;PÐTXÔTcÒ;cÐ;cÝ"ðià37´?ðið iàEIÄ_ðið ið 9CÔ8Mðið ið Q[ÔPeðið ið iñô ð ð " :Ð.ˆŒˆˆr1   c                ól   — | j         d         €| j         d         fS | j         d         | j         d         fS )Nr   r   )r6   r5   s    r0   ÚblockszIfElseOp.blocksŽ   s4   € àŒ;�qŒ>Ð!Ø”K ”NÐ$Ð$à”K ”N D¤K°¤NÐ3Ð3r1   r?   úIterable[QuantumCircuit]Úreturnú
'IfElseOp'c                óž   — d„ t          j        |t          d¦  «        d¬¦  «        D ¦   «         \  }}t          | j        ||| j        ¬¦  «        S )a  Replace blocks and return new instruction.

        Args:
            blocks: Iterable of circuits for "if" and "else" condition. If there is no "else"
                circuit it may be set to None or omitted.

        Returns:
            New IfElseOp with replaced blocks.
        c              3  ó    K  — | ]	\  }}|V — Œ
d S r3   © )Ú.0ÚablockÚ_s      r0   ú	<genexpr>z*IfElseOp.replace_blocks.<locals>.<genexpr>    s7   è è € ð !
ð !
Ù �v˜qˆFð!
ð !
ð !
ð !
ð !
ð !
r1   é   N)Ú	fillvalue)r   r   )Ú	itertoolsÚzip_longestÚranger   r-   r   )r.   r?   r   r   s       r0   Úreplace_blockszIfElseOp.replace_blocks•   s]   € ð!
ð !
Ý$-Ô$9¸&Å%ÈÁ(Ä(ÐVZÐ$[Ñ$[Ô$[ð!
ñ !
ô !
Ñˆ	�:õ ˜œ¨¸zÐQUÔQ[Ð\Ñ\Ô\Ð\r1   c                ó    — t          d¦  «        ‚)NzjIfElseOp cannot be classically controlled through Instruction.c_if. Please nest it in an IfElseOp instead.©ÚNotImplementedError©r.   Ú	classicalÚvals      r0   Úc_ifzIfElseOp.c_if¥   s   € Ý!ð5ñ
ô 
ð 	
r1   )NN)r   r   r   r   r   r   r   r    )r?   r@   rA   rB   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r,   Úpropertyr6   r   Úsetterr?   rO   rV   Ú__classcell__©r/   s   @r0   r   r   *   s
  ø€ € € € € ð	ð 	ð -1Ø ð$8ð $8ð $8ð $8ð $8ð $8ð $8ðL ðð ñ „Xðð ðð ñ „Xðð Ôð ð  ñ Ôð ð „]ð#/ð #/ñ „]ð#/ðJ ð4ð 4ñ „Xð4ð]ð ]ð ]ð ]ð 
ð 
ð 
ð 
ð 
ð 
ð 
r1   r   c                  óV   ‡ — e Zd ZdZ	 dddœdˆ fd„Zdd„Zd„ Zdd„Zd„ Zd„ Z	d„ Z
ˆ xZS )ÚIfElsePlaceholdera  A placeholder instruction to use in control-flow context managers, when calculating the
    number of resources this instruction should block is deferred until the construction of the
    outer loop.

    This generally should not be instantiated manually; only :obj:`.IfContext` and
    :obj:`.ElseContext` should do it when they need to defer creation of the concrete instruction.

    .. warning::

        This is an internal interface and no part of it should be relied upon outside of Qiskit
        Terra.
    Nr%   r   r   Ú
true_blockr   Úfalse_blockúControlFlowBuilderBlock | Noner   úOptional[str]c               ó&  •— || _         || _        |                      ¦   «         | _        t	          ¦   «                              dt          | j        j        ¦  «        t          | j        j        ¦  «        g |¬¦  «         t          |¦  «        | _
        dS )aæ  
        Args:
            condition: the condition to execute the true block on.  This has the same semantics as
                the ``condition`` argument to :obj:`.IfElseOp`.
            true_block: the unbuilt scope block that will become the "true" branch at creation time.
            false_block: if given, the unbuilt scope block that will become the "false" branch at
                creation time.
            label: the label to give the operator when it is created.
        r$   r%   N)Ú_IfElsePlaceholder__true_blockÚ_IfElsePlaceholder__false_blockÚ _calculate_placeholder_resourcesÚ_IfElsePlaceholder__resourcesr+   r,   ÚlenÚqubitsÚclbitsr   r-   )r.   r   ra   rb   r   r/   s        €r0   r,   zIfElsePlaceholder.__init__º   sˆ   ø€ ð$ 'ˆÔØ@KˆÔØ×@Ò@ÑBÔBˆÔÝ‰Œ×ÒØ•s˜4Ô+Ô2Ñ3Ô3µS¸Ô9IÔ9PÑ5QÔ5QÐSUÐ]bð 	ñ 	
ô 	
ð 	
õ -¨YÑ7Ô7ˆŒˆˆr1   rA   ú'IfElsePlaceholder'c                óÀ  — | j         �t          d| j         › �¦  «        ‚| j                             ¦   «         }|                     ¦   «         |                     ¦   «         z  }|                     ¦   «         |                     ¦   «         z  }|                     ||z
  ¦  «         |                     ||z
  ¦  «          t          | ¦  «        | j        ||| j	        ¬¦  «        S )a„  Return a new placeholder instruction, with the false block set to the given value,
        updating the bits used by both it and the true body, if necessary.

        It is an error to try and set the false block on a placeholder that already has one.

        Args:
            false_block: The (unbuilt) instruction scope to set the false body to.

        Returns:
            A new placeholder, with ``false_block`` set to the given input, and both true and false
            blocks expanded to account for all resources.

        Raises:
            CircuitError: if the false block of this placeholder instruction is already set.
        Nzfalse block is already set to r%   )
rg   r   rf   Úcopyrk   rl   Úadd_bitsr(   r-   r   )r.   rb   ra   Ú	true_bitsÚ
false_bitss        r0   Úwith_false_blockz"IfElsePlaceholder.with_false_blockÕ   sÔ   € ð  ÔÐ)ÝÐTÀÔ@RÐTÐTÑUÔUÐUØÔ&×+Ò+Ñ-Ô-ˆ
Ø×%Ò%Ñ'Ô'¨*×*;Ò*;Ñ*=Ô*=Ñ=ˆ	Ø ×'Ò'Ñ)Ô)¨K×,>Ò,>Ñ,@Ô,@Ñ@ˆ
Ø×Ò˜J¨Ñ2Ñ3Ô3Ð3Ø×Ò˜Y¨Ñ3Ñ4Ô4Ð4Ø�t�D‰zŒz˜$œ/¨:°{È$Ì*ÐUÑUÔUÐUr1   c                ó~   — | j         €| j        j                             ¦   «         S | j        j        | j         j        z  S )z.Get the registers used by the interior blocks.)rg   rf   Ú	registersro   r5   s    r0   ru   zIfElsePlaceholder.registersî   s:   € àÔÐ%ØÔ$Ô.×3Ò3Ñ5Ô5Ð5ØÔ Ô*¨TÔ-?Ô-IÑIÐIr1   r   c           	     ó4  — | j         €‘t          | j        j        ¦  «        \  }}t	          t          | j                             ¦   «         ¦  «        t          | j                             ¦   «         ¦  «        t          |¦  «        t          |¦  «        ¬¦  «        S t          | j        j        ¦  «        \  }}t          | j         j        ¦  «        \  }}t	          t          | j                             ¦   «         | j                              ¦   «         z  ¦  «        t          | j                             ¦   «         | j                              ¦   «         z  ¦  «        t          |¦  «        t          |¦  «        z   t          |¦  «        t          |¦  «        z   ¬¦  «        S )aC  Get the placeholder resources (see :meth:`.placeholder_resources`).

        This is a separate function because we use the resources during the initialization to
        determine how we should set our ``num_qubits`` and ``num_clbits``, so we implement the
        public version as a cache access for efficiency.
        N©rk   rl   ÚqregsÚcregs)rg   r   rf   ru   r   Útuplerk   rl   )r.   rx   ry   Ú
true_qregsÚ
true_cregsÚfalse_qregsÚfalse_cregss          r0   rh   z2IfElsePlaceholder._calculate_placeholder_resourcesô   sV  € ð ÔÐ%Ý.¨tÔ/@Ô/JÑKÔK‰LˆE�5Ý'Ý˜TÔ.×5Ò5Ñ7Ô7Ñ8Ô8Ý˜TÔ.×5Ò5Ñ7Ô7Ñ8Ô8Ý˜E‘l”lÝ˜E‘l”lð	ñ ô ð õ "5°TÔ5FÔ5PÑ!QÔ!QÑˆ
�JÝ#6°tÔ7IÔ7SÑ#TÔ#TÑ ˆ�[Ý#Ý˜Ô*×1Ò1Ñ3Ô3°dÔ6H×6OÒ6OÑ6QÔ6QÑQÑRÔRÝ˜Ô*×1Ò1Ñ3Ô3°dÔ6H×6OÒ6OÑ6QÔ6QÑQÑRÔRÝ˜
Ñ#Ô#¥e¨KÑ&8Ô&8Ñ8Ý˜
Ñ#Ô#¥e¨KÑ&8Ô&8Ñ8ð	
ñ 
ô 
ð 	
r1   c                ó   — | j         S r3   )ri   r5   s    r0   Úplaceholder_resourcesz'IfElsePlaceholder.placeholder_resources  s   € àÔÐr1   c           	     óæ  — | j                              ¦   «         }| j                              ¦   «         }| j        �8|| j                             ¦   «         z  }|| j                             ¦   «         z  }||z  }||z  }||z
  rt	          d||z
  ›�¦  «        ‚| j                              ||¦  «        }| j        €d }n-t          || j                             ||¦  «        f¦  «        \  }}|                      t          | j	        ||| j
        ¬¦  «        ¦  «        t          t          |j        ¦  «        t          |j        ¦  «        t          |j        ¦  «        t          |j        ¦  «        ¬¦  «        fS )Nz<This block contains bits that are not in the operands sets: r%   rw   )rf   rk   rl   rg   r   Úbuildr   Ú_copy_mutable_propertiesr   r-   r   r   rz   rx   ry   )	r.   rk   rl   Úcurrent_qubitsÚcurrent_clbitsÚall_bitsÚcurrent_bitsr   r   s	            r0   Úconcrete_instructionz&IfElsePlaceholder.concrete_instruction  sŒ  € ØÔ*×1Ò1Ñ3Ô3ˆØÔ*×1Ò1Ñ3Ô3ˆØÔÐ)Ø+¨dÔ.@×.GÒ.GÑ.IÔ.IÑIˆNØ+¨dÔ.@×.GÒ.GÑ.IÔ.IÑIˆNØ˜F‘?ˆØ%¨Ñ6ˆØ˜(Ñ"ð 	õ ð0Ø  8Ñ+ð0ð 0ñô ð ð Ô%×+Ò+¨F°FÑ;Ô;ˆ	ØÔÐ%ØˆJˆJõ
 %<Ø˜DÔ.×4Ò4°V¸VÑDÔDÐEñ%ô %Ñ!ˆI�zð ×)Ò)Ý˜œ¨)°ZÀtÄzÐRÑRÔRñô õ !Ý˜YÔ-Ñ.Ô.Ý˜YÔ-Ñ.Ô.Ý˜IœOÑ,Ô,Ý˜IœOÑ,Ô,ð	ñ ô ð	

ð 
	
r1   c                ó    — t          d¦  «        ‚)NzoIfElseOp cannot be classically controlled through Instruction.c_if. Please nest it in another IfElseOp instead.rQ   rS   s      r0   rV   zIfElsePlaceholder.c_if5  s   € Ý!ð:ñ
ô 
ð 	
r1   r3   )r   r   ra   r   rb   rc   r   rd   )rb   r   rA   rm   )rA   r   )rW   rX   rY   rZ   r,   rs   ru   rh   r€   rˆ   rV   r]   r^   s   @r0   r`   r`   ¬   sÌ   ø€ € € € € ðð ð" 7;ð	8ð  $ð8ð 8ð 8ð 8ð 8ð 8ð 8ð 8ð6Vð Vð Vð Vð2Jð Jð Jð
ð 
ð 
ð 
ð0 ð  ð  ð#
ð #
ð #
ðJ
ð 
ð 
ð 
ð 
ð 
ð 
r1   r`   c                  ó�   — e Zd ZdZdZddœdd„Zedd„¦   «         Zedd„¦   «         Zedd„¦   «         Z	edd„¦   «         Z
d„ Zd„ ZdS )Ú	IfContexta  A context manager for building up ``if`` statements onto circuits in a natural order, without
    having to construct the statement body first.

    The return value of this context manager can be used immediately following the block to create
    an attached ``else`` statement.

    This context should almost invariably be created by a :meth:`.QuantumCircuit.if_test` call, and
    the resulting instance is a "friend" of the calling circuit.  The context will manipulate the
    circuit's defined scopes when it is entered (by pushing a new scope onto the stack) and exited
    (by popping its scope, building it, and appending the resulting :obj:`.IfElseOp`).

    .. warning::

        This is an internal interface and no part of it should be relied upon outside of Qiskit
        Terra.
    )Ú_appended_instructionsÚ_circuitr-   Ú_in_loopÚ_labelNr%   Úcircuitr   r   r   Úin_loopÚboolr   r    c               óf   — || _         t          |¦  «        | _        || _        d | _        || _        d S r3   )r�   r   r-   r�   rŒ   rŽ   )r.   r�   r   r‘   r   s        r0   r,   zIfContext.__init__P  s4   € ð  ˆŒÝ,¨YÑ7Ô7ˆŒØˆŒØ&*ˆÔ#ØˆŒˆˆr1   rA   c                ó   — | j         S )z9Get the circuit that this context manager is attached to.)r�   r5   s    r0   r�   zIfContext.circuitb  ó   € ð Œ}Ðr1   c                ó   — | j         S )z9Get the expression that this statement is conditioned on.r8   r5   s    r0   r   zIfContext.conditiong  s   € ð ŒÐr1   úUnion[InstructionSet, None]c                ó   — | j         S )zŠGet the instruction set that was created when this block finished.  If the block has not
        yet finished, then this will be ``None``.)rŒ   r5   s    r0   Úappended_instructionszIfContext.appended_instructionsl  s   € ð Ô*Ð*r1   c                ó   — | j         S )z7Whether this context manager is enclosed within a loop.)rŽ   r5   s    r0   r‘   zIfContext.in_loopr  r•   r1   c                ó    — t          | j        ¦  «        }| j                             |j        |j        | j        ¬¦  «         t          | ¦  «        S )N)rl   ru   Úallow_jumps)r   r-   r�   Ú_push_scoperl   ry   rŽ   ÚElseContext)r.   Ú	resourcess     r0   Ú	__enter__zIfContext.__enter__w  sP   € Ý'¨¬Ñ8Ô8ˆ	ØŒ×!Ò!ØÔ#Ø”oØœð 	"ñ 	
ô 	
ð 	
õ
 ˜4Ñ Ô Ð r1   c                ól  — |�| j                              ¦   «          dS | j                              ¦   «         }| j        r\t          | j        || j        ¬¦  «        }|                     ¦   «         }| j                              ||j        |j	        ¦  «        | _
        nš|                     |                     ¦   «         | 	                    ¦   «         ¦  «        }| j                              t          | j        |d | j        ¬¦  «        t          |j        ¦  «        t          |j	        ¦  «        ¦  «        | _
        dS )NFr%   )r   r   r   )r�   Ú
_pop_scoperŽ   r`   r-   r�   r€   Úappendrk   rl   rŒ   r‚   r   rz   )r.   Úexc_typeÚexc_valÚexc_tbra   Ú	operationrŸ   r   s           r0   Ú__exit__zIfContext.__exit__€  s  € ØÐð ŒM×$Ò$Ñ&Ô&Ð&Ø�5Ø”]×-Ò-Ñ/Ô/ˆ
ØŒ=ð 	õ
 *¨$¬/¸:ÈTÌ[ÐYÑYÔYˆIØ!×7Ò7Ñ9Ô9ˆIØ*.¬-×*>Ò*>Ø˜9Ô+¨YÔ-=ñ+ô +ˆDÔ'Ð'ð #×(Ò(¨×):Ò):Ñ)<Ô)<¸j×>OÒ>OÑ>QÔ>QÑRÔRˆIØ*.¬-×*>Ò*>Ý˜œ°IÈ$ÐVZÔVaÐbÑbÔbÝ�iÔ&Ñ'Ô'Ý�iÔ&Ñ'Ô'ñ+ô +ˆDÔ'ð
 ˆur1   )r�   r   r   r   r‘   r’   r   r    )rA   r   )rA   r   )rA   r—   )rA   r’   )rW   rX   rY   rZ   Ú	__slots__r,   r[   r�   r   r™   r‘   r    r¨   rE   r1   r0   r‹   r‹   <  sç   € € € € € ðð ð" [€Ið !ð ð  ð  ð  ð  ð  ð$ ðð ð ñ „Xðð ðð ð ñ „Xðð ð+ð +ð +ñ „Xð+ð
 ðð ð ñ „Xðð!ð !ð !ðð ð ð ð r1   r‹   c                  ó*   — e Zd ZdZdZd	d„Zd„ Zd„ ZdS )
rž   aC  A context manager for building up an ``else`` statements onto circuits in a natural order,
    without having to construct the statement body first.

    Instances of this context manager should only ever be gained as the output of the
    :obj:`.IfContext` manager, so they know what they refer to.  Instances of this context are
    "friends" of the circuit that created the :obj:`.IfContext` that in turn created this object.
    The context will manipulate the circuit's defined scopes when it is entered (by popping the old
    :obj:`.IfElseOp` if it exists and pushing a new scope onto the stack) and exited (by popping its
    scope, building it, and appending the resulting :obj:`.IfElseOp`).

    .. warning::

        This is an internal interface and no part of it should be relied upon outside of Qiskit
        Terra.
    ©Ú_if_instructionÚ_if_registersÚ_if_contextÚ_usedÚ
if_contextr‹   c                ó>   — d | _         d | _        || _        d| _        d S )NFr«   )r.   r°   s     r0   r,   zElseContext.__init__°  s'   € ð  $ˆÔØ!ˆÔØ%ˆÔØˆŒ
ˆ
ˆ
r1   c                ó<  — | j         rt          d¦  «        ‚d| _         | j        j        }| j        j        }|€t          d¦  «        ‚t          |¦  «        dk    rt          d¦  «        ‚|d         }|                     ¦   «         }|j        |j        urt          d|›d|›d	�¦  «        ‚|                     ¦   «         | _	        t          | j	        j        t          ¦  «        r\t          | j	        j        j        d         j        ¦  «                             | j	        j        j        d         j        ¦  «        | _        n#| j	        j                             ¦   «         | _        |                     | j	        j        | j	        j        | j        | j        j        ¬
¦  «         d S )Nz Cannot re-use an 'else' context.Tz;Cannot attach an 'else' branch to an incomplete 'if' block.r   z4Cannot attach an 'else' to a broadcasted 'if' block.r   zTThe 'if' block is not the most recent instruction in the circuit. Expected to find: z, but instead found: r#   )ru   rœ   )r¯   r   r®   r™   r�   rj   Ú#_peek_previous_instruction_in_scoper§   Ú"_pop_previous_instruction_in_scoper¬   r'   r   Úsetr?   ry   Úunionrx   r­   ru   r�   rk   rl   r‘   )r.   r™   r�   ÚappendedÚinstructions        r0   r    zElseContext.__enter__¹  sµ  € ØŒ:ð 	CÝÐAÑBÔBÐBØˆŒ
Ø $Ô 0Ô FÐØÔ"Ô*ˆØ Ð(ÝÐ\Ñ]Ô]Ð]ÝÐ$Ñ%Ô%¨Ò*Ð*åÐUÑVÔVÐVØ(¨Ô+ˆØ×AÒAÑCÔCˆØÔ [Ô%:Ð:Ð:ÝðXØ&.ðXð XØGRðXð Xð Xñô ð ð  '×IÒIÑKÔKˆÔÝ�dÔ*Ô4µhÑ?Ô?ð 	LÝ!$ TÔ%9Ô%CÔ%JÈ1Ô%MÔ%SÑ!TÔ!T×!ZÒ!ZØÔ$Ô.Ô5°aÔ8Ô>ñ"ô "ˆDÔÐð "&Ô!5Ô!?×!IÒ!IÑ!KÔ!KˆDÔØ×ÒØÔ Ô'ØÔ Ô'ØÔ(ØÔ(Ô0ð	 	ñ 	
ô 	
ð 	
ð 	
ð 	
r1   c                ó4  — | j         j        }|�7|                     ¦   «          |                     | j        ¦  «         d| _        dS |                     ¦   «         }t          | j        j        t          ¦  «        rU| j        j         	                    |¦  «        }| 
                    ¦   «         }|                     ||j        |j        ¦  «         nÊ| j        j        j        d         }|                     |                     ¦   «         |                     ¦   «         ¦  «        }	t!          ||	f¦  «        \  }}	|                     t#          | j         j        ||	| j        j        j        ¬¦  «        t)          |j        ¦  «        t)          |j        ¦  «        ¦  «         dS )NFr   r%   )r®   r�   r¢   Ú_appendr¬   r¯   r'   r§   r`   rs   r€   r£   rk   rl   r?   r‚   r   r   r   r   rz   )
r.   r¤   r¥   r¦   r�   rb   Úif_operationrŸ   r   r   s
             r0   r¨   zElseContext.__exit__Ù  s~  € ØÔ"Ô*ˆØÐð
 ×ÒÑ Ô Ð Ø�OŠO˜DÔ0Ñ1Ô1Ð1ØˆDŒJØ�5à×(Ò(Ñ*Ô*ˆõ �dÔ*Ô4Õ6GÑHÔHð 	ØÔ/Ô9×JÒJÈ;ÑWÔWˆLØ$×:Ò:Ñ<Ô<ˆIØ�NŠN˜<¨Ô)9¸9Ô;KÑLÔLÐLÐLð Ô,Ô6Ô=¸aÔ@ˆIØ$×*Ò*¨;×+=Ò+=Ñ+?Ô+?À×ASÒASÑAUÔAUÑVÔVˆJÝ$;¸YÈ
Ð<SÑ$TÔ$TÑ!ˆI�zØ�NŠNÝØÔ$Ô.ØØØÔ.Ô8Ô>ð	ñ ô õ �iÔ&Ñ'Ô'Ý�iÔ&Ñ'Ô'ñ	ô 	ð 	ð ˆur1   N)r°   r‹   )rW   rX   rY   rZ   r©   r,   r    r¨   rE   r1   r0   rž   rž   �  sY   € € € € € ðð ð  M€Iðð ð ð ð
ð 
ð 
ð@&ð &ð &ð &ð &r1   rž   )$rZ   Ú
__future__r   Útypingr   r   r   r   rL   Ú qiskit.circuit.classicalregisterr   r	   Úqiskit.circuit.classicalr
   Úqiskit.circuit.instructionsetr   Úqiskit.circuit.exceptionsr   Úbuilderr   r   r   Úcontrol_flowr   Ú_builder_utilsr   r   r   r   r&   r   Ú__all__r   r`   r‹   rž   rE   r1   r0   ú<module>rÆ      s   ðð ?Ð >à "Ð "Ð "Ð "Ð "Ð "à ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ð ;Ø Ð Ð Ð à EÐ EÐ EÐ EÐ EÐ EÐ EÐ EØ )Ð )Ð )Ð )Ð )Ð )Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2à ZÐ ZÐ ZÐ ZÐ ZÐ ZÐ ZÐ ZÐ ZÐ ZØ 'Ð 'Ð 'Ð 'Ð 'Ð 'ðð ð ð ð ð ð ð ð ð ð ð ð ð .Ø-Ð-Ð-Ð-Ð-Ð-ð €ð
ð 
ð 
ð 
ð 
ˆ}ñ 
ô 
ð 
ðDM
ð M
ð M
ð M
ð M
Ð.ñ M
ô M
ð M
ð`^ð ^ð ^ð ^ð ^ñ ^ô ^ð ^ðBbð bð bð bð bñ bô bð bð bð br1   