def transpose(self) -> cirq.TextDiagramDrawer:
        """Returns the same diagram, but mirrored across its diagonal."""
        out = TextDiagramDrawer()
        out.entries = {
            (y, x): _DiagramText(v.transposed_text, v.text) for (x, y), v in self.entries.items()
        }
        out.vertical_lines = [_VerticalLine(*e) for e in self.horizontal_lines]
        out.horizontal_lines = [_HorizontalLine(*e) for e in self.vertical_lines]
        out.vertical_padding = self.horizontal_padding.copy()
        out.horizontal_padding = self.vertical_padding.copy()
        return out
Returns the same diagram, but mirrored across its diagonal.
cirq-core/cirq/circuits/text_diagram_drawer.py