
    z	ik                     4    S r SSKJr  SSKJr  SSSS.S jjrg)z1Helper function for converting a circuit to a dag    )BlueprintCircuit)circuit_to_dagN)qubit_orderclbit_orderc                   [        U [        5      (       a!  U R                  (       d  U R                  5         UbF  [	        U5      U R
                  :w  d"  [        U5      [        U R                  5      :w  a  [        S5      eUbF  [	        U5      U R                  :w  d"  [        U5      [        U R                  5      :w  a  [        S5      e[        XX#5      nU R                  Ul        U R                  Ul        U$ )ak  Build a :class:`.DAGCircuit` object from a :class:`.QuantumCircuit`.

Args:
    circuit (QuantumCircuit): the input circuit.
    copy_operations (bool): Deep copy the operation objects
        in the :class:`~.QuantumCircuit` for the output :class:`~.DAGCircuit`.
        This should only be set to ``False`` if the input :class:`~.QuantumCircuit`
        will not be used anymore as the operations in the output
        :class:`~.DAGCircuit` will be shared instances and modifications to
        operations in the :class:`~.DAGCircuit` will be reflected in the
        :class:`~.QuantumCircuit` (and vice versa).
    qubit_order (Iterable[~qiskit.circuit.Qubit] or None): the order that the qubits should be
        indexed in the output DAG.  Defaults to the same order as in the circuit.
    clbit_order (Iterable[Clbit] or None): the order that the clbits should be indexed in the
        output DAG.  Defaults to the same order as in the circuit.

Return:
    DAGCircuit: the DAG representing the input circuit.

Raises:
    ValueError: if the ``qubit_order`` or ``clbit_order`` parameters do not match the bits in
        the circuit.

Example:
    .. plot::
        :include-source:
        :nofigs:

        from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
        from qiskit.dagcircuit import DAGCircuit
        from qiskit.converters import circuit_to_dag

        q = QuantumRegister(3, 'q')
        c = ClassicalRegister(3, 'c')
        circ = QuantumCircuit(q, c)
        circ.h(q[0])
        circ.cx(q[0], q[1])
        circ.measure(q[0], c[0])
        circ.rz(0.5, q[1])
        dag = circuit_to_dag(circ)
zE'qubit_order' does not contain exactly the same qubits as the circuitzE'clbit_order' does not contain exactly the same clbits as the circuit)
isinstancer   	_is_built_buildlen
num_qubitssetqubits
ValueError
num_clbitsclbitscore_circuit_to_dag	_duration_unit)circuitcopy_operationsr   r   
dagcircuits        Z/home/james-whalen/.local/lib/python3.13/site-packages/qiskit/converters/circuit_to_dag.pyr   r      s    V '+,,  NNKG...#k2Bc'..FY2Y`aaKG...#k2Bc'..FY2Y`aa$W{XJ",,J}}J    )T)__doc__'qiskit.circuit.library.blueprintcircuitr   qiskit._accelerate.convertersr   r    r   r   <module>r      s    8 D O=SW =r   