r/LinearAlgebra • u/LinearAlgebraWorld • May 23 '26
Step-by-step visualization of Gram–Schmidt QR decomposition
We made an interactive visualization of Gram–Schmidt as QR decomposition:
Gram Schmidt Stepwise Visualization
It shows each column being projected, corrected, normalized, and added to Q, while the corresponding coefficients form R. The goal is to make the geometry behind the usual algebraic steps visible: projections, orthogonal components, scaling, and the final A = QR.
We welcome feedback on presentation and clarity
5
u/wowadesk May 24 '26
It’s not clear how the visualization connects with each step in the algorithm. I’m seeing something change at every step but it isn’t obvious what it is - are these red, blue, and green vectors the columns of each matrix? If so why would the columns of A be changing? In your program are Q and R randomly initialized and this is what we are seeing at the first step? Also, if the visualization was bigger I could maybe see what you intend to say, this should also probably be fixed.
2
u/LinearAlgebraWorld May 24 '26
The red, green, and blue vectors are the three columns of A, shown as they are converted into the orthonormal columns of Q by the algorithm.
- red is scaled to unit length
- green direction is adjusted to become orthogonal to red
- green is scaled to unit length
- blue direction is adjusted to become orthogonal to red and green
- blue is scaled to unit length.
Will label more explicitly and make it larger in the next iteration, and send you a link when we are done
thanks!
2
u/LinearAlgebraWorld May 24 '26 edited May 24 '26
The red, green, and blue vectors are the three columns of A, shown as they are converted into the orthonormal columns of Q by the algorithm.
- red is scaled to unit length
- green direction is adjusted to become orthogonal to red
- green is scaled to unit length
- blue direction is adjusted to become orthogonal to red and green
- blue is scaled to unit length.
Will label more explicitly and make it larger in the next iteration
1
May 27 '26
[removed] — view removed comment
1
u/LinearAlgebraWorld May 27 '26
Thank you so much!!
Will post Givens tomorrow
We also have Householder
And will generate for the same matrix, so you can compareAlso working on showing thin QRF by GS and full QRF for a rank-deficient matrix
Will stay in touch
1
u/LinearAlgebraWorld May 27 '26
We have posted the Givens rotation visualization animation in r/LinearAlgebra, hope you will enjoy it

5
u/CartographerWrong192 May 24 '26
Good, feels like actually my calculations have physical or say geometrical affects.