§
    º³Ùg9q  ã            	       ón  — d Z ddlZddl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 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 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 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 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" 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' 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/ dd&l0m1Z1 dd'l2m3Z3 dd(l4m5Z5  ej6        d)d*¦  «        Z7 e7h d+£ e8¦   «         ¬*¦  «         e7h d,£d-d.h¬*¦  «         e7d/d0h e8¦   «         ¬*¦  «         e7 e8¦   «          e8¦   «         ¬*¦  «         e7 e8¦   «         d1d2h¬*¦  «        d3œZ9d4„ Z:d5„ Z; G d6„ d7¦  «        Z<	 	 	 	 	 	 	 dWd9„Z=d:„ Z>d;„ Z?	 	 	 	 	 	 dXd>„Z@d?„ ZAd@„ ZBdA„ ZC e5dBdCdDdEdF¬G¦  «        	 	 	 	 	 	 	 dYdI„¦   «         ZDdZdJ„ZE e5dBdCdDdEdF¬G¦  «        	 	 	 	 	 	 	 	 	 d[dK„¦   «         ZF e3dLdM„ ¬N¦  «        	 d\dO„¦   «         ZG ej6        dPdQ¦  «        ZH	 	 d]dReIdSeeJ         dTee1         dUeHfdV„ZKdS )^z%Common preset passmanager generators.é    N)ÚOptional)ÚSessionEquivalenceLibrary)ÚCONTROL_FLOW_OP_NAMES)ÚConditionalController)ÚPassManager)ÚError)ÚBasisTranslator)ÚUnroll3qOrMore)ÚConsolidateBlocks)ÚCollect1qRuns)ÚCollect2qBlocks)ÚUnitarySynthesis)ÚHighLevelSynthesis)ÚCheckMap)ÚGateDirection)ÚBarrierBeforeFinalMeasurements)ÚCheckGateDirection)ÚTimeUnitConversion)ÚALAPScheduleAnalysis)ÚASAPScheduleAnalysis)ÚFullAncillaAllocation)ÚEnlargeWithAncilla)ÚApplyLayout)ÚRemoveResetInZeroState)ÚFilterOpNodes)ÚValidatePulseGates)ÚPadDelay)ÚInstructionDurationCheck)ÚConstrainedReschedule)Ú
