Skip to content

Difference between Mac and Linux for 2x2 non-symmetric matrices with real eigenvalues #1140

@DavidMeadon

Description

@DavidMeadon

There seems to be some difference between Mac and Linux for non-symmetric matrices with real eigenvalues:

# Mac
julia> A = [3 1; -1 5]
2×2 Matrix{Int64}:
  3  1
 -1  5

julia> eigen(A)
Eigen{ComplexF64, ComplexF64, Matrix{ComplexF64}, Vector{ComplexF64}}
values:
2-element Vector{ComplexF64}:
 4.0 - 9.009566630008139e-9im
 4.0 + 9.009566630008139e-9im
vectors:
2×2 Matrix{ComplexF64}:
 0.707107-0.0im         0.707107+0.0im
 0.707107-6.37073e-9im  0.707107+6.37073e-9im

julia> versioninfo()
Julia Version 1.11.2
Commit 5e9a32e7af2 (2024-12-01 20:02 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin24.0.0)
  CPU: 12 × Apple M2 Pro
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, apple-m2)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)

# Linux
julia> A = [3 1; -1 5]
2×2 Matrix{Int64}:
  3  1
 -1  5

julia> eigen(A)
Eigen{Float64, Float64, Matrix{Float64}, Vector{Float64}}
values:
2-element Vector{Float64}:
 4.0
 4.0
vectors:
2×2 Matrix{Float64}:
 0.707107  -0.707107
 0.707107  -0.707107

julia> versioninfo()
Julia Version 1.11.2
Commit 5e9a32e7af2 (2024-12-01 20:02 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 64 × AMD EPYC 7502P 32-Core Processor
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, znver2)
Threads: 1 default, 0 interactive, 1 GC (on 64 virtual cores)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions