pythonnumpymathmatrix-factorization

What does the mode 'reduced' in numpy.linalg.rq do?


In the numpy documentation for the qr factorization (https://numpy.org/doc/stable/reference/generated/numpy.linalg.qr.html), the default mode is 'reduced'. I know the theory of the 'complete' mode and expected it to be the default. What does the mode 'reduced' mean mathematically?

I could not find any information about that in the documentation.


Solution

  • Let's summarize the answer given by @stéphane-laurent, so people can find the results more easily:

    Let A \in \mathbb{K}^{m \times n}, the QR-decomposition is defined as A=QR.
    If m>n, the values of Q can be dropped, because the last m-n rows of R are zero. I.e. we multiply the last m-n columns of Q with zeros. Therefore, we can just drop these columns to get the same result. In order for the dimensions to work out, we also need to remove the rows that are zero (i.e. the last m-n rows) of R.
    We end up with A=QR, where qdim and rdim.