def x(self) -> float:
        """Returns the horizontal position of the qubit, assuming each side of
        the octagon has length 1.

        Returns:
            The horizontal position of the qubit.

        Raises:
            ValueError: Octagon position is invalid.
        """
        if self.octagon_position in {5, 6}:
            return 0
        if self.octagon_position in {4, 7}:
            return 1 / sqrt(2)
        if self.octagon_position in {0, 3}:
            return 1 + 1 / sqrt(2)
        if self.octagon_position in {1, 2}:
            return 1 + sqrt(2)

        raise ValueError(f'invalid octagon position {self.octagon_position}')
Returns the horizontal position of the qubit, assuming each side of
        the octagon has length 1.

        Returns:
            The horizontal position of the qubit.

        Raises:
            ValueError: Octagon position is invalid.
        
cirq-rigetti/cirq_rigetti/aspen_device.py