Skip to content

Commit a09324a

Browse files
Change default solver detection method
1 parent 6acf894 commit a09324a

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

src/qobj/eigsolve.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,16 @@ function eigsolve(
378378
!haskey(kwargs2, :assumptions) && (kwargs2 = merge(kwargs2, (assumptions = OperatorAssumptions(true),)))
379379

380380
prob = LinearProblem{true}(Aₛ, v0)
381-
linsolve =
382-
typeof(A) <: SparseMatrixCSC ? init(prob, UMFPACKFactorization(); kwargs2...) :
381+
382+
linsolve = if isnothing(solver)
383+
if typeof(A) <: SparseMatrixCSC && isprimitivetype(T)
384+
init(prob, UMFPACKFactorization(); kwargs2...)
385+
else
386+
init(prob; kwargs2...)
387+
end
388+
else
383389
init(prob, solver; kwargs2...)
390+
end
384391

385392
Amap = EigsolveInverseMap(T, size(A), linsolve)
386393

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[deps]
22
GenericSchur = "c145ed77-6b09-5dd9-b285-bf645a82121e"
33
QuantumToolbox = "6c2fb7c5-b903-41d2-bc5e-5a7c320b9fab"
4+
Sparspak = "e56a9233-b9d6-4f03-8d0f-1825330902ac"

test/runtests.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ if (GROUP == "Arbitrary-Precision")
8989
Pkg.update()
9090

9191
using QuantumToolbox
92+
using LinearAlgebra
9293
using SparseArrays
94+
using Sparspak
9395
using GenericSchur
9496

9597
QuantumToolbox.about()

0 commit comments

Comments
 (0)