def tk_to_dagcircuit(circ:Circuit,_qreg_name:str="q") -> DAGCircuit :
    """
       Convert a :math:`\\mathrm{t|ket}\\rangle` :py:class:`Circuit` to a :py:class:`qiskit.DAGCircuit` . Requires
       that the circuit only conatins :py:class:`OpType` s from the qelib set.
    
    :param circ: A circuit to be converted

    :return: The converted circuit
    """
    dc = DAGCircuit()
    qreg = QuantumRegister(circ.n_qubits(), name=_qreg_name)
    dc.add_qreg(qreg)
    grid = circ._int_routing_grid()
    slices = _grid_to_slices(grid)
    qubits = _grid_to_qubits(grid, qreg)
    in_boundary = circ._get_boundary()[0]
    out_boundary = circ._get_boundary()[1]
    for s in slices :
        for v in s:
            o = circ._unsigned_to_op(v)
            qargs = [ qubits[(v,i)] for i in range(o.get_n_inputs()) ]
            name, cargs, params = _translate_ops(circ,v)
            if cargs :
                _extend_cregs(dc,cargs)
            if name :
                dc.add_basis_element(name,o.get_n_inputs(),number_classical=len(cargs),number_parameters=len(params))
                ins = Instruction(name, list(map(_normalise_param_out, params)), qargs, cargs)
                dc.apply_operation_back(ins ,qargs=qargs,
                                        cargs=cargs)
    tk2dg_outs = {}
    for v in out_boundary:
        tk2dg_outs[v] = dc.output_map[qubits[(v,0)]]
    for i, v in enumerate(out_boundary):
        dc.multi_graph.node[tk2dg_outs[v]]["wire"] = [qubits[(in_boundary[i],0)]]
        dc.output_map[qubits[(in_boundary[i],0)]] = tk2dg_outs[v]
    return dc
Convert a :math:`\\mathrm{t|ket}\\rangle` :py:class:`Circuit` to a :py:class:`qiskit.DAGCircuit` . Requires
       that the circuit only conatins :py:class:`OpType` s from the qelib set.
    
    :param circ: A circuit to be converted

    :return: The converted circuit