def validate_operation(self, operation: 'cirq.Operation') -> None:
        """Raises an exception if an operation does not satisfy the topological constraints
        of the device.

        Note, in case the operation is invalid, you can still use the Quil
        compiler to rewire qubits and decompose the operation to this device's
        topology.

        Additionally, this method will not attempt to decompose the operation into this
        device's native gate set. This integration, by default, uses the Quil
        compiler to do so.

        Please see the Quil Compiler
        [documentation](https://pyquil-docs.rigetti.com/en/stable/compiler.html)
        for more information.

        Args:
            operation: The operation to validate.

        Raises:
            UnsupportedRigettiQCSOperation: The operation isn't valid for this device.
        """
        qubits = operation.qubits
        for qubit in qubits:
            self.validate_qubit(qubit)
        if len(qubits) == 2:
            i = self._aspen_qubit_index(qubits[0])
            j = self._aspen_qubit_index(qubits[1])
            if j not in self.qubit_topology[i]:
                raise UnsupportedRigettiQCSOperation(
                    f'qubits {qubits[0]} and {qubits[1]} do not share an edge'
                )
Raises an exception if an operation does not satisfy the topological constraints
        of the device.

        Note, in case the operation is invalid, you can still use the Quil
        compiler to rewire qubits and decompose the operation to this device's
        topology.

        Additionally, this method will not attempt to decompose the operation into this
        device's native gate set. This integration, by default, uses the Quil
        compiler to do so.

        Please see the Quil Compiler
        [documentation](https://pyquil-docs.rigetti.com/en/stable/compiler.html)
        for more information.

        Args:
            operation: The operation to validate.

        Raises:
            UnsupportedRigettiQCSOperation: The operation isn't valid for this device.
        
cirq-rigetti/cirq_rigetti/aspen_device.py