def dagcircuit_to_tk(dag:DAGCircuit, _BOX_UNKNOWN:bool=BOX_UNKNOWN, _DROP_CONDS:bool=DROP_CONDS) -> Circuit :
    """Converts a :py:class:`qiskit.DAGCircuit` into a :math:`\\mathrm{t|ket}\\rangle` :py:class:`Circuit`.
    Note that not all Qiskit operations are currently supported by pytket. Classical registers are supported only as 
    the output of measurements. This does not attempt to preserve the structure 
    of the quantum registers, instead creating one big quantum register.

    :param dag: A circuit to be converted

    :return: The converted circuit
    """
    qs = dag.get_qubits()
    qnames = ["%s[%d]" % (r.name, i) for r, i in qs]
    g = dag.multi_graph
    circ = Circuit()
    if DEBUG :
        print("new graph w " + str(len(qs)) + " qubits")
        print(str(qs))

    # process vertices
    tk_vs = [ None for _ in range(dag.node_counter + 1) ]    
    for n in g.nodes :
        node = g.nodes[n]
        if DEBUG : 
            print(str(n) + " " + str(node["type"])+ " " + str(node["name"]))
        if ((node["type"]=="in" or node["type"]=="out") and not node["name"] in qnames) :
            # don't create vertices for in/outs of classical registers
            if DEBUG:
                print("Dropping node " + str(n))
            continue
        else :
            tk_vs[n] = circ._add_vertex(_node_converter(circ, node, _BOX_UNKNOWN=_BOX_UNKNOWN, _DROP_CONDS=_DROP_CONDS))
            if DEBUG:
                print("qiskit vertex " + str(n) + " is t|ket> vertex " +str(tk_vs[n]))
    # process edges
    for e in g.edges(data=True) :
        wire = e[2]["wire"]
        if wire in qs : # ignore classical wires
            src_port = _get_port_for_edge(g.node[e[0]], wire)
            tgt_port = _get_port_for_edge(g.node[e[1]], wire)
            if DEBUG : 
                print(_make_edge_str(tk_vs[e[0]],src_port,tk_vs[e[1]],tgt_port))
            circ._add_edge(tk_vs[e[0]],src_port,tk_vs[e[1]],tgt_port)                

    return circ