def __new__(cls, x: int, dimension: int) -> cirq.LineQid:
        """Initializes a line qid at the given x coordinate.

        Args:
            x: The x coordinate.
            dimension: The dimension of the qid's Hilbert space, i.e.
                the number of quantum levels.
        """
        dimension = int(dimension)
        key = (x, dimension)
        inst = cls._cache.get(key)
        if inst is None:
            cls.validate_dimension(dimension)
            inst = super().__new__(cls)
            inst._x = x
            inst._dimension = dimension
            inst._hash = (dimension - 2) * 1_000_003 + hash(x)
            cls._cache[key] = inst
        return inst
Initializes a line qid at the given x coordinate.

        Args:
            x: The x coordinate.
            dimension: The dimension of the qid's Hilbert space, i.e.
                the number of quantum levels.
        
cirq-core/cirq/devices/line_qubit.py