§
    º³Ùg +  ã                   ód   — 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
  G d„ d¦  «        ZdS )	z!Pass Manager Configuration class.é    N)ÚCouplingMap)ÚInstructionDurations)Údeprecate_pulse_arg)Údeprecate_argc                   ó´   — e Zd ZdZ eddddd¬¦  «         edd	„ ¬
¦  «        	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„¦   «         ¦   «         Zedd„¦   «         Zd„ Z	dS )ÚPassManagerConfigzPass Manager Configuration.Ú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 `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_msgÚinst_mapc                 ó
   — | d uS )N© )r   s    úZ/granary/edev/quantum/lib/python3.11/site-packages/qiskit/transpiler/passmanager_config.pyú<lambda>zPassManagerConfig.<lambda>%   s   € ÀÐPTÐ@T€ ó    )Ú	predicateNÚdefaultTc                 ó  — || _         || _        || _        || _        || _        || _        || _        || _        || _        || _	        |	| _
        |
| _        || _        || _        || _        || _        || _        || _        || _        || _        dS )aí
  Initialize a PassManagerConfig object

        Args:
            initial_layout (Layout): Initial position of virtual qubits on
                physical qubits.
            basis_gates (list): List of basis gate names to unroll to.
            inst_map (InstructionScheduleMap): Mapping object that maps gate to schedule.
            coupling_map (CouplingMap): Directed graph represented a coupling
                map.
            layout_method (str): the pass to use for choosing initial qubit
                placement. This will be the plugin name if an external layout stage
                plugin is being used.
            routing_method (str): the pass to use for routing qubits on the
                architecture. This will be a plugin name if an external routing stage
                plugin is being used.
            translation_method (str): the pass to use for translating gates to
                basis_gates. This will be a plugin name if an external translation stage
                plugin is being used.
            scheduling_method (str): the pass to use for scheduling instructions. This will
                be a plugin name if an external scheduling stage plugin is being used.
            instruction_durations (InstructionDurations): Dictionary of duration
                (in dt) for each instruction.
            backend_properties (BackendProperties): Properties returned by a
                backend, including information on gate errors, readout errors,
                qubit coherence times, etc.
            approximation_degree (float): heuristic dial used for circuit approximation
                (1.0=no approximation, 0.0=maximal approximation)
            seed_transpiler (int): Sets random seed for the stochastic parts of
                the transpiler.
            timing_constraints (TimingConstraints): Hardware time alignment restrictions.
            unitary_synthesis_method (str): The string method to use for the
                :class:`~qiskit.transpiler.passes.UnitarySynthesis` pass. Will
                search installed plugins for a valid method. You can see a list of
                installed plugins with :func:`.unitary_synthesis_plugin_names`.
            target (Target): The backend target
            hls_config (HLSConfig): An optional configuration class to use for
                :class:`~qiskit.transpiler.passes.HighLevelSynthesis` pass.
                Specifies how to synthesize various high-level objects.
            init_method (str): The plugin name for the init stage plugin to use
            optimization_method (str): The plugin name for the optimization stage plugin
                to use.
            qubits_initially_zero (bool): Indicates whether the input circuit is
                zero-initialized.
        N)Úinitial_layoutÚbasis_gatesr   Úcoupling_mapÚinit_methodÚlayout_methodÚrouting_methodÚtranslation_methodÚoptimization_methodÚscheduling_methodÚinstruction_durationsr	   Úapproximation_degreeÚseed_transpilerÚtiming_constraintsÚunitary_synthesis_methodÚunitary_synthesis_plugin_configÚtargetÚ
hls_configÚqubits_initially_zero)Úselfr   r   r   r   r   r   r   r!   r"   r	   r#   r$   r%   r&   r'   r(   r)   r   r    r*   s                        r   Ú__init__zPassManagerConfig.__init__   s¨   € ð\ -ˆÔØ&ˆÔØ ˆŒØ(ˆÔØ&ˆÔØ*ˆÔØ,ˆÔØ"4ˆÔØ#6ˆÔ Ø!2ˆÔØ%:ˆÔ"Ø"4ˆÔØ$8ˆÔ!Ø.ˆÔØ"4ˆÔØ(@ˆÔ%Ø/NˆÔ,ØˆŒØ$ˆŒØ%:ˆÔ"Ð"Ð"r   Fc                 ó  — t          |dd¦  «        }|dk    r t          j        d|› d�t          d¬¦  «         t	          |t
          ¦  «        sd}|dk     r|                     ¦   «         } | di |¤Ž}|j        €)|dk     rt          |d	d¦  «        |_        n|j        |_        |j	        €E|dk     r3t          |d
¦  «        r"|                     ¦   «         }|�|j        |_	        n|j        |_	        |j        €:|dk     r(t          |dd¦  «        }|�t          |¦  «        |_        n|j        |_        |j        €,|dk     rt#          j        |¦  «        |_        n|j        |_        |j        €|dk     r|                     ¦   «         |_        |j        €|s|dk    r|j        |_        |j        €)t          |d¦  «        r|                     ¦   «         |_        |j        €)t          |d¦  «        r|                     ¦   «         |_        |S )a»  Construct a configuration based on a backend and user input.

        This method automatically generates a PassManagerConfig object based on the backend's
        features. User options can be used to overwrite the configuration.

        .. deprecated:: 1.3
            The method ``PassManagerConfig.from_backend`` will stop supporting inputs of type
            :class:`.BackendV1` in the `backend` parameter in a future release no
            earlier than 2.0. :class:`.BackendV1` is deprecated and implementations should move
            to :class:`.BackendV2`.

        Args:
            backend (BackendV1 or BackendV2): The backend that provides the configuration.
            pass_manager_options: User-defined option-value pairs.

        Returns:
            PassManagerConfig: The configuration generated based on the arguments.

        Raises:
            AttributeError: If the backend does not support a `configuration()` method.
        Úversionr   é   z\The method PassManagerConfig.from_backend will stop supporting inputs of type `BackendV1` ( z� ) in the `backend` parameter in a future release no earlier than 2.0. `BackendV1` is deprecated and implementations should move to `BackendV2`.é   )ÚcategoryÚ
stacklevelNr   Údefaultsr   Úget_scheduling_stage_pluginÚget_translation_stage_pluginr   )ÚgetattrÚwarningsÚwarnÚDeprecationWarningÚ
isinstanceÚintÚconfigurationr   Úoperation_namesr   Úhasattrr3   Úinstruction_schedule_mapÚ_instruction_schedule_mapr   r   r"   r   Úfrom_backendr	   Ú
propertiesr(   r!   r4   r   r5   )	ÚclsÚbackendÚ_skip_targetÚpass_manager_optionsÚbackend_versionÚconfigÚresr3   Úcmap_edge_lists	            r   rA   zPassManagerConfig.from_backend~   sJ  € õ. " '¨9°aÑ8Ô8ˆØ˜aÒÐÝŒMð.Ø&-ð.ð .ð .õ ,Øðñ ô ð õ ˜/­3Ñ/Ô/ð 	 ØˆOØ˜QÒÐØ×*Ò*Ñ,Ô,ˆFØˆcÐ)Ð)Ð(Ð)Ð)ˆØŒ?Ð"Ø Ò"Ð"Ý")¨&°-ÀÑ"FÔ"F�”�à")Ô"9�”ØŒ<ÐØ Ò"Ð"Ý˜7 JÑ/Ô/ð IØ&×/Ò/Ñ1Ô1�HØÐ+Ø'/Ô'H˜œøà&Ô@�”ØÔÐ#Ø Ò"Ð"Ý!(¨°ÀÑ!FÔ!F�Ø!Ð-Ý'2°>Ñ'BÔ'B�CÔ$øà#*Ô#7�Ô ØÔ$Ð,Ø Ò"Ð"Ý,@Ô,MÈgÑ,VÔ,V�Ô)Ð)à,3Ô,I�Ô)ØÔ!Ð)¨oÀÒ.AÐ.AØ%,×%7Ò%7Ñ%9Ô%9ˆCÔ"ØŒ:Ð lÐØ !Ò#Ð#Ø$œ^�”
ØÔ Ð(­W°WÐ>[Ñ-\Ô-\Ð(Ø$+×$GÒ$GÑ$IÔ$IˆCÔ!ØÔ!Ð)­g°gÐ?]Ñ.^Ô.^Ð)Ø%,×%IÒ%IÑ%KÔ%KˆCÔ"Øˆ
r   c                 óø  — d}d}| j         �Bt          j        | j                              ¦   «         ¦  «        }|                     ||¦  «        }nt          d ¦  «        }d                     g d‘| j        › ‘d‘| j        › ‘d‘t          | j	        ¦  «                             ||¦  «        › ‘d‘| j
        › ‘d‘| j        › ‘d	‘| j        › ‘d
‘| j        › ‘d‘| j        › ‘d‘t          | j        ¦  «                             ||¦  «        › ‘d‘|› ‘d‘| j        › ‘d‘| j        › ‘d‘| j        › ‘d‘| j        › ‘d‘| j        › ‘d‘| j        › ‘d‘t          | j        ¦  «                             ||¦  «        › ‘d‘¦  «        S )Nú
z
	Ú z&Pass Manager Config:
	initial_layout: z
	basis_gates: z
	inst_map: z
	coupling_map: z
	layout_method: z
	routing_method: z
	translation_method: z
	scheduling_method: z
	instruction_durations: z
	backend_properties: z
	approximation_degree: z
	seed_transpiler: z
	timing_constraints: z
	unitary_synthesis_method: z#
	unitary_synthesis_plugin_config: z
	qubits_initially_zero: z

	target: )r	   ÚpprintÚpformatÚto_dictÚreplaceÚstrÚjoinr   r   r   r   r   r   r   r!   r"   r#   r$   r%   r&   r'   r*   r(   )r+   ÚnewlineÚnewline_tabÚbackend_propss       r   Ú__str__zPassManagerConfig.__str__È   së  € ØˆØˆØÔ"Ð.Ý"œN¨4Ô+B×+JÒ+JÑ+LÔ+LÑMÔMˆMØ)×1Ò1°'¸;ÑGÔGˆMˆMå ™IœIˆMðL÷ Lò Lð Lð Lð LØ!%Ô!4ðLð Lð Lð Là"Ô.ðLð Lð Lð Lõ ˜tœ}Ñ-Ô-×5Ò5°g¸{ÑKÔKðLð Lð Lð Lð  $Ô0ð	Lð Lð Lð Lð
 !%Ô 2ðLð Lð Lð Lð "&Ô!4ðLð Lð Lð Lð &*Ô%<ðLð Lð Lð Lð %)Ô$:ðLð Lð Lð Lõ ),¨DÔ,FÑ(GÔ(G×(OÒ(OÐPWÐYdÑ(eÔ(eðLð Lð Lð Lð &3ðLð Lð Lð Lð (,Ô'@ðLð Lð Lð Lð #'Ô"6ðLð Lð Lð Lð &*Ô%<ðLð Lð Lð Lð ,0Ô+HðLð Lð Lð Lð 37Ô2VðLð Lð Lð Lð  )-Ô(Bð!Lð Lð Lð Lõ" ˜Tœ[Ñ)Ô)×1Ò1°'¸;ÑGÔGð#Lð Lð Lð Lñ Lô Lð	
r   )NNNNNNNNNNNNNr   NNNNNT)F)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r,   ÚclassmethodrA   rW   r   r   r   r   r      s÷   € € € € € Ø%Ð%à€]Ø!ØØØ(ðJð	ñ 	ô 	ð Ð˜Ð/TÐ/TÐUÑUÔUð ØØØØØØØØ"ØØ!ØØØ!*Ø(,ØØØØ Ø"ð+V;ð V;ð V;ñ VÔUñ	ô 	ðV;ðp ðGð Gð Gñ „[ðGðR
ð 
ð 
ð 
ð 
r   r   )r[   rN   r7   Úqiskit.transpiler.couplingr   Ú'qiskit.transpiler.instruction_durationsr   Úqiskit.utils.deprecate_pulser   Úqiskit.utils.deprecationr   r   r   r   r   ú<module>ra      s£   ðð (Ð 'à €€€Ø €€€à 2Ð 2Ð 2Ð 2Ð 2Ð 2Ø HÐ HÐ HÐ HÐ HÐ HØ <Ð <Ð <Ð <Ð <Ð <Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2ðK
ð K
ð K
ð K
ð K
ñ K
ô K
ð K
ð K
ð K
r   