PulseGates)ÚContainsInstruction)ÚVF2PostLayout)ÚVF2LayoutStopReason)ÚVF2PostLayoutStopReason)ÚTranspilerError)ÚLayout)Údeprecate_pulse_arg)Údeprecate_argÚ_ControlFlowState)ÚworkingÚnot_working>   ÚdenseÚsabreÚtrivial>   Únoner-   Ú
stochasticÚ	lookaheadÚbasicÚ
translatorÚ	synthesisÚalapÚasap)Úlayout_methodÚrouting_methodÚtranslation_methodÚoptimization_methodÚscheduling_methodc                 óD   ‡ — t          ˆ fd„t          D ¦   «         ¦  «        S )Nc              3   ó.   •K  — | ]}‰d |› �         V — ŒdS ©Ú	contains_N© ©Ú.0ÚxÚproperty_sets     €úb/granary/edev/quantum/lib/python3.11/site-packages/qiskit/transpiler/preset_passmanagers/common.pyú	<genexpr>z$_has_control_flow.<locals>.<genexpr>N   s.   øè è € ÐLÐL°ˆ|˜O¨˜O˜OÔ,ÐLÐLÐLÐLÐLÐLó    ©Úanyr   ©rD   s   `rE   Ú_has_control_flowrK   M   s'   ø€ ÝÐLÐLÐLÐLÕ6KÐLÑLÔLÑLÔLÐLrG   c                 óF   ‡ — t          ˆ fd„t          D ¦   «         ¦  «         S )Nc              3   ó.   •K  — | ]}‰d |› �         V — ŒdS r>   r@   rA   s     €rE   rF   z(_without_control_flow.<locals>.<genexpr>R   s.   øè è € ÐPÐP°Q�< ¨A  Ô0ÐPÐPÐPÐPÐPÐPrG   rH   rJ   s   `rE   Ú_without_control_flowrN   Q   s*   ø€ ÝÐPÐPÐPÐPÕ:OÐPÑPÔPÑPÔPÐPÐPrG   c                   ó"   — e Zd Zdd„Zd„ Zd„ ZdS )Ú_InvalidControlFlowForBackendr@   Nc                 ó¦   ‡‡— ‰�ˆfd„t           D ¦   «         | _        d S ‰�)t          ‰¦  «        Šˆfd„t           D ¦   «         | _        d S g | _        d S )Nc                 ó   •— g | ]}|‰v¯|‘Œ	S r@   r@   )rB   ÚopÚtargets     €rE   ú
<listcomp>z:_InvalidControlFlowForBackend.__init__.<locals>.<listcomp>Z   s$   ø€ ÐWÐWÐW rÀbÐPVÐFVÐFV ÐFVÐFVÐFVrG   c                 ó   •— g | ]}|‰v¯|‘Œ	S r@   r@   )rB   rS   Úbasis_gatess     €rE   rU   z:_InvalidControlFlowForBackend.__init__.<locals>.<listcomp>]   s$   ø€ Ð\Ð\Ð\ rÀbÐP[ÐF[ÐF[ ÐF[ÐF[ÐF[rG   )r   ÚunsupportedÚset)ÚselfrW   rT   s    ``rE   Ú__init__z&_InvalidControlFlowForBackend.__init__X   ss   øø€ ØÐØWÐWÐWÐWÕ-BÐWÑWÔWˆDÔÐÐØÐ$Ý˜kÑ*Ô*ˆKØ\Ð\Ð\Ð\Õ-BÐ\Ñ\Ô\ˆDÔÐÐð  "ˆDÔÐÐrG   c                 ó®   ‡— ˆfd„| j         D ¦   «         }t          |¦  «        dk    rd|d         › d�S dd                     d„ |D ¦   «         ¦  «        › d	�S )
z3Create an error message for the given property set.c                 ó*   •— g | ]}‰d |› �         ¯|‘ŒS )r?   r@   rA   s     €rE   rU   z9_InvalidControlFlowForBackend.message.<locals>.<listcomp>d   s)   ø€ ÐNÐNÐN�q°¸_È¸_¸_Ô0MÐN�ÐNÐNÐNrG   é   zThe control-flow construct 'r   z"' is not supported by the backend.zThe control-flow constructs [z, c              3   ó4   K  — | ]}t          |¦  «        V — Œd S ©N)Úrepr)rB   rS   s     rE   rF   z8_InvalidControlFlowForBackend.message.<locals>.<genexpr>h   s(   è è € Ð5OÐ5OÀ2µd¸2±h´hÐ5OÐ5OÐ5OÐ5OÐ5OÐ5OrG   z#] are not supported by the backend.)rX   ÚlenÚjoin)rZ   rD   Úfailss    ` rE   Úmessagez%_InvalidControlFlowForBackend.messageb   sy   ø€ àNÐNÐNÐN˜DÔ,ÐNÑNÔNˆÝˆu‰:Œ:˜Š?ˆ?Ø^°%¸´(Ð^Ð^Ð^Ð^ð1¨D¯IªIÐ5OÐ5OÈÐ5OÑ5OÔ5OÑ,OÔ,Oð 1ð 1ð 1ð	
rG   c                 óD   ‡— t          ˆfd„| j        D ¦   «         ¦  «        S )z/Checkable condition for the given property set.c              3   ó.   •K  — | ]}‰d |› �         V — ŒdS r>   r@   rA   s     €rE   rF   z:_InvalidControlFlowForBackend.condition.<locals>.<genexpr>n   s.   øè è € ÐKÐK°Q�< ¨A  Ô0ÐKÐKÐKÐKÐKÐKrG   )rI   rX   )rZ   rD   s    `rE   Ú	conditionz'_InvalidControlFlowForBackend.conditionl   s)   ø€ åÐKÐKÐKÐK¸$Ô:JÐKÑKÔKÑKÔKÐKrG   )r@   N)Ú__name__Ú
__module__Ú__qualname__r[   re   rh   r@   rG   rE   rP   rP   U   sK   € € € € € ð"ð "ð "ð "ð
ð 
ð 
ðLð Lð Lð Lð LrG   rP   r@   c           
      ó„  — g }d}d| fd|fd|fd|fd|ffD ]o\  }	}
|	dz   }t           |         }|
�V|
|j        v rM|j        r"|d	|› d
|
› dt          |j        ¦  «        › d�z  }n|d	|› d
|
› d|	› d�z  }|                     |¦  «         Œpt          ¦   «         }|                     t          t          d¬¦  «        ¦  «         |r6|                     t          t          |¦  «        t          ¬¦  «        ¦  «         t          ||¦  «        }|                     t          t          |j        ¦  «        |j        ¬¦  «        ¦  «         |S )a¿  Generate a pass manager that, when run on a DAG that contains control flow, fails with an
    error message explaining the invalid options, and what could be used instead.

    Returns:
        PassManager: a pass manager that populates the ``contains_x`` properties for each of the
        control-flow operations, and raises an error if any of the given options do not support
        control flow, but a circuit with control flow is given.
    z.Some options cannot be used with control flow.ÚlayoutÚroutingÚtranslationÚoptimizationÚ
schedulingÚ_methodNz Got z='z', but valid values are ú.z', but the entire z stage is not supported.F©Úrecurse©rh   )Ú_CONTROL_FLOW_STATESr+   r*   ÚlistÚappendr   r!   r   r   r   rK   rP   re   rh   )r7   r8   r9   r:   r;   rW   rT   Úbad_optionsre   ÚstageÚgivenÚoptionÚmethod_statesÚoutÚbackend_controls                  rE   Ú#generate_control_flow_options_checkr�   q   sœ  € ð" €KØ>€Gà	�=Ð!Ø	�NÐ#Ø	Ð*Ð+Ø	Ð,Ð-Ø	Ð(Ð)ðð 'ð '‰ˆˆuð ˜Ñ"ˆÝ,¨VÔ4ˆØÐ ¨-Ô*CÐ!CÐ!CØÔ$ð ØØc˜FÐcÐc eÐcÐcÅTÈ-ÔJ_ÑE`ÔE`ÐcÐcÐcñ��ð Ø^˜FÐ^Ð^ eÐ^Ð^¸uÐ^Ð^Ð^ñ�ð ×Ò˜vÑ&Ô&Ð&øÝ
‰-Œ-€CØ‡J‚JÕ"Õ#8À%ÐHÑHÔHÑIÔIÐIØð WØ�
Š
Õ(­¨w©¬ÕCTÐUÑUÔUÑVÔVÐVÝ3°KÀÑHÔH€OØ‡J‚JÝ�e OÔ$;Ñ<Ô<ÈÔHaÐbÑbÔbñô ð ð €JrG   c                 óà   — t          ¦   «         }|                     t          t          d¬¦  «        ¦  «         |                     t	          t          | ¦  «        t          ¬¦  «        ¦  «         |S )zaGet a pass manager that always raises an error if control flow is present in a given
    circuit.Frt   rv   )r   ry   r!   r   r   r   rK   )re   r   s     rE   Úgenerate_error_on_control_flowrƒ   ¢   sZ   € õ ‰-Œ-€CØ‡J‚JÕ"Õ#8À%ÐHÑHÔHÑIÔIÐIØ‡J‚JÕ$¥U¨7¡^¤^Õ?PÐQÑQÔQÑRÔRÐRØ€JrG   c                 ó¼  — t          | t          ¦  «        r|                      ¦   «         } t          |t          ¦  «        r|                     ¦   «         }t          ¦   «         }|                     t	          t
          d¬¦  «        ¦  «         |                     t          | t          ¬¦  «        ¦  «         |                     t          |t          ¬¦  «        ¦  «         |S )z¨Generate a pass manager that will run the passes in ``if_present`` if the given circuit
    has control-flow operations in it, and those in ``if_absent`` if it doesn't.Frt   rv   )	Ú
isinstancer   Úto_flow_controllerry   r!   r   r   rK   rN   )Ú
if_presentÚ	if_absentr   s      rE   Úif_has_control_flow_elser‰   «   s»   € õ �*�kÑ*Ô*ð 5Ø×2Ò2Ñ4Ô4ˆ
Ý�)�[Ñ)Ô)ð 3Ø×0Ò0Ñ2Ô2ˆ	Ý
‰-Œ-€CØ‡J‚JÕ"Õ#8À%ÐHÑHÔHÑIÔIÐIØ‡J‚JÕ$ ZÕ;LÐMÑMÔMÑNÔNÐNØ‡J‚JÕ$ YÕ:OÐPÑPÔPÑQÔQÐQØ€JrG   ÚdefaultTc                 óv  — t          ¦   «         }|                     t          |||d|| ¬¦  «        ¦  «         |                     t          |d| dt          |d|¬¦  «        ¦  «         |€&| €$|                     t          | |¦  «        ¦  «         n+|                     t          t          || d¬¦  «        ¦  «         |S )a•  Generate an unroll >3q :class:`~qiskit.transpiler.PassManager`

    Args:
        target (Target): the :class:`~.Target` object representing the backend
        basis_gates (list): A list of str gate names that represent the basis
            gates on the backend target
        approximation_degree (Optional[float]): The heuristic approximation degree to
            use. Can be between 0 and 1.
        unitary_synthesis_method (str): The unitary synthesis method to use. You can see
            a list of installed plugins with :func:`.unitary_synthesis_plugin_names`.
        unitary_synthesis_plugin_config (dict): The optional dictionary plugin
            configuration, this is plugin specific refer to the specified plugin's
            documentation for how to use.
        hls_config (HLSConfig): An optional configuration class to use for
            :class:`~qiskit.transpiler.passes.HighLevelSynthesis` pass.
            Specifies how to synthesize various high-level objects.
        qubits_initially_zero (bool): Indicates whether the input circuit is
            zero-initialized.

    Returns:
        PassManager: The unroll 3q or more pass manager
    é   )Úapproximation_degreeÚmethodÚ
min_qubitsÚplugin_configrT   NF)Ú
hls_configÚcoupling_maprT   Úuse_qubit_indicesÚequivalence_libraryrW   r�   Úqubits_initially_zero)rT   r�   )r   ry   r   r   Úselr
   r	   )rT   rW   r�   Úunitary_synthesis_methodÚunitary_synthesis_plugin_configr‘   r•   Ú	unroll_3qs           rE   Úgenerate_unroll_3qrš   ¹   sæ   € õ> ‘”€IØ×ÒÝØØ!5Ø+ØØ9Øð	
ñ 	
ô 	
ñ	ô 	ð 	ð ×ÒÝØ!ØØØ#Ý #Ø#ØØ"7ð		
ñ 		
ô 		
ñô ð ð Ð˜v˜~Ø×Ò�¨°Ñ<Ô<Ñ=Ô=Ð=Ð=à×Ò�­¨kÀ&ÐUVÐWÑWÔWÑXÔXÐXØÐrG   c                 óp   — t          t          | ¦  «        t          ¦   «         t          ¦   «         g¦  «        S )aî  Generate a layout embedding :class:`~qiskit.transpiler.PassManager`

    This is used to generate a :class:`~qiskit.transpiler.PassManager` object
    that can be used to expand and apply an initial layout to a circuit

    Args:
        coupling_map (Union[CouplingMap, Target): The coupling map for the backend to embed
            the circuit to.
    Returns:
        PassManager: The embedding passmanager that assumes the layout property
            set has been set in earlier stages
    )r   r   r   r   )r’   s    rE   Úgenerate_embed_passmanagerrœ   ø   s0   € õ Õ-¨lÑ;Ô;Õ=OÑ=QÔ=QÕS^ÑS`ÔS`ÐaÑbÔbÐbrG   c                 ó(   — | d         duo| d          S )z¢Return ``True`` if the first attempt at layout has been checked and found to be imperfect.
    In this case, perfection means "does not require any swap routing".Úis_swap_mappedNr@   rJ   s    rE   Ú_layout_not_perfectrŸ     s#   € ð Ð(Ô)°Ð5Ð\¸lÐK[Ô>\Ð:\Ð\rG   c                 ó>   — | d         d uo| d         t           j        u S )NÚVF2PostLayout_stop_reason)r$   ÚSOLUTION_FOUNDrJ   s    rE   Ú_apply_post_layout_conditionr£     s/   € ð 	Ð0Ô1¸Ð=ð 	`ØÐ4Ô5Õ9PÔ9_Ð_ðrG   Úbackend_propertiesz1.4ÚQiskitzin Qiskit 2.0a(  The BackendProperties data structure has been deprecated and will be removed in Qiskit 2.0. The required `target` input argument should be used instead. You can use Target.from_configuration() to build the target from the properties object, but in 2.0 you will need to generate a target directly.)ÚnameÚsinceÚpackage_nameÚremoval_timelineÚadditional_msgFc	                 ó„  ‡— ˆfd„}	t          ¦   «         }
|�%|
                     t          |d¬¦  «        ¦  «         n$|
                     t          |d¬¦  «        ¦  «         d„ }|r5|
                     t          t	          d¬¦  «        | g|¬¦  «        ¦  «         n$|
                     t          | |¬¦  «        ¦  «         |o|}|€|�Ô|rÒt          j        ¦   «         5  t          j        d	t          d
d¬¦  «         t          j        d	t          dd¬¦  «         |
                     t          t          ||||||d¬¦  «        |	¬¦  «        ¦  «         ddd¦  «         n# 1 swxY w Y   |
                     t          t          ¦   «         t          ¬¦  «        ¦  «         d„ }|
                     t          |¦  «        g¦  «         |
S )a“  Generate a routing :class:`~qiskit.transpiler.PassManager`

    Args:
        routing_pass (TransformationPass): The pass which will perform the
            routing
        target (Target): the :class:`~.Target` object representing the backend
        coupling_map (CouplingMap): The coupling map of the backend to route
            for
        vf2_call_limit (int): The internal call limit for the vf2 post layout
            pass. If this is ``None`` or ``0`` the vf2 post layout will not be
            run.
        backend_properties (BackendProperties): Properties of a backend to
            synthesize for (e.g. gate fidelities).
        seed_transpiler (int): Sets random seed for the stochastic parts of
            the transpiler.
        check_trivial (bool): If set to true this will condition running the
            :class:`~.VF2PostLayout` pass after routing on whether a trivial
            layout was tried and was found to not be perfect. This is only
            needed if the constructed pass manager runs :class:`~.TrivialLayout`
            as a first layout attempt and uses it if it's a perfect layout
            (as is the case with preset pass manager level 1).
        use_barrier_before_measurement (bool): If true (the default) the
            :class:`~.BarrierBeforeFinalMeasurements` transpiler pass will be run prior to the
            specified pass in the ``routing_pass`` argument.
        vf2_max_trials (int): The maximum number of trials to run VF2 when
            evaluating the vf2 post layout
            pass. If this is ``None`` or ``0`` the vf2 post layout will not be run.
    Returns:
        PassManager: The routing pass manager
    c                 ób   •— ‰rt          | ¦  «        r| d         }|�|t          j        k    rdS dS )NÚVF2Layout_stop_reasonTF)rŸ   r#   r¢   )rD   Úvf2_stop_reasonÚcheck_trivials     €rE   Ú_run_post_layout_conditionz@generate_routing_passmanager.<locals>._run_post_layout_conditionK  sF   ø€ ð ð 	Õ 3°LÑ AÔ Að 	Ø*Ð+BÔCˆOØÐ&¨/Õ=PÔ=_Ò*_Ð*_Ø�tØˆurG   NÚrouting_not_needed)Úproperty_set_fieldc                 ó   — | d          S )Nr±   r@   rJ   s    rE   Ú_swap_conditionz5generate_routing_passmanager.<locals>._swap_conditionZ  s   € ØÐ 4Ô5Ð5Ð5rG   ú5qiskit.transpiler.internal.routing.protection.barrier©Úlabelrv   Úignorez8.*argument ``properties`` is deprecated as of Qiskit 1.4Úqiskit©Úcategoryre   Úmodulez:.*argument ``coupling_map`` is deprecated as of Qiskit 1.4F)Ú
call_limitÚ
max_trialsÚstrict_directionc                 ó   — | j         dk    S )Nrµ   r¶   )Únodes    rE   Ú	filter_fnz/generate_routing_passmanager.<locals>.filter_fn‹  s   € ØŒzÐTÒTÐTrG   )r   ry   r   r   r   ÚwarningsÚcatch_warningsÚfilterwarningsÚDeprecationWarningr"   r   r£   r   )Úrouting_passrT   r’   Úvf2_call_limitr¤   Úseed_transpilerr¯   Úuse_barrier_before_measurementÚvf2_max_trialsr°   rn   r´   Úis_vf2_fully_boundedrÂ   s         `       rE   Úgenerate_routing_passmanagerrÍ     s€  ø€ ðhð ð ð ð õ ‰mŒm€GØÐØ�Š•x Ð;OÐPÑPÔPÑQÔQÐQÐQà�Š•x ÐAUÐVÑVÔVÑWÔWÐWð6ð 6ð 6ð &ð WØ�ŠÝ!å2ØUðñ ô ð !ð	ð *ðñ ô ñ
	
ô 
	
ð 
	
ð 
	
ð 	�ŠÕ,¨\À_ÐUÑUÔUÑVÔVÐVà)Ð<¨nÐØÐÐ0Ð<ÐBVÐ<ÝÔ$Ñ&Ô&ð 	ð 	ÝÔ#ØÝ+ØRØð	ñ ô ð õ Ô#ØÝ+ØTØð	ñ ô ð ð �NŠNÝ%Ý!ØØ$Ø*Ø'Ø#1Ø#1Ø).ðñ ô ð 9ðñ ô ñô ð ð	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð 	ð 	ð 	øøøð 	ð 	ð 	ð 	ð6 	�ŠÕ,­[©]¬]ÕFbÐcÑcÔcÑdÔdÐdðUð Uð Uð ‡N‚N•M )Ñ,Ô,Ð-Ñ.Ô.Ð.à€Ns   ÃA3EÅEÅ!Ec                 ó"  — t          ¦   «         }|r[|                     t          || ¬¦  «        ¦  «         d„ }|                     t          t	          || ¬¦  «        g|¬¦  «        ¦  «         |r!|                     t          ¦   «         ¦  «         |S )aþ  Generate a pre-optimization loop :class:`~qiskit.transpiler.PassManager`

    This pass manager will check to ensure that directionality from the coupling
    map is respected

    Args:
        target (Target): the :class:`~.Target` object representing the backend
        coupling_map (CouplingMap): The coupling map to use
        remove_reset_in_zero (bool): If ``True`` include the remove reset in
            zero pass in the generated PassManager
    Returns:
        PassManager: The pass manager

    ©rT   c                 ó   — | d          S )NÚis_direction_mappedr@   rJ   s    rE   Ú_direction_conditionz9generate_pre_op_passmanager.<locals>._direction_condition¦  s   € Ø#Ð$9Ô:Ð:Ð:rG   rv   )r   ry   r   r   r   r   )rT   r’   Úremove_reset_in_zeroÚpre_optrÒ   s        rE   Úgenerate_pre_op_passmanagerrÕ   “  s¬   € õ ‰mŒm€GØð 
Ø�ŠÕ)¨,¸vÐFÑFÔFÑGÔGÐGð	;ð 	;ð 	;ð 	�ŠÝ!Ý˜|°FÐ;Ñ;Ô;Ð<Ø.ðñ ô ñ	
ô 	
ð 	
ð ð 1Ø�ŠÕ-Ñ/Ô/Ñ0Ô0Ð0Ø€NrG   c
                 ó0  — |dk    r�t          j        ¦   «         5  t          j        dt          dd¬¦  «         t	          ||||||| ¬¦  «        t          ||| dt          ||	¬¦  «        t          t          || ¦  «        g}
d	d	d	¦  «         n# 1 swxY w Y   nó|d
k    rÚt          j        ¦   «         5  t          j        dt          dd¬¦  «         t	          ||||||d| ¬¦  «        t          ||| d|d|	¬¦  «        t          | |¬¦  «        t          ¦   «         t          ¦   «         t          || |¬¦  «        t	          ||||||| ¬¦  «        t          ||| d||	¬¦  «        g}
d	d	d	¦  «         n# 1 swxY w Y   nt          d|› d�¦  «        ‚t          |
¦  «        S )aË  Generate a basis translation :class:`~qiskit.transpiler.PassManager`

    Args:
        target (Target): the :class:`~.Target` object representing the backend
        basis_gates (list): A list of str gate names that represent the basis
            gates on the backend target
        method (str): The basis translation method to use
        approximation_degree (Optional[float]): The heuristic approximation degree to
            use. Can be between 0 and 1.
        coupling_map (CouplingMap): the coupling map of the backend
            in case synthesis is done on a physical circuit. The
            directionality of the coupling_map will be taken into
            account if pulse_optimize is True/None and natural_direction
            is True/None.
        unitary_synthesis_plugin_config (dict): The optional dictionary plugin
            configuration, this is plugin specific refer to the specified plugin's
            documentation for how to use.
        backend_props (BackendProperties): Properties of a backend to
            synthesize for (e.g. gate fidelities).
        unitary_synthesis_method (str): The unitary synthesis method to use. You can
            see a list of installed plugins with :func:`.unitary_synthesis_plugin_names`.
        hls_config (HLSConfig): An optional configuration class to use for
            :class:`~qiskit.transpiler.passes.HighLevelSynthesis` pass.
            Specifies how to synthesize various high-level objects.
        qubits_initially_zero (bool): Indicates whether the input circuit is
            zero-initialized.

    Returns:
        PassManager: The basis translation pass manager

    Raises:
        TranspilerError: If the ``method`` kwarg is not a valid value
    r3   r¸   z;.*argument ``backend_props`` is deprecated as of Qiskit 1.4r¹   rº   )r�   r’   Úbackend_propsr�   rŽ   rT   T)r‘   r’   rT   r“   r”   rW   r•   Nr4   rŒ   )r�   r’   r×   r�   rŽ   r�   rT   )r‘   r’   rT   r“   rW   r�   r•   )rT   rW   )rW   rT   r�   )rW   r�   r’   r×   r�   rŽ   rT   )r‘   r’   rT   r“   rW   r•   zInvalid translation method rs   )rÃ   rÄ   rÅ   rÆ   r   r   r–   r	   r
   r   r   r   r%   r   )rT   rW   rŽ   r�   r’   r×   r—   r˜   r‘   r•   Úunrolls              rE   Ú generate_translation_passmanagerrÙ   ´  s±  € ðn �ÒÐÝÔ$Ñ&Ô&ð 	ð 	ÝÔ#ØÝ+ØUØð	ñ ô ð õ !ØØ)=Ø!-Ø"/Ø"AØ3Ø!ðñ ô õ #Ø)Ø!-Ø!Ø&*Ý(+Ø +Ø*?ðñ ô õ  ¥ [°&Ñ9Ô9ð+ˆFð	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð 	ð 	ð 	øøøð 	ð 	ð 	ð 	øð< 
�;Ò	Ð	ÝÔ$Ñ&Ô&ð 6	ð 6	ÝÔ#ØÝ+ØUØð	ñ ô ð õ !ØØ)=Ø!-Ø"/Ø"AØ3Ø Ø!ð	ñ 	ô 	õ #Ø)Ø!-Ø!Ø&*Ø +Ø Ø*?ðñ ô õ  f¸+ÐFÑFÔFÝÑ!Ô!Ý‘”Ý!Ø +Ø!Ø)=ðñ ô õ
 !Ø +Ø)=Ø!-Ø"/Ø"AØ3Ø!ðñ ô õ #Ø)Ø!-Ø!Ø&*Ø +Ø*?ðñ ô ðO/ˆFð6	ð 6	ð 6	ñ 6	ô 6	ð 6	ð 6	ð 6	ð 6	ð 6	ð 6	øøøð 6	ð 6	ð 6	ð 6	øõp ÐE¸FÐEÐEÐEÑFÔFÐFÝ�vÑÔÐs%   šA$B
Â
BÂBÂ/B/E*Å*E.Å1E.Úinst_mapc                 ó
   — | d uS r`   r@   )rÚ   s    rE   ú<lambda>rÜ   G  s   € ¸HÈDÐ<P€ rG   )Ú	predicatec           	      óH  — t          ¦   «         }|r8|                     ¦   «         r$|                     t          ||¬¦  «        ¦  «         |r�t          t          t
          t
          dœ}|                     t          | |¬¦  «        ¦  «         	 |                      ||         | |¬¦  «        ¦  «         n€# t          $ r}t          d|› d�¦  «        |‚d}~ww xY w| rXd„ }|                     t          d¦  «        ¦  «         |                     t          t          | |¬¦  «        |¬	¦  «        ¦  «         |j        d
k    s!|j        d
k    s|j        d
k    s|j        d
k    rŸd„ }	|                     t          |j        |j        |¬¦  «        ¦  «         |                     t          t!          |j        |j        |¬¦  «        |	¬	¦  «        ¦  «         |                     t#          |j        |j        |¬¦  «        ¦  «         |r#|                     t%          |¬¦  «        ¦  «         |S )a  Generate a post optimization scheduling :class:`~qiskit.transpiler.PassManager`

    Args:
        instruction_durations (dict): The dictionary of instruction durations
        scheduling_method (str): The scheduling method to use, can either be
            ``'asap'``/``'as_soon_as_possible'`` or
            ``'alap'``/``'as_late_as_possible'``
        timing_constraints (TimingConstraints): Hardware time alignment restrictions.
        inst_map (InstructionScheduleMap): DEPRECATED. Mapping object that maps gate to schedule.
        target (Target): The :class:`~.Target` object representing the backend

    Returns:
        PassManager: The scheduling pass manager

    Raises:
        TranspilerError: If the ``scheduling_method`` kwarg is not a valid value
    )rÚ   rT   )r5   Úas_late_as_possibler6   Úas_soon_as_possiblerÏ   zInvalid scheduling method rs   Nc                 ó   — | d         S )NÚcontains_delayr@   rJ   s    rE   Ú_contains_delayz,generate_scheduling.<locals>._contains_delayn  s   € ØÐ 0Ô1Ð1rG   Údelayrv   r^   c                 ó   — | d         S )NÚreschedule_requiredr@   rJ   s    rE   Ú_require_alignmentz/generate_scheduling.<locals>._require_alignment  s   € ØÐ 5Ô6Ð6rG   )Úacquire_alignmentÚpulse_alignmentrT   )ÚgranularityÚ
min_lengthrT   )r   Úhas_custom_gatery   r    r   r   r   ÚKeyErrorr%   r!   r   rê   rë   rè   ré   r   r   r   r   )
Úinstruction_durationsr;   Útiming_constraintsrÚ   rT   rq   Ú	schedulerÚexrã   rç   s
             rE   Úgenerate_schedulingrò   G  s¼  € õ* ‘”€JØð H�H×,Ò,Ñ.Ô.ð HØ×Ò�*¨h¸vÐFÑFÔFÑGÔGÐGØð 
õ )Ý#7Ý(Ý#7ð	
ð 
ˆ	ð 	×ÒÕ,Ð-BÈ6ÐRÑRÔRÑSÔSÐSð	]Ø×ÒÐ:˜iÐ(9Ô:Ð;PÐY_Ð`Ñ`Ô`ÑaÔaÐaÐaøÝð 	]ð 	]ð 	]Ý!Ð"SÐ?PÐ"SÐ"SÐ"SÑTÔTÐZ\Ð\øøøøð	]øøøà	ð 

