Skip to content

Commit c7d6732

Browse files
Remove version condition of runtest
1 parent 4591551 commit c7d6732

File tree

1 file changed

+37
-39
lines changed

1 file changed

+37
-39
lines changed

test/quantum_objects.jl

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -271,48 +271,46 @@
271271
end
272272

273273
@testset "Type Inference (QuantumObject)" begin
274-
if VERSION >= v"1.10"
275-
for T in [ComplexF32, ComplexF64]
276-
N = 4
277-
a = rand(T, N)
278-
@inferred QuantumObject{typeof(a),KetQuantumObject} Qobj(a)
279-
for type in [Ket, OperatorKet]
280-
@inferred Qobj(a, type = type)
281-
end
282-
283-
UnionType =
284-
Union{QuantumObject{Matrix{T},BraQuantumObject,1},QuantumObject{Matrix{T},OperatorQuantumObject,1}}
285-
a = rand(T, 1, N)
286-
@inferred UnionType Qobj(a)
287-
for type in [Bra, OperatorBra]
288-
@inferred Qobj(a, type = type)
289-
end
290-
291-
a = rand(T, N, N)
292-
@inferred UnionType Qobj(a)
293-
for type in [Operator, SuperOperator]
294-
@inferred Qobj(a, type = type)
295-
end
274+
for T in [ComplexF32, ComplexF64]
275+
N = 4
276+
a = rand(T, N)
277+
@inferred QuantumObject{typeof(a),KetQuantumObject} Qobj(a)
278+
for type in [Ket, OperatorKet]
279+
@inferred Qobj(a, type = type)
296280
end
297281

298-
@testset "Math Operation" begin
299-
a = destroy(20)
300-
σx = sigmax()
301-
@inferred a + a
302-
@inferred a + a'
303-
@inferred a + 2
304-
@inferred 2 * a
305-
@inferred a / 2
306-
@inferred a^2
307-
@inferred a .+ 2
308-
@inferred a .* 2
309-
@inferred a ./ 2
310-
@inferred a .^ 2
311-
@inferred a * a
312-
@inferred a * a'
313-
@inferred kron(a, σx)
314-
@inferred kron(a, eye(2))
282+
UnionType =
283+
Union{QuantumObject{Matrix{T},BraQuantumObject,1},QuantumObject{Matrix{T},OperatorQuantumObject,1}}
284+
a = rand(T, 1, N)
285+
@inferred UnionType Qobj(a)
286+
for type in [Bra, OperatorBra]
287+
@inferred Qobj(a, type = type)
315288
end
289+
290+
a = rand(T, N, N)
291+
@inferred UnionType Qobj(a)
292+
for type in [Operator, SuperOperator]
293+
@inferred Qobj(a, type = type)
294+
end
295+
end
296+
297+
@testset "Math Operation" begin
298+
a = destroy(20)
299+
σx = sigmax()
300+
@inferred a + a
301+
@inferred a + a'
302+
@inferred a + 2
303+
@inferred 2 * a
304+
@inferred a / 2
305+
@inferred a^2
306+
@inferred a .+ 2
307+
@inferred a .* 2
308+
@inferred a ./ 2
309+
@inferred a .^ 2
310+
@inferred a * a
311+
@inferred a * a'
312+
@inferred kron(a, σx)
313+
@inferred kron(a, eye(2))
316314
end
317315
end
318316

0 commit comments

Comments
 (0)