# Matrix operations not symmetric

**URL:** <https://discourse.julialang.org/t/matrix-operations-not-symmetric/69244>\
**Category:** Internals & Design\
**Tags:** linearalgebra\
**Created:** [October 5, 2021, 5:00pm UTC](https://discourse.julialang.org/t/matrix-operations-not-symmetric/69244 "2021-10-05T17:00:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![A\_C](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@A\_C](https://discourse.julialang.org/u/A_C)\
**Post date:** [October 5, 2021, 5:00pm UTC](https://discourse.julialang.org/t/matrix-operations-not-symmetric/69244/1 "2021-10-05T17:00:40Z")

</div>

Hi. I am relatively new to Julia. Suppose I have a matrix A and I write ` v = A[:, 1]`. Now `v` is a vector as expected. But `u = A[1, :]` is a vector again (I expected `u` to be adjoint instead of vector).

What would the problems be `u` were an adjoint instead of being vector? I have gone through the thread [Issue 4774](https://github.com/JuliaLang/julia/issues/4774) but did not understand the reason for this unsymmetrical behavior.

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [October 5, 2021, 10:04pm UTC](https://discourse.julialang.org/t/matrix-operations-not-symmetric/69244/2 "2021-10-05T22:04:00Z")

</div>

This talk might be helpful:

[![](https://global.discourse-cdn.com/julialang/original/3X/e/5/e55a2a411b08eba0d6e2cdb7b9392b0f4a8a5eee.jpeg "JuliaCon 2017 | Taking Vector Transposes Seriously | Jiahao Chen") ](https://www.youtube.com/watch?v=C2RO34b_oPM)

---

<div class="post-metadata">

**Author:** ![A\_C](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@A\_C](https://discourse.julialang.org/u/A_C)\
**Post date:** [October 6, 2021, 5:33am UTC](https://discourse.julialang.org/t/matrix-operations-not-symmetric/69244/3 "2021-10-06T05:33:21Z")

</div>

Thank you for the link to the talk. It is a very nice talk and I had watched it earlier. I watched it again to see if I had missed something. The summary of the talk is that  
one requires four objects

1. Scalars
2. Column vector
3. Row Vector
4. Matrices

to implement householder notation. Please correct me if I am wrong in understanding this.

However, the talk does not answer as to why `v = A[:, 1]` is a column vector  
whereas `u = A[1, :]` is not a row vector. So things are not symmetrical and  
row vectors are not treated on par with column vectors.

In my opinion `u` being a row vector is more natural. So, my question is what  
problems would occur if u was a row vector (`LinearAlgebra.Adjoint`) instead of column vector (`Vector`).

---

<div class="post-metadata">

**Author:** ![simeonschaub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simeonschaub/32/216566_2.png) [@simeonschaub](https://discourse.julialang.org/u/simeonschaub)\
**Post date:** [October 6, 2021, 5:42am UTC](https://discourse.julialang.org/t/matrix-operations-not-symmetric/69244/4 "2021-10-06T05:42:37Z")

</div>

This has already been discussed multiple times in this forum. See [Indexing into Matrix](https://discourse.julialang.org/t/indexing-into-matrix/45806) for example and the linked post within.

---

<div class="post-metadata">

**Author:** ![A\_C](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@A\_C](https://discourse.julialang.org/u/A_C)\
**Post date:** [October 6, 2021, 6:21am UTC](https://discourse.julialang.org/t/matrix-operations-not-symmetric/69244/5 "2021-10-06T06:21:14Z")

</div>

Thank you for pointing to the discussion. From comment of [lucas711642](https://discourse.julialang.org/t/indexing-into-matrix/45806) I understand that the reason for this behavior is that `A[1,:]` being an adjoint does not generalize to multidimensional arrays with dimension greater than 2.
