§
    º³ÙgÆ  ã                  óN   — d 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„ZdS )z“Pass manager for optimization level 1, providing light optimization.

Level 1 pass manager: light optimization by simple adjacent gate collapsing.
é    )Úannotations)ÚPassManagerConfig)ÚStagedPassManager)Úcommon)ÚPassManagerStagePluginManagerÚpass_manager_configr   Úreturnr   c           
     ó  — t          ¦   «         }| j        }| j        }| j        }| j        pd}| j        pd}| j        pd}| j        pd}| j        pd}	| j	        pd}
| j
        }|                     d|| d¬¦  «        }|s|r|                     d|| d¬¦  «        }|}nd}d}|                     d	|| d¬¦  «        }|r|j        r|�.|                     d
¬¦  «        rt          j        ||d¬¦  «        }nt          j        d¬¦  «        }|                     d|	| d¬¦  «        }|                     d|
| d¬¦  «        }t          j        ||||	|
||¬¦  «        }|                     d|| d¬¦  «        }t#          ||||||||¬¦  «        S )au  Level 1 pass manager: light optimization by simple adjacent gate collapsing.

    This pass manager applies the user-given initial layout. If none is given,
    and a trivial layout (i-th virtual -> i-th physical) makes the circuit fit
    the coupling map, that is used.
    Otherwise, the circuit is mapped to the most densely connected coupling subgraph,
    and swaps are inserted to map. Any unused physical qubit is allocated as ancilla space.
    The pass manager then unrolls the circuit to the desired basis, and transforms the
    circuit to match the coupling map. Finally, optimizations in the form of adjacent
    gate collapse and redundant reset removal are performed.

    Args:
        pass_manager_config: configuration of the pass manager.

    Returns:
        a level 1 pass manager.

    Raises:
        TranspilerError: if the passmanager config is invalid.
    ÚdefaultÚsabreÚ
translatorÚroutingé   )Úoptimization_levelÚlayoutNÚtranslationT)Ústrict_directionF)Úremove_reset_in_zeroÚoptimizationÚ
scheduling)Úlayout_methodÚrouting_methodÚtranslation_methodÚoptimization_methodÚscheduling_methodÚbasis_gatesÚtargetÚinit)Úpre_initr   r   r   r   Úpre_optimizationr   r   )r   r   Úcoupling_mapÚinitial_layoutÚinit_methodr   r   r   r   r   r   Úget_passmanager_stageÚis_symmetricÚget_non_global_operation_namesr   Úgenerate_pre_op_passmanagerÚ#generate_control_flow_options_checkr   )r   Úplugin_managerr   r!   r"   r#   r   r   r   r   r   r   Ú
routing_pmr   r   r   r    r   Úschedr   r   s                        úb/granary/edev/quantum/lib/python3.11/site-packages/qiskit/transpiler/preset_passmanagers/level1.pyÚlevel_1_pass_managerr-      sW  € õ* 3Ñ4Ô4€NØ%Ô1€KØ&Ô3€LØ(Ô7€NØ%Ô1Ð>°Y€Kð (Ô5ÐB¸€MØ(Ô7ÐB¸7€NØ,Ô?ÐOÀ<ÐØ-ÔAÐNÀYÐØ+Ô=ÐJÀÐØ Ô'€Fð  ×5Ò5Ø�>Ð#6È1ð 6ñ ô €Jð
 ð �~ð Ø×5Ò5Ø�mÐ%8ÈQð 6ñ 
ô 
ˆð ˆˆð ˆØˆà ×6Ò6ØÐ)Ð+>ÐSTð 7ñ ô €Kð 	ð Z˜\Ô6ð ZØÐ˜v×DÒDÐVZÐDÑ[Ô[Ðå!Ô=Ø�L°uð
ñ 
ô 
ÐÐõ "Ô=ÐSXÐYÑYÔYÐà!×7Ò7ØÐ+Ð-@ÐUVð 8ñ ô €Lð ×0Ò0ØÐ'Ð)<ÐQRð 1ñ ô €Eõ Ô9Ø#Ø%Ø-Ø/Ø+ØØðñ ô €Hð ×/Ò/Ø�Ð0ÀQð 0ñ ô €Dõ ØØØØØØ)Ø!Øð	ñ 	ô 	ð 	ó    N)r   r   r	   r   )Ú__doc__Ú
__future__r   Ú$qiskit.transpiler.passmanager_configr   Úqiskit.transpiler.passmanagerr   Ú%qiskit.transpiler.preset_passmanagersr   Ú,qiskit.transpiler.preset_passmanagers.pluginr   r-   © r.   r,   ú<module>r6      s›   ððð ð #Ð "Ð "Ð "Ð "Ð "Ø BÐ BÐ BÐ BÐ BÐ BØ ;Ð ;Ð ;Ð ;Ð ;Ð ;Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8ðð ð ð ð ð ð
^ð ^ð ^ð ^ð ^ð ^r.   