Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eigen(nda) eigvals(nda), and Xdet(nda) are broken #206

Closed
mzgubic opened this issue Aug 12, 2022 · 0 comments · Fixed by #207
Closed

eigen(nda) eigvals(nda), and Xdet(nda) are broken #206

mzgubic opened this issue Aug 12, 2022 · 0 comments · Fixed by #207
Labels
bug Something isn't working

Comments

@mzgubic
Copy link
Collaborator

mzgubic commented Aug 12, 2022

julia> A = rand(4, 4);

julia> corr = A * A';

julia> nda = NamedDimsArray{(:a, :a)}(corr);

julia> eigen(nda)
ERROR: MethodError: no method matching eigen!(::NamedDimsArray{(:a, :a), Float64, 2, Matrix{Float64}}; permute=true, scale=true, sortby=LinearAlgebra.eigsortby)
Closest candidates are:
  eigen!(::SymTridiagonal{var"#s859", V} where {var"#s859"<:Union{Float32, Float64}, V<:AbstractVector{var"#s859"}}) at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/LinearAlgebra/src/tridiag.jl:284 got unsupported keyword arguments "permute", "scale", "sortby"
  eigen!(::SymTridiagonal{var"#s859", V} where {var"#s859"<:Union{Float32, Float64}, V<:AbstractVector{var"#s859"}}, ::UnitRange) at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/LinearAlgebra/src/tridiag.jl:287 got unsupported keyword arguments "permute", "scale", "sortby"
  eigen!(::SymTridiagonal{var"#s859", V} where {var"#s859"<:Union{Float32, Float64}, V<:AbstractVector{var"#s859"}}, ::Real, ::Real) at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/LinearAlgebra/src/tridiag.jl:292 got unsupported keyword arguments "permute", "scale", "sortby"
  ...
Stacktrace:
 [1] eigen(A::NamedDimsArray{(:a, :a), Float64, 2, Matrix{Float64}}; permute::Bool, scale::Bool, sortby::typeof(LinearAlgebra.eigsortby))
   @ LinearAlgebra /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/LinearAlgebra/src/eigen.jl:237
 [2] eigen(A::NamedDimsArray{(:a, :a), Float64, 2, Matrix{Float64}})
   @ LinearAlgebra /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/LinearAlgebra/src/eigen.jl:235
 [3] top-level scope
   @ REPL[35]:1

julia> det(nda)
ERROR: MethodError: no method matching logabsdet(::NamedDims.NamedFactorization{(:a, :a), Float64, LU{Float64, Matrix{Float64}}})
Closest candidates are:
  logabsdet(::SymTridiagonal; shift) at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/LinearAlgebra/src/tridiag.jl:446
  logabsdet(::UnitUpperTriangular{T, S} where S<:AbstractMatrix{T}) where T at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/LinearAlgebra/src/triangular.jl:2545
  logabsdet(::UnitLowerTriangular{T, S} where S<:AbstractMatrix{T}) where T at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/LinearAlgebra/src/triangular.jl:2546
  ...
Stacktrace:
 [1] det(F::NamedDims.NamedFactorization{(:a, :a), Float64, LU{Float64, Matrix{Float64}}})
   @ LinearAlgebra /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/LinearAlgebra/src/factorization.jl:51
 [2] det(A::NamedDimsArray{(:a, :a), Float64, 2, Matrix{Float64}})
   @ LinearAlgebra /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/LinearAlgebra/src/generic.jl:1557
 [3] top-level scope
   @ REPL[36]:1

julia> logdet(nda)
ERROR: MethodError: no method matching logabsdet(::NamedDims.NamedFactorization{(:a, :a), Float64, LU{Float64, Matrix{Float64}}})
Closest candidates are:
  logabsdet(::SymTridiagonal; shift) at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/LinearAlgebra/src/tridiag.jl:446
  logabsdet(::UnitUpperTriangular{T, S} where S<:AbstractMatrix{T}) where T at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/LinearAlgebra/src/triangular.jl:2545
  logabsdet(::UnitLowerTriangular{T, S} where S<:AbstractMatrix{T}) where T at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/LinearAlgebra/src/triangular.jl:2546
  ...
Stacktrace:
 [1] logabsdet(A::NamedDimsArray{(:a, :a), Float64, 2, Matrix{Float64}})
   @ LinearAlgebra /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/LinearAlgebra/src/generic.jl:1595
 [2] logdet(A::NamedDimsArray{(:a, :a), Float64, 2, Matrix{Float64}})
   @ LinearAlgebra /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/LinearAlgebra/src/generic.jl:1618
 [3] top-level scope
   @ REPL[39]:1

julia> logabsdet(nda)
ERROR: MethodError: no method matching logabsdet(::NamedDims.NamedFactorization{(:a, :a), Float64, LU{Float64, Matrix{Float64}}})
Closest candidates are:
  logabsdet(::SymTridiagonal; shift) at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/LinearAlgebra/src/tridiag.jl:446
  logabsdet(::UnitUpperTriangular{T, S} where S<:AbstractMatrix{T}) where T at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/LinearAlgebra/src/triangular.jl:2545
  logabsdet(::UnitLowerTriangular{T, S} where S<:AbstractMatrix{T}) where T at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/LinearAlgebra/src/triangular.jl:2546
  ...
Stacktrace:
 [1] logabsdet(A::NamedDimsArray{(:a, :a), Float64, 2, Matrix{Float64}})
   @ LinearAlgebra /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/stdlib/v1.7/LinearAlgebra/src/generic.jl:1595
 [2] top-level scope
   @ REPL[40]:1

I think we can just defer to parent, rather than use NamedFactorization, because the eigenvectors and eigenvalues will not have a dimension name of the original matrix.

@mzgubic mzgubic added the bug Something isn't working label Aug 12, 2022
@mzgubic mzgubic changed the title eigen(nda) broken eigen(nda) and det(nda) are broken Aug 12, 2022
@mzgubic mzgubic changed the title eigen(nda) and det(nda) are broken eigen(nda) and Xdet(nda) are broken Aug 12, 2022
@mzgubic mzgubic changed the title eigen(nda) and Xdet(nda) are broken eigen(nda) eigvals(nda), and Xdet(nda) are broken Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant