# Transpose vs. Adjoint?

**URL:** https://discourse.julialang.org/t/transpose-vs-adjoint/69445
**Category:** New to Julia
**Created:** [October 8, 2021, 5:10pm UTC](https://discourse.julialang.org/t/transpose-vs-adjoint/69445 "2021-10-08T17:10:15Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![pagalguy](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@pagalguy](https://discourse.julialang.org/u/pagalguy)
#### Post date: [October 8, 2021, 5:10pm UTC](https://discourse.julialang.org/t/transpose-vs-adjoint/69445/1 "2021-10-08T17:10:15Z")

</div>

Why does Julia denotes a matrix/array transpose as adjoint?

```julia
A = [1 2 3 ; 4 5 6] # an array of 2*3
A' # In REPL, it shows as adjoint. Is it correct? Shouldn't it be called TRANSPOSE?

```

![image](https://global.discourse-cdn.com/julialang/original/3X/3/b/3b25728c5fd78baf5a212910102470572cb34431.png)

---

<div class="post-metadata">

### Author: ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)
#### Post date: [October 8, 2021, 5:12pm UTC](https://discourse.julialang.org/t/transpose-vs-adjoint/69445/2 "2021-10-08T17:12:05Z")

</div>

because it is not a transpose, it is an adjoint:

```julia
julia> a = rand(ComplexF64, 2,2)
2×2 Matrix{ComplexF64}:
 0.950914+0.0447945im 0.526487+0.223671im
 0.851739+0.626451im 0.559013+0.522106im

julia> transpose(a)
2×2 transpose(::Matrix{ComplexF64}) with eltype ComplexF64:
 0.950914+0.0447945im 0.851739+0.626451im
 0.526487+0.223671im 0.559013+0.522106im

julia> a'
2×2 adjoint(::Matrix{ComplexF64}) with eltype ComplexF64:
 0.950914-0.0447945im 0.851739-0.626451im
 0.526487-0.223671im 0.559013-0.522106im

```

---

<div class="post-metadata">

### Author: ![Jeff\_Emanuel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeff_emanuel/32/15440_2.png) [@Jeff\_Emanuel](https://discourse.julialang.org/u/Jeff_Emanuel)
#### Post date: [October 8, 2021, 5:13pm UTC](https://discourse.julialang.org/t/transpose-vs-adjoint/69445/3 "2021-10-08T17:13:48Z")

</div>

[Adjugate matrix - Wikipedia](https://en.wikipedia.org/wiki/Adjugate_matrix) Specifically: " today the “adjoint” of a matrix normally refers to its corresponding [adjoint operator](https://en.wikipedia.org/wiki/Hermitian_adjoint), which is its [conjugate transpose](https://en.wikipedia.org/wiki/Conjugate_transpose)."

---

<div class="post-metadata">

### Author: ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)
#### Post date: [October 8, 2021, 8:13pm UTC](https://discourse.julialang.org/t/transpose-vs-adjoint/69445/4 "2021-10-08T20:13:07Z")

</div>

I’m guessing you are coming form Matlab where `A’` means `transpose(A)`. Alas, Julia is not Matlab and is not trying to be Matlab.

---

<div class="post-metadata">

### Author: ![fph](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fph/32/17159_2.png) [@fph](https://discourse.julialang.org/u/fph)
#### Post date: [October 8, 2021, 8:20pm UTC](https://discourse.julialang.org/t/transpose-vs-adjoint/69445/5 "2021-10-08T20:20:02Z")

</div>

> [@Mason](#):
>
> I’m guessing you are coming form Matlab where `A’` means `transpose(A)` . Alas, Julia is not Matlab and is not trying to be Matlab.

Uh? In Matlab `A'` does transpose conjugate. `transpose(A)` or `A.'` does transpose.

---

<div class="post-metadata">

### Author: ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)
#### Post date: [October 8, 2021, 8:43pm UTC](https://discourse.julialang.org/t/transpose-vs-adjoint/69445/6 "2021-10-08T20:43:13Z")

</div>

Huh. My memory has failed me here! It’s been a while since I last used Matlab I guess. Thank you for the correction.

---

<div class="post-metadata">

### Author: ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)
#### Post date: [October 8, 2021, 11:30pm UTC](https://discourse.julialang.org/t/transpose-vs-adjoint/69445/7 "2021-10-08T23:30:34Z")

</div>

`A.’` also used to be transpose in Julia, but was changed on account that it was conflicting with broadcast

---

<div class="post-metadata">

### Author: ![pagalguy](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@pagalguy](https://discourse.julialang.org/u/pagalguy)
#### Post date: [October 9, 2021, 2:10am UTC](https://discourse.julialang.org/t/transpose-vs-adjoint/69445/8 "2021-10-09T02:10:51Z")

</div>

@Mason you are right…I do come from MATLAB background.  
Nevertheless, in Matrix algebra when I studied it, adjoint calculation was fairly complex with calculation of cofactors, while A’ used to be transpose of matrix, which is obtained by transpose(A) in Julia, and by A’ for real numbers. Am I right?  
From matrix algebra point-of-view, adjoint of non-square matrix is not defined, hence the confusion.

---

<div class="post-metadata">

### Author: ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)
#### Post date: [October 9, 2021, 2:22am UTC](https://discourse.julialang.org/t/transpose-vs-adjoint/69445/9 "2021-10-09T02:22:32Z")

</div>

> [@pagalguy](#):
>
> adjoint of non-square matrix is not defined

> **[Conjugate Transpose -- from Wolfram MathWorld](https://mathworld.wolfram.com/ConjugateTranspose.html)**
>
> The conjugate transpose of an m×n matrix A is the n×m matrix defined by A^(H)=A^\_^(T), (1) where A^(T) denotes the transpose of the matrix A and A^\_ denotes the conjugate matrix. In all common spaces (i.e., separable Hilbert spaces), the...

> The conjugate transpose is also known as the adjoint matrix

if you adopt this definition, then you can certainly define adjoint for non-square matrix in a consistent way. Of course, it only has those properties you mentioned when the matrix is square, but that’s fine.

---

<div class="post-metadata">

### Author: ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)
#### Post date: [October 9, 2021, 5:09am UTC](https://discourse.julialang.org/t/transpose-vs-adjoint/69445/10 "2021-10-09T05:09:12Z")

</div>

> [@pagalguy](#):
>
> Nevertheless, in Matrix algebra when I studied it, adjoint calculation was fairly complex with calculation of cofactors

Ah yes. This is a different sense of the word adjoint. It’s slightly overloaded terminology unfortunately. In Julia, `Adjoint` refers to the _Hermitian_ adjoint.

---

<div class="post-metadata">

### Author: ![mschauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mschauer/32/13946_2.png) [@mschauer](https://discourse.julialang.org/u/mschauer)
#### Post date: [October 9, 2021, 10:34am UTC](https://discourse.julialang.org/t/transpose-vs-adjoint/69445/11 "2021-10-09T10:34:06Z")

</div>

If you just have a matrix with real numbers , and you need a transpose, then you can also use A’ (post scriptum for those not familiar with complex numbers)

---

<div class="post-metadata">

### Author: ![zdenek\_hurak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zdenek_hurak/32/53118_2.png) [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)
#### Post date: [October 9, 2021, 12:05pm UTC](https://discourse.julialang.org/t/transpose-vs-adjoint/69445/12 "2021-10-09T12:05:17Z")

</div>

This is obviously some terminological clash. See [Adjoint matrix](https://en.wikipedia.org/wiki/Conjugate_transpose) (also conjugate tranpose or Hermitian adjoint) vs [Adjugate matrix](https://en.wikipedia.org/wiki/Adjugate_matrix)(also classical adjoint or adjunct).

---

<div class="post-metadata">

### Author: ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)
#### Post date: [October 9, 2021, 4:14pm UTC](https://discourse.julialang.org/t/transpose-vs-adjoint/69445/13 "2021-10-09T16:14:23Z")

</div>

I think this should be pointed out more forcefully. For most people, the distinction between adjoint and transpose is moot.

---

<div class="post-metadata">

### Author: ![zdenek\_hurak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zdenek_hurak/32/53118_2.png) [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)
#### Post date: [October 9, 2021, 6:42pm UTC](https://discourse.julialang.org/t/transpose-vs-adjoint/69445/14 "2021-10-09T18:42:24Z")

</div>

Is this also true for those who use complex matrices? 🙂

---

<div class="post-metadata">

### Author: ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)
#### Post date: [October 9, 2021, 7:24pm UTC](https://discourse.julialang.org/t/transpose-vs-adjoint/69445/15 "2021-10-09T19:24:19Z")

</div>

That’s exactly the point! What fraction of people using Julia actually deal with complex numbers? Likely smaller than what you’d think. I’m not advocating that we change anything – certainly we want the definitions to be correct and precise. But we should also be clear that the distinction is only important for a small fraction of users. And that because Julia rocks it should all Just Work regardless.
