def width(self) -> int:
        """Determines how many entry columns are in the diagram."""
        max_x = -1.0
        for x, _ in self.entries.keys():
            max_x = max(max_x, x)
        for v in self.vertical_lines:
            max_x = max(max_x, v.x)
        for h in self.horizontal_lines:
            max_x = max(max_x, h.x1, h.x2)
        return 1 + int(max_x)
Determines how many entry columns are in the diagram.
cirq-core/cirq/circuits/text_diagram_drawer.py