def __init__(
        self,
        gates: LogicalGates,
        initial_mapping: LogicalMapping,
        device: cirq.Device | None = None,
    ) -> None:
        """Inits GreedyExecutionStrategy.

        Args:
            gates: The gates to insert.
            initial_mapping: The initial mapping of qubits to logical indices.
            device: The device upon which to execute the strategy.

        Raises:
            NotImplementedError: If not all gates are of the same arity.
        """

        if len(set(len(indices) for indices in gates)) > 1:
            raise NotImplementedError(
                'Can only implement greedy strategy if all gates are of the same arity.'
            )
        self.index_set_to_gates = self.canonicalize_gates(gates)
        self._initial_mapping = initial_mapping.copy()
        self._device = device or devices.UNCONSTRAINED_DEVICE
Inits GreedyExecutionStrategy.

        Args:
            gates: The gates to insert.
            initial_mapping: The initial mapping of qubits to logical indices.
            device: The device upon which to execute the strategy.

        Raises:
            NotImplementedError: If not all gates are of the same arity.
        
cirq-core/cirq/contrib/acquaintance/executor.py