# Código fonte para qiskit.converters.circuit_to_dagdependency

# This code is part of Qiskit.
#
#
# obtain a copy of this license in the LICENSE.txt file in the root directory
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""Helper function for converting a circuit to a dag dependency"""

from qiskit.dagcircuit.dagdependency import DAGDependency

[documentos]def circuit_to_dagdependency(circuit):
"""Build a DAGDependency object from a QuantumCircuit.

Args:
circuit (QuantumCircuit): the input circuits.

Return:
DAGDependency: the DAG representing the input circuit as a dag dependency.
"""
dagdependency = DAGDependency()
dagdependency.name = circuit.name

for register in circuit.qregs: