
    z	i                    4    S r SSKJr  SSKJr   " S S5      rg)z@Object to represent the information at a node in the DAGCircuit.    )annotations)QiskitErrorc                      \ rS rSrSr/ SQr              S               SS jjr\S 5       r\R                  S 5       r\S 5       r
\
R                  S	 5       r
\S
 5       rS rSrg)
DAGDepNode   zObject to represent the information at a node in the DAGDependency().

It is used as the return value from `*_nodes()` functions and can
be supplied to functions that take a node.
)type_opname_qargscargssort_keynode_id
successorspredecessors	reachablematchedwith	isblockedsuccessorstovisitqindicescindicesNc                n   Xl         X l        X0l        Ub  [        U5      OSU l        Ub  [        U5      OSU l        Xl        [        U R                  5      U l        Ub  UO/ U l	        Ub  UO/ U l
        Xl        U	b  U	O/ U l        Xl        U
b  U
O/ U l        Ub  UO/ U l        Ub  Xl        g / U l        g )N )r   r	   r
   tupler   r   r   strr   r   r   r   r   r   r   r   r   )selfr   opr
   qargsr   r   r   r   r   r   r   r   r   nids                  V/home/james-whalen/.local/lib/python3.13/site-packages/qiskit/dagcircuit/dagdepnode.py__init__DAGDepNode.__init__.   s    $ 		&+&7eElR%*%6U5\B
 -3=3IZr7C7O|UW"5@5LkRT(!2!>B 	 08/C8/7/C8    c                    U R                   (       a  U R                   S:w  a  [        S[        U 5       S35      eU R                  $ )zNReturns the Instruction object corresponding to the op for the node, else Noner   z	The node z is not an op node)r   r   r   r	   r   s    r   r   DAGDepNode.opR   s8     yyDII-	#d)4FGHHxxr"   c                    Xl         g )N)r	   )r   datas     r   r   r%   Y   s    r"   c                    U R                   $ )z,
Returns list of Qubit, else an empty list.
)r   r$   s    r   r   DAGDepNode.qargs]   s    
 {{r"   c                D    [        U5      U l        [        U5      U l        g)z-Sets the qargs to be the given list of qargs.N)r   r   r   r   )r   	new_qargss     r   r   r)   d   s     I&Ir"   c                *   SU R                   s=:X  a  UR                   :X  a.  O  O+[        U R                  5      [        UR                  5      :H  $ U R                  UR                  :X  a  U R                  UR                  :X  a  U R                   UR                   :X  av  U R                  UR                  :X  a\  U R
                  UR
                  :X  aB  U R                  S:X  a1  [        U R                  SS5      [        UR                  SS5      :w  a  ggg)z
Check if DAG nodes are considered equivalent, e.g., as a node_match for nx.is_isomorphic.

Args:
    node1 (DAGDepNode): A node to compare.
    node2 (DAGDepNode): The other node to compare.

Return:
    Bool: If node1 == node2
barrierr   	conditionNFT)r
   setr   r   r	   r   getattr)node1node2s     r   semantic_eqDAGDepNode.semantic_eqj   s     

0ejj0u||$ELL(999::#yyEII%::+||u||3 ;;%++5$zzT1#*599k4#HG$)II{DM" $" ,1#'r"   c                4   [        5       nU R                  Ul        U R                  Ul        U R                  Ul        U R
                  Ul        U R                  Ul        U R                  Ul        U R                  Ul        U R                  Ul	        U R                  Ul
        U R                  Ul        U R                  Ul        U R                  Ul        U R                  Ul        U R                  Ul        U R                   R#                  5       Ul        U$ )z_
Function to copy a DAGDepNode object.
Returns:
    DAGDepNode: a copy of a DAGDepNode object.
)r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   copy)r   
dagdepnodes     r   r6   DAGDepNode.copy   s      \
))

))
 KK
::
!\\
"mm
 $
"&"3"3
#~~
#~~
'+'='=
$"mm
"mm
!%!1!1!6!6!8
r"   )r	   r   r   r   r   r   r
   r   r   r   r   r   r   r   r   )NNNr   r   NNNNNNNN)r   list[int] | Noner   r:   r   r:   r   r:   r   zbool | Noner   r:   r   r:   r   int)__name__
__module____qualname____firstlineno____doc__	__slots__r    propertyr   setterr   staticmethodr3   r6   __static_attributes__r   r"   r   r   r      s
   I( '+)-(,.2!%%)%)"L %"L '"L &"L ,"L "L #"L #"L "LH   YY    \\' '
  8r"   r   N)r@   
__future__r   qiskit.exceptionsr   r   r   r"   r   <module>rH      s    G " )K Kr"   