title: Different QR decomposition results with numpy and CULA
body: <p>I'm performing QR decomposition in two different ways: using standard numpy method and using GEQRF LAPACK function implemented in CULA library. Here is simple example in python (PyCULA used to access CULA):</p>
  
  <pre><code>from PyCULA.cula import culaInitialize,culaShutdown
  from PyCULA.cula import gpu_geqrf, gpu_orgqr
  
  import numpy as np
  import sys
  
  def test_numpy(A):
      Q, R = np.linalg.qr(A)
      print "Q"
      print Q
      print "R"
      print R
      print "transpose(Q)*Q"
      print np.dot(np.transpose(Q), Q)
      print "Q*R"
      print np.dot(Q,R)
  
  def test_cula(A):
      culaInitialize()
      QR, TAU = gpu_geqrf(A)
      R = np.triu(QR)
      Q = gpu_orgqr(QR, A.shape[0], TAU)
      culaShutdown()
      print "Q"
      print Q
      print "R"
      print R
      print "transpose(Q)*Q"
      print np.dot(np.transpose(Q), Q)
      print "Q*R"
      print np.dot(Q,R)
  
  def main():
      rows = int(sys.argv[1])
      cols = int(sys.argv[2])
      A = np.array(np.ones((rows,cols)).astype(np.float64))
      print "A"
      print A
      print "NUMPY"
      test_numpy(A.copy())
      print "CULA"
      test_cula(A.copy())
  
  if __name__ == '__main__':
      main()
  </code></pre>
  
  <p>It produces following output:</p>
  
  <pre><code>A
  [[ 1.  1.  1.]
   [ 1.  1.  1.]
   [ 1.  1.  1.]]
  NUMPY
  Q
  [[-0.57735027 -0.57735027 -0.57735027]
   [-0.57735027  0.78867513 -0.21132487]
   [-0.57735027 -0.21132487  0.78867513]]
  R
  [[-1.73205081 -1.73205081 -1.73205081]
   [ 0.          0.          0.        ]
   [ 0.          0.          0.        ]]
  transpose(Q)*Q
  [[  1.00000000e+00   2.77555756e-17   0.00000000e+00]
   [  2.77555756e-17   1.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   1.00000000e+00]]
  Q*R
  [[ 1.  1.  1.]
   [ 1.  1.  1.]
   [ 1.  1.  1.]]
  CULA
  Q
  [[-0.57735027 -0.57735027 -0.57735027]
   [-0.57735027  0.78867513 -0.21132487]
   [-0.57735027 -0.21132487  0.78867513]]
  R
  [[-1.73205081  0.3660254   0.3660254 ]
   [-0.          0.          0.        ]
   [-0.          0.          0.        ]]
  transpose(Q)*Q
  [[  1.00000000e+00   2.77555756e-17   0.00000000e+00]
   [  2.77555756e-17   1.00000000e+00   0.00000000e+00]
   [  0.00000000e+00   0.00000000e+00   1.00000000e+00]]
  Q*R
  [[ 1.         -0.21132487 -0.21132487]
   [ 1.         -0.21132487 -0.21132487]
   [ 1.         -0.21132487 -0.21132487]]
  </code></pre>
  
  <p>What is wrong with my code?</p>