def _kraus_(self) -> Sequence[np.ndarray]:
        r"""Returns Kraus representation of self.

        The method computes a Kraus representation of self from Kraus representations of its
        constituent operations by taking the tensor product of Kraus operators along all paths
        corresponding to the possible choices of the Kraus operators of the operations. More
        precisely, it computes all terms in the expression

        $$
        \sum_{i_1} \sum_{i_2} \dots \sum_{i_m} \bigotimes_{k=1}^m K_{k,i_k}
        $$

        where $K_{k,j}$ is the jth Kraus operator of the kth operation in self. Each term becomes
        an element in the sequence returned by this method.

        Args:
            self: This Moment.
        Returns:
            A Kraus representation of self if `self._has_kraus_()` is True else `NotImplemented`.
        """
        if not self._has_kraus_():
            return NotImplemented

        qubits = sorted(self._qubit_to_op)
        n = len(qubits)
        if n < 1:
            return (np.array([[1 + 0j]]),)

        qubit_to_row_subscript = dict(zip(qubits, 'abcdefghij'))
        qubit_to_col_subscript = dict(zip(qubits, 'ABCDEFGHIJ'))

        def row_subscripts(qs: Sequence[cirq.Qid]) -> str:
            return ''.join(qubit_to_row_subscript[q] for q in qs)

        def col_subscripts(qs: Sequence[cirq.Qid]) -> str:
            return ''.join(qubit_to_col_subscript[q] for q in qs)

        def kraus_tensors(op: cirq.Operation) -> Sequence[np.ndarray]:
            return tuple(np.reshape(k, (2, 2) * len(op.qubits)) for k in protocols.kraus(op))

        input_subscripts = ','.join(
            row_subscripts(op.qubits) + col_subscripts(op.qubits) for op in self.operations
        )
        output_subscripts = row_subscripts(qubits) + col_subscripts(qubits)
        assert len(input_subscripts) == 2 * n + len(self.operations) - 1
        assert len(output_subscripts) == 2 * n

        transpose = input_subscripts + '->' + output_subscripts

        r = []
        d = 2**n
        kss = [kraus_tensors(op) for op in self.operations]
        for ks in itertools.product(*kss):
            k = np.einsum(transpose, *ks)
            r.append(np.reshape(k, (d, d)))
        return r
Returns Kraus representation of self.

        The method computes a Kraus representation of self from Kraus representations of its
        constituent operations by taking the tensor product of Kraus operators along all paths
        corresponding to the possible choices of the Kraus operators of the operations. More
        precisely, it computes all terms in the expression

        $$
        \sum_{i_1} \sum_{i_2} \dots \sum_{i_m} \bigotimes_{k=1}^m K_{k,i_k}
        $$

        where $K_{k,j}$ is the jth Kraus operator of the kth operation in self. Each term becomes
        an element in the sequence returned by this method.

        Args:
            self: This Moment.
        Returns:
            A Kraus representation of self if `self._has_kraus_()` is True else `NotImplemented`.
        
cirq-core/cirq/circuits/moment.py