(vlist, orthog=False)
return out
Apply the Gram-Schmidt process to a set of vectors.

    see: http://en.wikipedia.org/wiki/Gram%E2%80%93Schmidt_process
Apply the Gram-Schmidt process to a set of vectors.
Apply the Gram - Schmidt process to a set of vectors .
def GramSchmidt(vlist, orthog=False):
    """
    Apply the Gram-Schmidt process to a set of vectors.

    see: http://en.wikipedia.org/wiki/Gram%E2%80%93Schmidt_process
    """
    out = []
    m = len(vlist)
    for i in range(m):
        tmp = vlist[i]
        for j in range(i):
            tmp -= vlist[i].project(out[j])
        if not tmp.values():
            raise ValueError(
                "GramSchmidt: vector set not linearly independent")
        out.append(tmp)
    if orthog:
        for i in range(len(out)):
            out[i] = out[i].normalized()
    return out
def GramSchmidt ( vlist , orthog = False ) : out = [ ] m = len ( vlist ) for i in range ( m ) : tmp = vlist [ i ] for j in range ( i ) : tmp -= vlist [ i ] . project ( out [ j ] ) if not tmp . values ( ) : raise ValueError ( "GramSchmidt: vector set not linearly independent" ) out . append ( tmp ) if orthog : for i in range ( len ( out ) ) : out [ i ] = out [ i ] . normalized ( ) return out