# Is it possible for complex matrix multiplication and adjoint speed to catch up with matlab?

**URL:** <https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [October 10, 2023, 5:22am UTC](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785 "2023-10-10T05:22:05Z")\
**Posts on this page:** 19\
**Page:** 2

<div class="post-metadata">

**Author:** ![13299118606](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/13299118606/32/49095_2.png) [@13299118606](https://discourse.julialang.org/u/13299118606)\
**Post date:** [October 10, 2023, 12:36pm UTC](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785/22 "2023-10-10T12:36:04Z")

</div>

Thank you very much. This can indeed solve my problem. The speed is completely acceptable. I hope to add a judgment condition and replace your code in julia complex matrix multiplication in the future.

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [October 10, 2023, 12:43pm UTC](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785/23 "2023-10-10T12:43:06Z")

</div>

> [@13299118606](#):
>
> MKL can speed multiplication, but transposition is a problem.

Transposition is not a problem in Julia. In fact it (or adjont what’s it called for complex) is as fast as it possibly can be, with you getting back a type that didn’t do anything with the actual data, e.g.:

```julia
2×1 adjoint(::Matrix{ComplexF64}) with eltype ComplexF64

```

So it’s the same speed independent of the size of the matrix. I don’t know (but would like) if that’s the case with Matlab too, it’s implementation details are hidden from me. Since the adjoint/transpose isn’t doing “anything” you are shifting around the problem to the multiplication, i.e. to a different complex matrix one (multiple dispatch is your friend and relies on the changed type information). That one should be as fast as Matlab, or arguably could be.

```julia
@btime for j=1:1000
    Y=H'*Omega
end #julia:7.3s matlab:0.35s ！！！

```

Any time you see a divergence with Matlab (or any language; Fortran, C, C++ Rust, Zig), at least this large it should tell you you are doing things wrong. Julia should match or be faster always, or at least within 2x; in some exceptional cases it might still be, I think I know of one such.

Also (while that’s not the reason), it seems pointless for you to have a (for) loop. It may be required for timing in Matlab, I’m not sure, but in Julia that’s one of the points of `@btime` over `@time` (you are just making your benchmarking time 1000x slower, at least potentially(?), I see though here only 4.5x slower, still 1000x more allocations).

About “MKL can speed multiplication”, it did for you, it can but I’m not sure why _exactly_. It’s multithreaded, but so is Julia’s OpenBLAS. You could also use LoopVectorization.jl (or whatever is based on it, rather than your naive implementation) or BLIS.jl. It might be as fast or faster than MKL.

> [@abraemer](#):
>
> This is still not very good benchmarking practice. Please do
> 
> ```julia
> @btime $(H')*$Omega 
> 
> ```

That’s ok and doesn’t require you to put your code in a function.

This gives a very different picture (and 1 extra allocation):

```julia
julia> @time H'*Omega;
  0.025457 seconds (5 allocations: 15.411 MiB, 5.45% gc time)

```

I did try to put into a function:

```julia
julia> test() = H'*Omega

julia> @time test()
  0.012793 seconds (5 allocations: 15.411 MiB)

```

Note, it’s still not good since you’re accessing global variables, and get 1 extra allocation for some reason, as opposed to:

```julia
julia> test(H, Omega) = H'*Omega

julia> @time test(H, Omega); # Beware first run is much slower with 742 allocations, because of compilation
  0.011499 seconds (4 allocations: 15.411 MiB)

I also tried with an anonymous function (timing seems suspect, why doesn't this work?):
julia> @time ()->(H')*Omega
  0.000071 seconds (25 allocations: 1.675 KiB)

julia> @time (H, Omega)->H'*Omega # not accessing globals directly
  0.000055 seconds (25 allocations: 1.700 KiB)
#33 (generic function with 1 method)

And here clearly wrong (way too good to be true, code must be optimized out):
julia> @btime ()->H'*Omega
  1.948 ns (0 allocations: 0 bytes)
#25 (generic function with 1 method)

julia> @btime ()->$H'*$Omega
  3.731 ns (0 allocations: 0 bytes)
#27 (generic function with 1 method)

julia> @btime ()->($H')*$Omega
  3.732 ns (0 allocations: 0 bytes)
#29 (generic function with 1 method)

```

---

<div class="post-metadata">

**Author:** ![13299118606](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/13299118606/32/49095_2.png) [@13299118606](https://discourse.julialang.org/u/13299118606)\
**Post date:** [October 10, 2023, 1:06pm UTC](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785/25 "2023-10-10T13:06:56Z")

</div>

> [@Palli](#):
>
> , it seems pointless for you to have a (for) loop. It may be required for timing in Matlab, I’m not sure

Thank you. I know that “btime” conflicts with “for”. This is for comparison with matlab.

```julia
%maltab code
  tic;for i=1:1000;Y=H'*Omega;end;toc

```

> [@mstewart](#):
>
> ```julia
> using LinearAlgebra.BLAS
> @btime for j=1:1000
> Y = gemm('C', 'N', 1.0+0.0im, H, convert(typeof(H), Omega))
> end
> 
> ```

This scholar has tried a good way to solve it, and the speed is close to the same as other languages ​​(matlab).

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [October 10, 2023, 1:40pm UTC](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785/26 "2023-10-10T13:40:08Z")

</div>

[requesting new method for \* for: (real array)\*(complex array) · Issue #20060 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/20060) discusses this.

---

<div class="post-metadata">

**Author:** ![Syx\_Pek](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/syx_pek/32/6364_2.png) [@Syx\_Pek](https://discourse.julialang.org/u/Syx_Pek)\
**Post date:** [October 10, 2023, 1:40pm UTC](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785/27 "2023-10-10T13:40:10Z")

</div>

> [@Palli](#):
>
> Any time you see a divergence with Matlab (or any language; Fortran, C, C++ Rust, Zig), at least this large it should tell you you are doing things wrong. Julia should match or be faster always, or at least within 2x; in some exceptional cases it might still be, I think I know of one such

There is a performance issue, and as seen by the above it may be a missing method. Either way it is just a starting point of investigation.

> [@Palli](#):
>
> About “MKL can speed multiplication”, it did for you, it can but I’m not sure why _exactly_. It’s multithreaded, but so is Julia’s OpenBLAS. You could also use LoopVectorization.jl (or whatever is based on it, rather than your naive implementation) or BLIS.jl. It might be as fast or faster than MKL.

MKL is fairly optimised on Intel architectures, with a slight speedup over OpenBLAS at times.

> [@Palli](#):
>
> `I also tried with an anonymous function (timing seems suspect, why doesn't this work?):`

The methods below all constuct a function but don’t call it.

> [@Palli](#):
>
> Transposition is not a problem in Julia. In fact it (or adjont what’s it called for complex) is as fast as it possibly can be, with you getting back a type that didn’t do anything with the actual data, e.g.:

This is surely true in the sense that no copying is done, but for instance, we do know that for ordinary arrays, assesing columns first is optimal for cache. The asymmetry might lead to unexpected slowdowns. The only way is to test.

---

<div class="post-metadata">

**Author:** ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Post date:** [October 10, 2023, 2:06pm UTC](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785/28 "2023-10-10T14:06:06Z")

</div>

Just for laughs, Consider trying the calculation in Tullio.

I’m on my phone so can’t easily give an example but the docs should be straightforward to figure it out.

---

<div class="post-metadata">

**Author:** ![mstewart](https://avatars.discourse-cdn.com/v4/letter/m/b5a626/32.png) [@mstewart](https://discourse.julialang.org/u/mstewart)\
**Post date:** [October 10, 2023, 3:48pm UTC](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785/29 "2023-10-10T15:48:55Z")

</div>

Trying `gemm` seemed like a good test, but if you want to use it as a work-around, it seems nicer to use `*` but give it types for which it will use the transposed calls to `gemm`:

```julia
@btime for j=1:1000
  H1, Omega1 = promote(H, Omega)
  Y = H1' * Omega1
end

```

This has essentially the same performance as the call to `gemm` on my machine.

---

<div class="post-metadata">

**Author:** ![dlakelan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlakelan/32/8491_2.png) [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Post date:** [October 10, 2023, 4:02pm UTC](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785/30 "2023-10-10T16:02:41Z")

</div>

On my computer now so:

```julia
using LoopVectorization, Tullio

function adjmul(H,Omega)
    @tullio M[i,j] := conj(H[k,i]) * Omega[k,j]
    return M
end

```

```julia
H=randn(Complex{Float64},1000,1000)
realH=real(H)
Omega=randn(size(H,2),10)
Y=Matrix{Complex}(undef,1000,10);
Y1=similar(Y)

julia> @btime adjmul(H,Omega)
  1.033 ms (51 allocations: 158.83 KiB)

```

For what it’s worth.

---

<div class="post-metadata">

**Author:** ![13299118606](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/13299118606/32/49095_2.png) [@13299118606](https://discourse.julialang.org/u/13299118606)\
**Post date:** [October 11, 2023, 4:40am UTC](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785/31 "2023-10-11T04:40:42Z")

</div>

> [@dlakelan](#):
>
> ` adjmul(H,Omega)`

Thank you very much. I did an experiment and it can increase the speed , but it is still slower than other languages.

```julia
@btime for j=1:1000
           Y = adjmul(H,Omega)
         end #julia:7.3s=>6.3s matlab 0.35s
```

---

<div class="post-metadata">

**Author:** ![albheim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albheim/32/34660_2.png) [@albheim](https://discourse.julialang.org/u/albheim)\
**Post date:** [October 11, 2023, 7:44am UTC](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785/32 "2023-10-11T07:44:00Z")

</div>

So it should probably be fixed by adding a better dispatch as discussed in the github issue linked above, but in the meantime you could try to explicitly convert `Omega` to complex to get a better dispatch. On my machine that + MKL makes it the same speed as Matlab.  
Julia:

```julia-repl
julia> @time for j=1:1000
           Y = H' * Omega
       end
 11.166064 seconds (5.00 k allocations: 15.050 GiB, 9.83% gc time)

julia> @time for j=1:1000
           Y = H' * complex(Omega)
       end
  1.206935 seconds (5.00 k allocations: 305.283 MiB, 0.39% gc time)

```

Matlab:

```matlab
>> tic;for i=1:1000;Y=H'*Omega;end;toc
Elapsed time is 1.173394 seconds.

```

---

<div class="post-metadata">

**Author:** ![13299118606](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/13299118606/32/49095_2.png) [@13299118606](https://discourse.julialang.org/u/13299118606)\
**Post date:** [October 11, 2023, 7:55am UTC](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785/33 "2023-10-11T07:55:33Z")

</div>

Thank you, it is true that converting a complex matrix’ \* real matrix into a complex matrix’ \* complex matrix will speed up. This can also mean that the mechanism did not consider this situation.

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [October 11, 2023, 8:00am UTC](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785/34 "2023-10-11T08:00:04Z")

</div>

> [@13299118606](#):
>
> I know that “btime” conflicts with “for”. This is for comparison with matlab.

In Matlab, you should be using the `timeit` function for more robust performance measurements. It is similar to Julia’s `@btime`.

---

<div class="post-metadata">

**Author:** ![skleinbo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skleinbo/32/36080_2.png) [@skleinbo](https://discourse.julialang.org/u/skleinbo)\
**Post date:** [October 11, 2023, 8:04am UTC](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785/35 "2023-10-11T08:04:03Z")

</div>

I am a bit confused by your benchmark results.

**Disclaimer** , I have never used MATLAB, so it’s entirely possible I am doing something wrong, but this is what I get

```matlab
H = randn(1000,1000,'like',1i);
Omega = randn(1000,10, 'double');

timeit(@() adjmul(H,Omega))
% ~ 2 seconds, i.e. about 2ms per

function [] = adjmul(H,Omega)
  for i = 1:1000
      ctranspose(H)*Omega;
  end
end

```

which is much closer to the naive Julia version

```julia-repl
julia> @benchmark $H'*$Omega samples=1000 evals=1 seconds=20
BenchmarkTools.Trial: 1000 samples with 1 evaluation.
 Range (min … max): 3.588 ms … 5.725 ms ┊ GC (min … max): 0.00% … 0.00%
 Time (median): 3.727 ms ┊ GC (median): 0.00%
 Time (mean ± σ): 3.971 ms ± 398.095 μs ┊ GC (mean ± σ): 6.15% ± 7.69%

    ▂▄█▅▃▁
  ▄▆██████▇▅▃▃▂▂▂▂▂▁▂▁▂▂▁▁▂▁▂▂▁▂▁▁▁▂▃▃▃▃▃▃▃▃▄▄▄▄▅▆▅▄▅▄▄▄▂▃▃▂▂ ▃
  3.59 ms Histogram: frequency by time 4.75 ms <

 Memory estimate: 15.41 MiB, allocs estimate: 4.

```

than what you showed.  
The Tullio version is in fact faster by a factor of two.

```julia-repl
julia> @benchmark adjmul($H,$Omega) samples=1000 evals=1 seconds=20
BenchmarkTools.Trial: 1000 samples with 1 evaluation.
 Range (min … max): 970.667 μs … 4.508 ms ┊ GC (min … max): 0.00% … 72.25%
 Time (median): 1.001 ms ┊ GC (median): 0.00%
 Time (mean ± σ): 1.048 ms ± 207.799 μs ┊ GC (mean ± σ): 0.53% ± 3.16%

  ▅█▆▅▄▂▁
  ███████▅▆▇▄▅▁▄▁▄▅▁▁▄▁▁▁▁▁▁▁▄▁▄▁▄▁▄▁▄▄▁▄▄▁▅▁▄▄▅▅▅▆▆▄▅▅▅▄▁▄▄▁▁▄ █
  971 μs Histogram: log(frequency) by time 1.91 ms <

 Memory estimate: 158.83 KiB, allocs estimate: 51.

```

This is on an Apple M1 running native Julia 1.9.3, and x64 MATLAB R2023b.

Note: Please get in the habit of interpolating variables in benchmark expressions. It doesn’t matter much here, but it can have a tremendous impact.

---

<div class="post-metadata">

**Author:** ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)\
**Post date:** [October 11, 2023, 9:49am UTC](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785/36 "2023-10-11T09:49:39Z")

</div>

> [@skleinbo](#):
>
> ```julia
> function [] = adjmul(H,Omega)
> 
> ```

Excuse me, what is the meaning of the above expression?

---

<div class="post-metadata">

**Author:** ![skleinbo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skleinbo/32/36080_2.png) [@skleinbo](https://discourse.julialang.org/u/skleinbo)\
**Post date:** [October 11, 2023, 9:56am UTC](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785/37 "2023-10-11T09:56:24Z")

</div>

It’s [MATLAB](https://de.mathworks.com/help/matlab/ref/function.html) for declaring a function without outputs. I believe…

---

<div class="post-metadata">

**Author:** ![13299118606](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/13299118606/32/49095_2.png) [@13299118606](https://discourse.julialang.org/u/13299118606)\
**Post date:** [October 11, 2023, 10:11am UTC](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785/38 "2023-10-11T10:11:35Z")

</div>

> [@albheim](#):
>
> ```julia
> tic;for i=1:1000;Y=H'*Omega;end;toc
> Elapsed time is 1.173394 seconds.
> 
> ```

I did not use “timeit” in matlab, but used this command. This was my mistake. This had little impact on the results of this experiment. The results of this scholar were exactly the same as mine. I used julia1.9.2 maltab In 2022b, Windows 64-bit, he solved this problem by promoting the real matrix type to a complex matrix. After testing Tullio, it was indeed 2 times faster than the original one, but it was still not as good as this scholar’s solution. His improvement was nearly 10 times. , and the speed is almost the same as matlab.

---

<div class="post-metadata">

**Author:** ![mstewart](https://avatars.discourse-cdn.com/v4/letter/m/b5a626/32.png) [@mstewart](https://discourse.julialang.org/u/mstewart)\
**Post date:** [October 11, 2023, 11:10am UTC](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785/39 "2023-10-11T11:10:43Z")

</div>

I think the case was considered, but I don’t understand why it works the way it does. The code in question is

```julia
function (*)(A::AdjOrTransStridedMat{<:BlasComplex}, B::StridedMaybeAdjOrTransMat{<:BlasReal})
    TS = promote_type(eltype(A), eltype(B))
    mul!(similar(B, TS, (size(A, 1), size(B, 2))),
         copymutable_oftype(A, TS), # remove AdjOrTrans to use reinterpret trick below
         wrapperop(B)(convert(AbstractArray{real(TS)}, _unwrap(B))))
end

```

The call to `copymutable_oftype` is what is causing the big allocations. The comment suggests this case was done knowingly and for some reason it was seen as preferable to get rid of the adjoint. I’m not sure what the “reinterpret trick” is. But this does seem to result in `*` doing the extra allocation and then resolving eventually to

```julia
 gemm_wrapper!(C, 'N', 'N', A, B, MulAddMul(alpha, beta))

```

which does not seem like the best BLAS call if one matrix is transposed. If both matrices are real you end up with

```julia
 gemm_wrapper!(C, 'T', 'N', A, B, MulAddMul(alpha, beta))

```

which is how I would have expected a (conjugate) transposed matrices to be handled in both the real and complex cases. The only guess I have is that it simplifies some already complicated dispatch, but if that’s it, it seems a little mysterious that the real and complex cases for the transposed/conjugate transposed matrices are handled so differently.

---

<div class="post-metadata">

**Author:** ![jishnub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jishnub/32/33620_2.png) [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Post date:** [October 11, 2023, 11:37am UTC](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785/40 "2023-10-11T11:37:20Z")

</div>

> [@mstewart](#):
>
> the “reinterpret trick”

The trick is to interpret a `n x m` complex `Matrix` as a `2n x m` array of reals, and perform a real \* real matrix multiplication. This trick only works if the first dimension is contiguous, which is why the array is being copied. I think the justification here must have been that copying the array is `O(n^2)` whereas the actual matrix multiplication is approx `O(n^3)`, so the copying step shouldn’t dominate for large `n`. However, clearly it seems to for mid-sized arrays (which one may commonly encounter). The performance of the copying will be improved somewhat by

> <https://github.com/JuliaLang/julia/pull/51650>
>
> \`adjoint!\`/\`transpose!\` operate blockwise, and are usually faster than a linear …\`copyto!\`. We may therefore forward \`copyto!\` to these when copying from an \`Adjoint\`/\`Transpose\`. This is already being done for an out-of-place \`copy\`, and this PR does the same for the in-place \`copyto!\`.
> 
> The difference in performance:
> \`\`\`julia
> julia\> @btime copyto!($(zeros(ComplexF64, 1000, 1000)), $(rand(ComplexF64, 1000, 1000)'));
> 3.540 ms (0 allocations: 0 bytes) # master
> 2.693 ms (0 allocations: 0 bytes) # PR
> \`\`\`

but the alternate approach of `real -> complex` conversion followed by a `complex * complex` matrix multiplication may still be faster, and should be considered here.

The main reason the copying is slow is that copying an adjoint to a `Matrix` is not cache-friendly, whereas converting a real matrix to a complex one is cache-friendly and fast.

---

<div class="post-metadata">

**Author:** ![mstewart](https://avatars.discourse-cdn.com/v4/letter/m/b5a626/32.png) [@mstewart](https://discourse.julialang.org/u/mstewart)\
**Post date:** [October 11, 2023, 12:56pm UTC](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785/41 "2023-10-11T12:56:38Z")

</div>

Thanks. That’s a good explanation. I assumed I knew approximately what would happen when I saw the `gemm_wrapper!` calls and didn’t dig deeply enough to see the calls to `reinterpret`. There’s a lot more going on there than was immediately apparent to me. So I guess there are cases where this is a performance win, especially without the adjoint. Getting some blocking into the copy does seem like it would be a nice improvement.

[Previous page](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785.md?page=1)
