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

sqrt of a BigFloat matrix #98

Open
daanhb opened this issue Dec 3, 2022 · 1 comment
Open

sqrt of a BigFloat matrix #98

daanhb opened this issue Dec 3, 2022 · 1 comment

Comments

@daanhb
Copy link

daanhb commented Dec 3, 2022

Any chance of getting sqrt to work?

It seems like LinearAlgebra makes assumptions about what schur returns in this function. Example:

julia> using GenericLinearAlgebra
s
julia> A = rand(BigFloat, 2, 2);

julia> sqrt(A)
ERROR: type Schur has no field values
Stacktrace:
 [1] getproperty(F::GenericLinearAlgebra.Schur{BigFloat, Matrix{BigFloat}}, s::Symbol)
   @ GenericLinearAlgebra ~/.julia/packages/GenericLinearAlgebra/tfuHk/src/eigenGeneral.jl:72
 [2] sqrt(A::Matrix{BigFloat})
   @ LinearAlgebra /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/LinearAlgebra/src/dense.jl:865
 [3] top-level scope
   @ REPL[3]:1

(My use case is that taking the square root of a Gram matrix is a neat way to orthogonalize a basis for a function space.)

@daanhb
Copy link
Author

daanhb commented Jun 3, 2023

Being a bit more familiar with the code now, I wonder why GenericLinearAlgebra has its own Hessenberg and Schur types, even though LinearAlgebra has those too. Is there a reason they can't be reused, or could it be worthwhile to spend the effort to do so?

Update: I'm pretty sure the HessenbergMatrix type can just be replaced by LinearAlgebra.UpperHessenberg. That simple change passes all the tests. The former was written five years ago and the latter four years (says git blame), so I'm suspecting a chronological reason rather than a technical one. Reusing the corresponding factorization is less obvious - this is not my area of expertise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant