QR decomposition with permutation matrix

Click For Summary
SUMMARY

The discussion centers on the QR decomposition with a permutation matrix, specifically addressing the expressions for the matrix R. The correct formulation is established as \( G_3 \cdot P_1 \cdot G_2 \cdot P_0 \cdot G_1 \cdot A = R \), while the expression \( R = G_3^{-1} P_1 G_2^{-1} P_0 G_1^{-1} A \) is deemed incorrect. The conversation also highlights the distinction between QR and LR decompositions, noting that the resulting matrix Q is not orthogonal in this context.

PREREQUISITES
  • Understanding of QR decomposition and its mathematical representations
  • Familiarity with permutation matrices and their role in matrix operations
  • Knowledge of Gauss elimination method for matrix transformations
  • Basic linear algebra concepts, including matrix multiplication and inverses
NEXT STEPS
  • Study the properties and applications of QR decomposition in numerical analysis
  • Learn about the differences between QR and LR decompositions
  • Explore the role of permutation matrices in optimizing matrix computations
  • Investigate the implications of non-orthogonal matrices in linear algebra
USEFUL FOR

Mathematicians, data scientists, and engineers involved in numerical methods, linear algebra, and matrix computations will benefit from this discussion.

mathmari
Gold Member
MHB
Messages
4,984
Reaction score
7
Hey! :giggle:

At the QR-decomposition with permutation matrix is the matrix $R$ equal to $R=G_3^{-1}P_1G_2^{-1}P_0G_1^{-1}A$ or $G_3P_1G_2P_0G_1A=R$? Which is the correct one? Or are these two equivalent?
In general, it holds that $QR=PA$, right?

:unsure:
 
Last edited by a moderator:
Physics news on Phys.org
mathmari said:
At the QR-decomposition with permutation matrix is the matrix $R$ equal to $R=G_3^{-1}P_1G_2^{-1}P_0G_1^{-1}A$ or $G_3P_1G_2P_0G_1A=R$? Which is the correct one? Or are these two equivalent?
Hey mathmari!

It depends on how we define the $G_i$ and $P_j$ to say which one we should use.
The important part is that we get indeed a right upper matrix when we multiply them.
Other than that, those 2 expressions are equivalent but not the same. 🤔

mathmari said:
In general, it holds that $QR=PA$, right?
According to wiki, we have $QR=AP$. 🤔
 
I have done the following : \begin{align*}\begin{pmatrix}3 & 1 & -3 & 2 \\ -2 & 1 & 0 & 0 \\ 2 & -2 & 4 & 1 \\ 0 & -1 & -1 & 3\end{pmatrix} & \ \overset{Z_2:Z_2+\frac{2}{3}\cdot Z_1}{\longrightarrow} \ \begin{pmatrix}3 & 1 & -3 & 2 \\ 0 & \frac{5}{3} & -2 & \frac{4}{3} \\ 2 & -2 & 4 & 1 \\ 0 & -1 & -1 & 3\end{pmatrix} \\ & \overset{Z_3:Z_3-\frac{2}{3}\cdot Z_1}{\longrightarrow} \begin{pmatrix}3 & 1 & -3 & 2 \\ 0 & \frac{5}{3} & -2 & \frac{4}{3} \\ 0 & -\frac{8}{3} & 6 & -\frac{1}{3} \\ 0 & -1 & -1 & 3\end{pmatrix} \\ & \overset{Z_2\leftrightarrow Z_3}{\longrightarrow} \begin{pmatrix}3 & 1 & -3 & 2 \\ 0 & -\frac{8}{3} & 6 & -\frac{1}{3} \\ 0 & \frac{5}{3} & -2 & \frac{4}{3} \\ 0 & -1 & -1 & 3\end{pmatrix} \\ & \overset{Z_3:Z_3+\frac{5}{8}\cdot Z_2}{\longrightarrow} \begin{pmatrix}3 & 1 & -3 & 2 \\ 0 & -\frac{8}{3} & 6 & -\frac{1}{3} \\ 0 & 0 & \frac{7}{4} & \frac{9}{8}\\ 0 & -1 & -1 & 3\end{pmatrix} \\ & \overset{Z_4:Z_4-\frac{3}{8}\cdot Z_2}{\longrightarrow} \begin{pmatrix}3 & 1 & -3 & 2 \\ 0 & -\frac{8}{3} & 6 & -\frac{1}{3} \\ 0 & 0 & \frac{7}{4} & \frac{9}{8}\\ 0 & 0 & -\frac{13}{4} & \frac{25}{8}\end{pmatrix} \\ & \overset{Z_3 \leftrightarrow Z_4}{\longrightarrow} \begin{pmatrix}3 & 1 & -3 & 2 \\ 0 & -\frac{8}{3} & 6 & -\frac{1}{3} \\ 0 & 0 & -\frac{13}{4} & \frac{25}{8} \\ 0 & 0 & \frac{7}{4} & \frac{9}{8} \end{pmatrix} \\ & \overset{Z_4 : Z_4+\frac{7}{13}\cdot Z_3}{\longrightarrow} \begin{pmatrix}3 & 1 & -3 & 2 \\ 0 & -\frac{8}{3} & 6 & -\frac{1}{3} \\ 0 & 0 & -\frac{13}{4} & \frac{25}{8} \\ 0 & 0 & 0 & \frac{73}{26} \end{pmatrix} \end{align*}
After the Gauss elimination method do we get the matrix $R=G_3^{-1}P_1G_2^{-1}P_0G_1^{-1}A$ : \begin{equation*}R=\begin{pmatrix}3 & 1 & -3 & 2 \\ 0 & -\frac{8}{3} & 6 & -\frac{1}{3} \\ 0 & 0 & -\frac{13}{4} & \frac{25}{8} \\ 0 & 0 & 0 & \frac{73}{26} \end{pmatrix} \approx\begin{pmatrix}3 & 1 & -3 & 2 \\ 0 & -2,6667 & 6 & -0,3333 \\ 0 & 0 & -3,25 & 3,125 \\ 0 & 0 & 0 & 2,8077 \end{pmatrix}\end{equation*}
From the steps of Gauss method we get the matrices \begin{equation*}G_1=\begin{pmatrix}1 & 0 & 0 &0 \\ \frac{2}{3} & 1 & 0 & 0 \\ -\frac{2}{3} & 0 & 1 & 0 \\ 0 & 0 & 0 & 1\end{pmatrix} \ , \ G_2=\begin{pmatrix}1 & 0 & 0 &0 \\ 0 & 1 & 0 & 0 \\ 0 & \frac{5}{8} & 1 & 0 \\ 0 & -\frac{3}{8} & 0 & 1\end{pmatrix} \ \text{ and } \ G_3=\begin{pmatrix}1 & 0 & 0 &0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & \frac{7}{13} & 1\end{pmatrix}\end{equation*}
We have the permutation matrices \begin{equation*}P_0=\begin{pmatrix}1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix} \ \text{ and } \ P_1=\begin{pmatrix}1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{pmatrix}\end{equation*} We have \begin{equation*}P=P_1\cdot P_0=\begin{pmatrix}1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0 \end{pmatrix}\end{equation*}
We have that:
\begin{equation*}G_3\cdot P_1\cdot G_2\cdot P_0\cdot G_1\cdot A = R \Rightarrow A=\left (G_3\cdot P_1\cdot G_2\cdot P_0\cdot G_1\right )^{-1}\cdot R \Rightarrow PA=P\cdot \left (G_3\cdot P_1\cdot G_2\cdot P_0\cdot G_1\right )^{-1}\cdot R\end{equation*} So we have that $PA=QR$ with $Q=P\cdot \left (G_3\cdot P_1\cdot G_2\cdot P_0\cdot G_1\right )^{-1}$.
\begin{align*}Q&=P\cdot \left (G_3\cdot P_1\cdot G_2\cdot P_0\cdot G_1\right )^{-1}=P\cdot G_1^{-1}\cdot P_0^{-1}\cdot G_2^{-1}\cdot P_1^{-1}\cdot G_3^{-1}\\ & = \begin{pmatrix}1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0 \end{pmatrix} \cdot \begin{pmatrix}1 & 0 & 0 &0 \\ -\frac{2}{3} & 1 & 0 & 0 \\ \frac{2}{3} & 0 & 1 & 0 \\ 0 & 0 & 0 & 1\end{pmatrix} \cdot \begin{pmatrix}1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix}\cdot \begin{pmatrix}1 & 0 & 0 &0 \\ 0 & 1 & 0 & 0 \\ 0 & -\frac{5}{8} & 1 & 0 \\ 0 & \frac{3}{8} & 0 & 1\end{pmatrix}\cdot \begin{pmatrix}1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{pmatrix}\cdot \begin{pmatrix}1 & 0 & 0 &0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & -\frac{7}{13} & 1\end{pmatrix} \\ & = \begin{pmatrix}1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0 \end{pmatrix} \cdot \begin{pmatrix}1 & 0 & 0 &0 \\ -\frac{2}{3} & 1 & 0 & 0 \\ \frac{2}{3} & 0 & 1 & 0 \\ 0 & 0 & 0 & 1\end{pmatrix} \cdot \begin{pmatrix}1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix}\cdot \begin{pmatrix}1 & 0 & 0 &0 \\ 0 & 1 & 0 & 0 \\ 0 & -\frac{5}{8} & 1 & 0 \\ 0 & \frac{3}{8} & 0 & 1\end{pmatrix}\cdot \begin{pmatrix}1 & 0 & 0 &0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & -\frac{7}{13} & 1 \\ 0 & 0 & 1 & 0\end{pmatrix} \\ & = \begin{pmatrix}1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0 \end{pmatrix} \cdot \begin{pmatrix}1 & 0 & 0 &0 \\ -\frac{2}{3} & 1 & 0 & 0 \\ \frac{2}{3} & 0 & 1 & 0 \\ 0 & 0 & 0 & 1\end{pmatrix} \cdot \begin{pmatrix}1 & 0 & 0 &0 \\ 0 & -\frac{5}{8} & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & \frac{3}{8} & 0 & 1\end{pmatrix}\cdot \begin{pmatrix}1 & 0 & 0 &0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & -\frac{7}{13} & 1 \\ 0 & 0 & 1 & 0\end{pmatrix} \\ & = \begin{pmatrix}1 & 0 & 0 &0 \\ \frac{2}{3} & 0 & 1 & 0 \\ 0 & 0 & 0 & 1
\\ -\frac{2}{3} & 1 & 0 & 0\end{pmatrix} \cdot \begin{pmatrix}1 & 0 & 0 &0 \\ 0 & -\frac{5}{8} & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & \frac{3}{8} & 0 & 1\end{pmatrix}\cdot \begin{pmatrix}1 & 0 & 0 &0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & -\frac{7}{13} & 1 \\ 0 & 0 & 1 & 0\end{pmatrix} \\ & = \begin{pmatrix}1 & 0 & 0 &0 \\ \frac{2}{3} & 1 & 0 & 0 \\ 0 & \frac{3}{8} & 0 & 1
\\ -\frac{2}{3} & -\frac{5}{8} & 1 & 0\end{pmatrix} \cdot \begin{pmatrix}1 & 0 & 0 &0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & -\frac{7}{13} & 1 \\ 0 & 0 & 1 & 0\end{pmatrix} \\ & = \begin{pmatrix}1 & 0 & 0 &0 \\ \frac{2}{3} & 1 & 0 & 0 \\ 0 & \frac{3}{8} & 1 & 0
\\ -\frac{2}{3} & -\frac{5}{8} & -\frac{7}{13} & 1\end{pmatrix} \\ & \approx \begin{pmatrix}1 & 0 & 0 &0 \\ 0,6667 & 1 & 0 & 0 \\ 0 & 0,375 & 1 & 0
\\ -0,6667 & -0,625 & -0,5385 & 1\end{pmatrix} \end{align*} Which of the expressions of #1 is the correct one? :unsure:
 
mathmari said:
Which of the expressions of #1 is the correct one?

You have defined the matrices $G_i$ and $P_j$ such that $G_3\cdot P_1\cdot G_2\cdot P_0\cdot G_1\cdot A = R$ haven't you? 🤔
So that is the correct expression.
What were you uncertain about? (Wondering)

However, didn't you do an LR-decomposition with permutation rather than a QR-decomposition? :unsure:
Note that the resulting $Q$ is not orthogonal.
 
Last edited:
Klaas van Aarsen said:
You have defined the matrices $G_i$ and $P_j$ such that $G_3\cdot P_1\cdot G_2\cdot P_0\cdot G_1\cdot A = R$ haven't you? 🤔
So that is the correct expression.
What were you uncertain about? (Wondering)

So the expression $R=G_3^{-1}P_1G_2^{-1}P_0G_1^{-1}A$ is wrong, isn't it? :unsure:
Klaas van Aarsen said:
However, didn't you do an LR-decomposition with permutation rather than a QR-decomposition? :unsure:
Note that the resulting $Q$ is not orthogonal.

Ah yes, it is the LR-decomposition. (Malthe)
 
mathmari said:
So the expression $R=G_3^{-1}P_1G_2^{-1}P_0G_1^{-1}A$ is wrong, isn't it?

It looks wrong to me yes. :unsure:
 
Klaas van Aarsen said:
It looks wrong to me yes. :unsure:

Ok! Thanks! :geek:
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 22 ·
Replies
22
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 8 ·
Replies
8
Views
1K
  • · Replies 28 ·
Replies
28
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 13 ·
Replies
13
Views
4K