
    z	ia	                     :    S r SSKJr  SSKJrJr   " S S\5      rg)zOCheck if the gates follow the right direction with respect to the coupling map.    )AnalysisPass)check_gate_direction_couplingcheck_gate_direction_targetc                   6   ^  \ rS rSrSrSU 4S jjrS rSrU =r$ )CheckGateDirection   zZCheck if the two-qubit gates follow the right direction with
respect to the coupling map.
c                 :   > [         TU ]  5         Xl        X l        g)zCheckGateDirection initializer.

Args:
    coupling_map (CouplingMap): Directed graph representing a coupling map.
    target (Target): The backend target to use for this pass. If this is specified
        it will be used instead of the coupling map
N)super__init__coupling_maptarget)selfr   r   	__class__s      m/home/james-whalen/.local/lib/python3.13/site-packages/qiskit/transpiler/passes/utils/check_gate_direction.pyr   CheckGateDirection.__init__   s     	(    c                    U R                   c;  [        U[        U R                  R	                  5       5      5      U R
                  S'   g[        U R                   R                  5      S:X  aI  [        U[        U R                   R                  5       R	                  5       5      5      U R
                  S'   g[        XR                   5      U R
                  S'   g)zRun the CheckGateDirection pass on `dag`.

If `dag` is mapped and the direction is correct the property
`is_direction_mapped` is set to True (or to False otherwise).

Args:
    dag (DAGCircuit): DAG to check.
Nis_direction_mappedr   )
r   r   setr   	get_edgesproperty_setlenoperation_namesbuild_coupling_mapr   )r   dags     r   runCheckGateDirection.run'   s     ;;7TS**44678D34 ,,-27TS779CCEF8D34 8SSVXcXc7dD34r   )r   r   )N)	__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes____classcell__)r   s   @r   r   r      s    
e er   r   N)r"   qiskit.transpiler.basepassesr   !qiskit._accelerate.gate_directionr   r   r    r   r   <module>r(      s!    V 5&e &er   