Returns a TextDiagramDrawer with the circuit drawn into it.

        Args:
            use_unicode_characters: Determines if unicode characters are
                allowed (as opposed to ascii-only diagrams).
            qubit_namer: Names qubits in diagram. Defaults to str.
            transpose: Arranges qubit wires vertically instead of horizontally.
            precision: Number of digits to use when representing numbers.
            qubit_order: Determines how qubits are ordered in the diagram.
            get_circuit_diagram_info: Gets circuit diagram info. Defaults to
                protocol with fallback.

        Returns:
            The TextDiagramDrawer instance.

def to_text_diagram_drawer(
            self,
            *,
            use_unicode_characters: bool = True,
            qubit_namer: Optional[Callable[[ops.Qid], str]] = None,
            transpose: bool = False,
            precision: Optional[int] = 3,
            qubit_order: ops.QubitOrderOrList = ops.QubitOrder.DEFAULT,
            get_circuit_diagram_info:
                Optional[Callable[[ops.Operation,
                                   protocols.CircuitDiagramInfoArgs],
                                  protocols.CircuitDiagramInfo]]=None
    ) -> TextDiagramDrawer:
        """Returns a TextDiagramDrawer with the circuit drawn into it.

        Args:
            use_unicode_characters: Determines if unicode characters are
                allowed (as opposed to ascii-only diagrams).
            qubit_namer: Names qubits in diagram. Defaults to str.
            transpose: Arranges qubit wires vertically instead of horizontally.
            precision: Number of digits to use when representing numbers.
            qubit_order: Determines how qubits are ordered in the diagram.
            get_circuit_diagram_info: Gets circuit diagram info. Defaults to
                protocol with fallback.

        Returns:
            The TextDiagramDrawer instance.
        """
        qubits = ops.QubitOrder.as_qubit_order(qubit_order).order_for(
            self.all_qubits())
        qubit_map = {qubits[i]: i for i in range(len(qubits))}

        if qubit_namer is None:
            qubit_namer = lambda q: str(q) + ('' if transpose else ': ')
        diagram = TextDiagramDrawer()
        for q, i in qubit_map.items():
            diagram.write(0, i, qubit_namer(q))

        moment_groups = []  # type: List[Tuple[int, int]]
        for moment in self._moments:
            _draw_moment_in_diagram(moment,
                                    use_unicode_characters,
                                    qubit_map,
                                    diagram,
                                    precision,
                                    moment_groups,
                                    get_circuit_diagram_info)

        w = diagram.width()
        for i in qubit_map.values():
            diagram.horizontal_line(i, 0, w)

        if moment_groups:
            _draw_moment_groups_in_diagram(moment_groups,
                                           use_unicode_characters,
                                           diagram)

        if transpose:
            diagram = diagram.transpose()

        return diagram