def from_grid_qubit(grid_qubit: cirq.GridQubit) -> 'AspenQubit':
        """Converts `cirq.GridQubit` to `AspenQubit`.

        Returns:
            The equivalent AspenQubit.

        Raises:
            ValueError: GridQubit cannot be converted to AspenQubit.
        """
        if grid_qubit in _grid_qubit_mapping:
            return AspenQubit.from_aspen_index(_grid_qubit_mapping[grid_qubit])
        raise ValueError(f'{grid_qubit} is not convertible to Aspen qubit')
Converts `cirq.GridQubit` to `AspenQubit`.

        Returns:
            The equivalent AspenQubit.

        Raises:
            ValueError: GridQubit cannot be converted to AspenQubit.
        
cirq-rigetti/cirq_rigetti/aspen_device.py