§
    ¹³ÙgH  ã                   ó2   — d Z ddlmZ ddlmZ ddddœd„ZdS )	z1Helper function for converting a circuit to a dagé    )ÚBlueprintCircuit)Úcircuit_to_dagTN)Úqubit_orderÚclbit_orderc                óò  — t          | t          ¦  «        r| j        s|                      ¦   «          |�Lt	          |¦  «        | j        k    s%t          |¦  «        t          | j        ¦  «        k    rt          d¦  «        ‚|�Lt	          |¦  «        | j	        k    s%t          |¦  «        t          | j
        ¦  «        k    rt          d¦  «        ‚t          | |||¦  «        }| j        |_        | j        |_        |S )aÒ  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:
        .. code-block::

            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]).c_if(c, 2)
            dag = circuit_to_dag(circ)
    NzE'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ÚdurationÚ_unitÚunit)ÚcircuitÚcopy_operationsr   r   Ú
dagcircuits        úV/granary/edev/quantum/lib/python3.11/site-packages/qiskit/converters/circuit_to_dag.pyr   r      sî   € õR �'Õ+Ñ,Ô,ð ØÔ ð 	Ø�NŠNÑÔÐàÐÝˆKÑÔ˜GÔ.Ò.Ð.µ#°kÑ2BÔ2BÅcÈ'Ì.ÑFYÔFYÒ2YÐ2YåÐ`ÑaÔaÐaàÐÝˆKÑÔ˜GÔ.Ò.Ð.µ#°kÑ2BÔ2BÅcÈ'Ì.ÑFYÔFYÒ2YÐ2YåÐ`ÑaÔaÐaå$ W¨o¸{ÈKÑXÔX€Jà!Ô+€JÔØ”m€J„OØÐó    )T)Ú__doc__Ú'qiskit.circuit.library.blueprintcircuitr   Úqiskit._accelerate.convertersr   r   © r   r   ú<module>r       s^   ðð 8Ð 7à DÐ DÐ DÐ DÐ DÐ DØ OÐ OÐ OÐ OÐ OÐ Oð;ÀÐSWð ;ð ;ð ;ð ;ð ;ð ;ð ;r   