ð	2ð 	2ð 	2ð 	×ÒÕ-¨gÑ6Ô6Ñ7Ô7Ð7Ø×ÒÝ!Ý"Ð#8ÀÐHÑHÔHÐTcðñ ô ñ	
ô 	
ð 	
ð 	Ô&¨!Ò+Ð+ØÔ(¨AÒ-Ð-ØÔ/°1Ò4Ð4ØÔ-°Ò2Ð2ð	7ð 	7ð 	7ð 	×ÒÝ$Ø"4Ô"FØ 2Ô BØðñ ô ñ	
ô 	
ð 	
ð 	×ÒÝ!Ý%Ø&8Ô&JØ$6Ô$FØ!ðñ ô ð
 -ðñ ô ñ		
ô 		
ð 		
ð 	×ÒÝØ.Ô:Ø-Ô8Øðñ ô ñ	
ô 	
ð 	
ð ð 3à×Ò�(¨&Ð1Ñ1Ô1Ñ2Ô2Ð2àÐs   Â&B2 Â2
CÂ<CÃCÚ	VF2Limits)r½   r¾   Úoptimization_levelr7   Úinitial_layoutÚreturnc                 ó¸   — t          dd¦  «        }|€G|€E| dv rt          t          d¦  «        d¦  «        }n#| dk    rt          t          d¦  «        d¦  «        }|S )z¥Get the VF2 limits for VF2-based layout passes.

    Returns:
        VF2Limits: An namedtuple with optional elements
        ``call_limit`` and ``max_trials``.
    N>   r^   é   g     jè@iÄ	  rŒ   g    8œ|Ai�Ð )ró   Úint)rô   r7   rõ   Úlimitss       rE   Úget_vf2_limitsrû   ¤  su   € õ �t˜TÑ"Ô"€FØÐ Ð!7Ø Ð'Ð'ÝÝ�C‘”Øñô ˆFˆFð   1Ò$Ð$ÝÝ�C‘”Øñô ˆFð €MrG   )NNNNNr@   N)NNrŠ   NNT)NNNNFTN)NNF)	Nr3   NNNrŠ   NNTr`   )NN)LÚ__doc__ÚcollectionsrÃ   Útypingr   Ú"qiskit.circuit.equivalence_libraryr   r–   Úqiskit.circuit.controlflowr   Ú#qiskit.passmanager.flow_controllersr   Úqiskit.transpiler.passmanagerr   Úqiskit.transpiler.passesr   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   Ú*qiskit.transpiler.passes.layout.vf2_layoutr#   Ú/qiskit.transpiler.passes.layout.vf2_post_layoutr$   Úqiskit.transpiler.exceptionsr%   Úqiskit.transpiler.layoutr&   Úqiskit.utils.deprecate_pulser'   Úqiskit.utils.deprecationr(   Ú
namedtupler)   rY   rw   rK   rN   rP   r�   rƒ   r‰   rš   rœ   rŸ   r£   rÍ   rÕ   rÙ   rò   ró   rù   Ústrrû   r@   rG   rE   ú<module>r     s*  ðð ,Ð +à Ð Ð Ð Ø €€€Ø Ð Ð Ð Ð Ð à OÐ OÐ OÐ OÐ OÐ OØ <Ð <Ð <Ð <Ð <Ð <à EÐ EÐ EÐ EÐ EÐ EØ 5Ð 5Ð 5Ð 5Ð 5Ð 5Ø *Ð *Ð *Ð *Ð *Ð *Ø 4Ð 4Ð 4Ð 4Ð 4Ð 4Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø 6Ð 6Ð 6Ð 6Ð 6Ð 6Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2Ø 4Ð 4Ð 4Ð 4Ð 4Ð 4Ø 5Ð 5Ð 5Ð 5Ð 5Ð 5Ø 7Ð 7Ð 7Ð 7Ð 7Ð 7Ø -Ð -Ð -Ð -Ð -Ð -Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2Ø CÐ CÐ CÐ CÐ CÐ CØ 7Ð 7Ð 7Ð 7Ð 7Ð 7Ø 7Ð 7Ð 7Ð 7Ð 7Ð 7Ø 9Ð 9Ð 9Ð 9Ð 9Ð 9Ø 9Ð 9Ð 9Ð 9Ð 9Ð 9Ø :Ð :Ð :Ð :Ð :Ð :Ø 7Ð 7Ð 7Ð 7Ð 7Ð 7Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø ;Ð ;Ð ;Ð ;Ð ;Ð ;Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2Ø 7Ð 7Ð 7Ð 7Ð 7Ð 7Ø -Ð -Ð -Ð -Ð -Ð -Ø =Ð =Ð =Ð =Ð =Ð =Ø :Ð :Ð :Ð :Ð :Ð :Ø /Ð /Ð /Ð /Ð /Ð /Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2Ø JÐ JÐ JÐ JÐ JÐ JØ SÐ SÐ SÐ SÐ SÐ SØ 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø +Ð +Ð +Ð +Ð +Ð +Ø <Ð <Ð <Ð <Ð <Ð <Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2à*�KÔ*Ð+>Ð@ZÑ[Ô[Ð ð
 'Ð&Ð/LÐ/LÐ/LÐZ]ÐZ]ÑZ_ÔZ_Ð`Ñ`Ô`Ø'Ð'Ø/Ð/Ð/¸kÈ7Ð=Sðñ ô ð ,Ð+Ø˜{Ð+Ø�C‘E”Eðñ ô ð -Ð,°S°S±U´UÈÈÉÌÐNÑNÔNØ*Ð*°3°3±5´5ÀvÈvÐFVÐWÑWÔWðð Ð ðMð Mð MðQð Qð QðLð Lð Lð Lð Lñ Lô Lð Lð: ØØØØØØð.ð .ð .ð .ðbð ð ðð ð ð  ØØ&Ø$(ØØð<ð <ð <ð <ð~cð cð cð ]ð ]ð ]ðð ð ð €Ø	Ø
ØØ$ðFð	ñ 	ô 	ð ØØØØØ#'Øðoð oð oñ	ô 	ðoðdð ð ð ðB €Ø	Ø
ØØ$ðFð	ñ 	ô 	ð ØØØØØ&Ø$(ØØðFð Fð Fñ	ô 	ðFðR Ð�ZÐ+PÐ+PÐQÑQÔQàSWðVð Vð Vñ RÔQðVðr #ˆKÔ" ;Ð0LÑMÔM€	ð
 $(Ø'+ðð Øðà˜C”=ðð ˜VÔ$ðð ð	ð ð ð ð ð rG   