Skip to content

Commit

Permalink
Default to eigvals,eigvecs computation if no direct result known
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Mar 13, 2024
1 parent dc13346 commit 2e97016
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ Diagonal{T}(op::Op) where {T,Op<:Control} =

# Linear Algebra factorizations
LinearAlgebra.eigen(op::Operator) = Eigen(eigvals(op), eigvecs(op))
LinearAlgebra.eigvals(op::Operator) = eigvals(Matrix(op))
LinearAlgebra.eigvecs(op::Operator) = eigvecs(Matrix(op))

LinearAlgebra.eigen(g::Gate) = eigen(operator(g))
LinearAlgebra.eigvals(g::Gate) = eigvals(operator(g))
Expand Down

0 comments on commit 2e97016

Please sign in to comment.