def getStateLabelsFromLineNo(line_no, n):
    """ Gets the indeces for labelling rho [i, j] from the line number of an array.
    
    Parameters:
        line_no (int): line number of an array e.g. position of a row in a matrix or column in rho_t
        n: the number of states in the system
    
    Returns:
        tuple: A tuple of the indeces for the matrix position
    """
    
    division = int((line_no + 1)/n)  # Gives label i
    remainder = (line_no + 1)%n  # Gives label j
    if (remainder == 0):
        i = division
        j = n
    else:
        i = (division+1)
        j = remainder
    return (i,j)