Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ytdHuang committed Nov 1, 2024
1 parent 6f12aa1 commit 8bb34c5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
22 changes: 11 additions & 11 deletions src/QuantumToolbox.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,7 @@ import Reexport: @reexport
@reexport import StaticArraysCore: SVector
@reexport using LinearAlgebra
@reexport using SparseArrays
@reexport import SciMLOperators:
AbstractSciMLOperator,
MatrixOperator,
ScalarOperator,
ScaledOperator,
AddedOperator,
IdentityOperator,
cache_operator,
iscached,
isconstant
@reexport import SciMLOperators: cache_operator, iscached, isconstant

# other functions in LinearAlgebra
import LinearAlgebra: BlasReal, BlasInt, BlasFloat, BlasComplex, checksquare
Expand All @@ -44,7 +35,16 @@ import SciMLBase:
ContinuousCallback,
DiscreteCallback
import StochasticDiffEq: StochasticDiffEqAlgorithm, SRA1
import SciMLOperators: SciMLOperators, update_coefficients!, concretize
import SciMLOperators:
SciMLOperators,
AbstractSciMLOperator,
MatrixOperator,
ScalarOperator,
ScaledOperator,
AddedOperator,
IdentityOperator,
update_coefficients!,
concretize
import LinearSolve: LinearProblem, SciMLLinearSolveAlgorithm, KrylovJL_MINRES, KrylovJL_GMRES
import DiffEqBase: get_tstops
import DiffEqCallbacks: PeriodicCallback, PresetTimeCallback, TerminateSteadyState
Expand Down
5 changes: 5 additions & 0 deletions test/core-test/quantum_objects.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,17 @@
@test issuper(a2) == false
@test isoperket(a2) == false
@test isoperbra(a2) == false
@test iscached(a2) == true
@test isconstant(a2) == true
@test isunitary(a2) == false
@test isket(a3) == false
@test isbra(a3) == false
@test isoper(a3) == false
@test issuper(a3) == true
@test isoperket(a3) == false
@test isoperbra(a3) == false
@test iscached(a3) == true
@test isconstant(a3) == true
@test isunitary(a3) == false
@test_throws DimensionMismatch Qobj(a, dims = 2)
end
Expand Down
5 changes: 4 additions & 1 deletion test/core-test/quantum_objects_evo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,14 @@
@test isconstant(L_td) == false
@test issuper(L_td) == true

@test_logs (:warn,) (:warn,) liouvillian(H_td * H_td) # warnings from lazy tensor
@test_throws MethodError QobjEvo([[a, coef1], a' * a, [a', coef2]])
@test_throws ArgumentError H_td(ρvec, p, t)
@test_throws ArgumentError cache_operator(H_td, ρvec)
@test_throws ArgumentError L_td(ψ, p, t)
@test_throws ArgumentError cache_operator(L_td, ψ)

@testset "Type Inference" begin
@inferred liouvillian(H_td, (a, QobjEvo(((a', coef1),))))
end
end
end

0 comments on commit 8bb34c5

Please sign in to comment.