# qiskit.converters.dagdependency_to_circuit のソースコード

# 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 dependency to a circuit"""
from qiskit.circuit import QuantumCircuit

[ドキュメント]def dagdependency_to_circuit(dagdependency):
"""Build a QuantumCircuit object from a DAGDependency.

Args:
dagdependency (DAGDependency): the input dag.

Return:
QuantumCircuit: the circuit representing the input dag dependency.
"""

name = dagdependency.name or None
circuit = QuantumCircuit(dagdependency.qubits, dagdependency.clbits,
*dagdependency.qregs.values(), *dagdependency.cregs.values(),
name=name)