def n_states_of_vec(l, nval):
    """ Returns the amount of different states a vector of length 'l' can be
        in, given that each index can be in 'nval' different configurations.
    """
    if type(l) != int or type(nval) != int or l < 1 or nval < 1:
        raise ValueError("Both arguments must be positive integers.")
    return nval ** l