1 | initial version |
A=matrix(QQ,
[[ 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0],
[-1/2, 0, 0, -1/2, 0, 0, 1, 0, 0, 0, 0, 0],
[-1/2, -1, 0, 1/2, 0, 0, 0, 1, 0, 0, 0, 0],
[-1/2, 0, 0, -1/2, 0, 0, 0, 0, 0, 1, 0, 0],
[ 1/2, -1, 0, -1/2, 0, 0, 0, 0, 0, 0, 1, 0],
[ 0, 0, -1, 0, 0, -1, 0, 0, 1, 0, 0, 1]])
G, M = A.gram_schmidt() # no normalization in G
g=G*G.transpose()
gsqrt=g.apply_map(sqrt)
q=gsqrt.inverse()
Gr=q*G # Gr is the orthonormal version of G
print Gr*Gr.transpose() # check the orthonormality of Gr
print (M*gsqrt)*Gr==A # check if A=(M*gsqrt)*Gr