Skip to content

Commit fc6460b

Browse files
ytdHuangalbertomercurio
authored andcommitted
minor changes
1 parent c7d0412 commit fc6460b

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

src/QuantumToolbox.jl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,7 @@ import Reexport: @reexport
88
@reexport import StaticArraysCore: SVector
99
@reexport using LinearAlgebra
1010
@reexport using SparseArrays
11-
@reexport import SciMLOperators:
12-
AbstractSciMLOperator,
13-
MatrixOperator,
14-
ScalarOperator,
15-
ScaledOperator,
16-
AddedOperator,
17-
IdentityOperator,
18-
cache_operator,
19-
iscached,
20-
isconstant
11+
@reexport import SciMLOperators: cache_operator, iscached, isconstant
2112

2213
# other functions in LinearAlgebra
2314
import LinearAlgebra: BlasReal, BlasInt, BlasFloat, BlasComplex, checksquare
@@ -44,7 +35,16 @@ import SciMLBase:
4435
ContinuousCallback,
4536
DiscreteCallback
4637
import StochasticDiffEq: StochasticDiffEqAlgorithm, SRA1
47-
import SciMLOperators: SciMLOperators, update_coefficients!, concretize
38+
import SciMLOperators:
39+
SciMLOperators,
40+
AbstractSciMLOperator,
41+
MatrixOperator,
42+
ScalarOperator,
43+
ScaledOperator,
44+
AddedOperator,
45+
IdentityOperator,
46+
update_coefficients!,
47+
concretize
4848
import LinearSolve: LinearProblem, SciMLLinearSolveAlgorithm, KrylovJL_MINRES, KrylovJL_GMRES
4949
import DiffEqBase: get_tstops
5050
import DiffEqCallbacks: PeriodicCallback, PresetTimeCallback, TerminateSteadyState

test/core-test/quantum_objects.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,17 @@
8080
@test issuper(a2) == false
8181
@test isoperket(a2) == false
8282
@test isoperbra(a2) == false
83+
@test iscached(a2) == true
84+
@test isconstant(a2) == true
85+
@test isunitary(a2) == false
8386
@test isket(a3) == false
8487
@test isbra(a3) == false
8588
@test isoper(a3) == false
8689
@test issuper(a3) == true
8790
@test isoperket(a3) == false
8891
@test isoperbra(a3) == false
92+
@test iscached(a3) == true
93+
@test isconstant(a3) == true
8994
@test isunitary(a3) == false
9095
@test_throws DimensionMismatch Qobj(a, dims = 2)
9196
end

test/core-test/quantum_objects_evo.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,14 @@
205205
@test isconstant(L_td) == false
206206
@test issuper(L_td) == true
207207

208-
@test_logs (:warn,) (:warn,) liouvillian(H_td * H_td) # warnings from lazy tensor
209208
@test_throws MethodError QobjEvo([[a, coef1], a' * a, [a', coef2]])
210209
@test_throws ArgumentError H_td(ρvec, p, t)
211210
@test_throws ArgumentError cache_operator(H_td, ρvec)
212211
@test_throws ArgumentError L_td(ψ, p, t)
213212
@test_throws ArgumentError cache_operator(L_td, ψ)
213+
214+
@testset "Type Inference" begin
215+
@inferred liouvillian(H_td, (a, QobjEvo(((a', coef1),))))
216+
end
214217
end
215218
end

0 commit comments

Comments
 (0)