MATLAB: Do I get different results when performing complex number vector multiplication in Matlab R2017b compared to newer releases

MATLAB

I have a complex number vector 'x' and I perform x*x'.
I got different results in R2017b and R2018a.
Below is the sample code:
rng('default')
n=2;
x = rand(n,1)+rand(n,1)*1j;
ret = x*x'
isHermitian = isequal(ret,ret')
In R2017b:
ret =
0.6799 + 0.0000i 0.8540 - 0.6291i
0.8540 + 0.6291i 1.6547 - 0.0000i
isHermitian =
logical
0
In R2018a:
0.6799 + 0.0000i 0.8540 - 0.6291i
0.8540 + 0.6291i 1.6547 + 0.0000i
isHermitian =
logical
1
Why is that?

Best Answer

  • Interleaved complex storage was introduced within recent releases of MATLAB. Hence, MATLAB is able to use many BLAS routines that were not used before.
    In particular, MATLAB R2018a (and latter releases) return Hermitian results. All these changes with affect individual result in the round-off level.