from typing import List
from typing import Tuple


def get_index_tuple_from_kraus_matrices_indices(
    index: int, indices: List[int]
) -> Tuple[int, int]:
    """Get index i, j of Instrument object from a list of numbers corresponding to matrices of Kraus operators.

    Parameters
    ----------
    index: int
        Index of the matrix in a list of matrices of Kraus operators.

    indices: List[int]
        List of numbers of matrices per Kraus operator.

    Returns
    -------
    Tuple[int, int]
        returns (i, j) meaning that j-th matrix of i-th Kraus operator.
    """
    sum = 0
    for j, num in enumerate(indices):
        sum += num
        if index < sum:
            return (j, num + index - sum)
    assert index < sum
    return (len(indices) - 1, sum - index)