House hold problem

1914 days ago by bigdata2016

 
       
A = matrix(QQ, [[1, 2, 1, 2],[0, 1, 2, 1],[2, 0, 0, 1],[1, 0, 1, 2]]) show(A) 
       
A = matrix(QQbar, 2,2, [2,1,1,1]) A.gram_schmidt() 
       
([   2    1]
[-1/5  2/5], [  1   0]
[3/5   1])
([   2    1]
[-1/5  2/5], [  1   0]
[3/5   1])
A.gram_schmidt(orthonormal=True) 
       
([ 0.8944271909999159?  0.4472135954999580?]
[-0.4472135954999580?  0.8944271909999159?], [ 2.236067977499790?       
0]
[ 1.341640786499874? 0.4472135954999580?])
([ 0.8944271909999159?  0.4472135954999580?]
[-0.4472135954999580?  0.8944271909999159?], [ 2.236067977499790?                   0]
[ 1.341640786499874? 0.4472135954999580?])
A.QR() 
       
([ 0.8944271909999159? -0.4472135954999580?]
[ 0.4472135954999580?  0.8944271909999159?], [ 2.236067977499790? 
1.341640786499874?]
[                  0 0.4472135954999580?])
([ 0.8944271909999159? -0.4472135954999580?]
[ 0.4472135954999580?  0.8944271909999159?], [ 2.236067977499790?  1.341640786499874?]
[                  0 0.4472135954999580?])
A.transpose()*A 
       
[5 3]
[3 2]
[5 3]
[3 2]