qiskit/transpiler/passes/mapping/lookahead_swap.py
def _copy_circuit_metadata(source_dag, coupling_map):
    """Return a copy of source_dag with metadata but empty.
    Generate only a single qreg in the output DAG, matching the size of the
    coupling_map."""

    target_dag = DAGCircuit()
    target_dag.name = source_dag.name

    for creg in source_dag.cregs.values():
        target_dag.add_creg(creg)

    device_qreg = QuantumRegister(len(coupling_map.physical_qubits), 'q')
    target_dag.add_qreg(device_qreg)

    return target_dag
def _copy_circuit_metadata(source_dag, coupling_map):
    target_dag = DAGCircuit()
    target_dag.name = source_dag.name

    for creg in source_dag.cregs.values():
        target_dag.add_creg(creg)

    device_qreg = QuantumRegister(len(coupling_map.physical_qubits), 'q')
    target_dag.add_qreg(device_qreg)

    return target_dag
def _copy_circuit_metadata ( source_dag , coupling_map ) : target_dag = DAGCircuit ( ) target_dag . name = source_dag . name for creg in source_dag . cregs . values ( ) : target_dag . add_creg ( creg ) device_qreg = QuantumRegister ( len ( coupling_map . physical_qubits ) , 'q' ) target_dag . add_qreg ( device_qreg ) return target_dag
Return a copy of source_dag with metadata but empty.
    Generate only a single qreg in the output DAG, matching the size of the
    coupling_map.
Return a copy of source_dag with metadata but empty . Generate only a single qreg in the output DAG matching the size of the coupling_map .