# qiskit.converters.dag_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 dag circuit to a dag dependency"""
from qiskit.dagcircuit.dagdependency import DAGDependency

[ドキュメント]def dag_to_dagdependency(dag):
"""Build a DAGDependency object from a DAGCircuit.

Args:
dag (DAGCircuit): the input dag.

Return:
DAGDependency: the DAG representing the input circuit as a dag dependency.
"""

dagdependency = DAGDependency()
dagdependency.name = dag.name

for register in dag.qregs.values():

for register in dag.cregs.values():

for node in dag.topological_op_nodes():
# Get arguments for classical control (if any)
inst = node.op.copy()