
    z	i                     :    S r SSKJr  SSKJrJr   " S S\5      rg)zFCheck if all gates in the DAGCircuit are in the specified basis gates.    )AnalysisPass)any_gate_missing_from_basisany_gate_missing_from_targetc                   6   ^  \ rS rSrSrSU 4S jjrS rSrU =r$ )GatesInBasis   z7Check if all gates in a DAG are in a given set of gatesc                    > [         TU ]  5         SU l        Ub!  [        U5      R	                  1 Sk5      U l        X l        g)a  Initialize the GatesInBasis pass.

Args:
    basis_gates (list): The list of strings representing the set of basis gates.
    target (Target): The target representing the backend. If specified
        this will be used instead of the ``basis_gates`` parameter
N>   delayresetstorebarriermeasuresnapshot)super__init___basis_gatessetunion_target)selfbasis_gatestarget	__class__s      d/home/james-whalen/.local/lib/python3.13/site-packages/qiskit/transpiler/passes/utils/gates_basis.pyr   GatesInBasis.__init__   s@     	 " #K 0 6 6M!D     c                     U R                   c  U R                  c  SU R                  S'   gU R                  b  [        XR                  5      nO[	        XR                   5      nU(       + U R                  S'   g)z#Run the GatesInBasis pass on `dag`.NTall_gates_in_basis)r   r   property_setr   r   )r   daggates_out_of_basiss      r   runGatesInBasis.run*   si    $)=6:D23<<#!=c<<!P!<SBSBS!T6H2H./r   )r   r   )NN)	__name__
__module____qualname____firstlineno____doc__r   r"   __static_attributes____classcell__)r   s   @r   r   r      s    A 	I 	Ir   r   N)r(   qiskit.transpiler.basepassesr   !qiskit._accelerate.gates_in_basisr   r   r    r   r   <module>r.      s!    M 5I< Ir   