def l2_gram_schmidt(list, lim):
    r = []
    for a in list:
        if r == []:
            v = a
        else:
            v = a - l2_projection(a, r, lim)
        v_norm = l2_norm(v, lim)
        if v_norm == 0:
            raise ValueError("The sequence is not linearly independent.")
        r.append(v/v_norm)
    return r
Orthonormalizes the "list" of functions using the Gram-Schmidt process.
dataset/ETHPy150Open sympy/sympy/examples/advanced/gibbs_phenomenon.py/l2_gram_schmidt