def apply_channel(self, action: Any, axes: Sequence[int]) -> bool:
        """Apply channel to state.

        Args:
            action: The value with a channel to apply.
            axes: The axes on which to apply the channel.
        Returns:
            True if the action succeeded.
        """
        result = protocols.apply_channel(
            action,
            args=protocols.ApplyChannelArgs(
                target_tensor=self._density_matrix,
                out_buffer=self._buffer[0],
                auxiliary_buffer0=self._buffer[1],
                auxiliary_buffer1=self._buffer[2],
                left_axes=axes,
                right_axes=[e + len(self._qid_shape) for e in axes],
            ),
            default=None,
        )
        if result is None:
            return False
        for i in range(len(self._buffer)):
            if result is self._buffer[i]:
                self._buffer[i] = self._density_matrix
        self._density_matrix = result
        return True
Apply channel to state.

        Args:
            action: The value with a channel to apply.
            axes: The axes on which to apply the channel.
        Returns:
            True if the action succeeded.
        
cirq-core/cirq/sim/density_matrix_simulation_state.py