From 442f0a7cd8d443d7fe20688fefa204d730dccdf4 Mon Sep 17 00:00:00 2001 From: Yi-Te Huang Date: Wed, 8 Jan 2025 16:18:16 +0900 Subject: [PATCH] fix runtests --- src/qobj/quantum_object_base.jl | 2 +- test/core-test/quantum_objects_evo.jl | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qobj/quantum_object_base.jl b/src/qobj/quantum_object_base.jl index aa8ceb81..7bc323fd 100644 --- a/src/qobj/quantum_object_base.jl +++ b/src/qobj/quantum_object_base.jl @@ -183,7 +183,7 @@ _check_QuantumObject( } = throw( DomainError( _get_dims_string(dimensions), - "The given `dims` is not compatible with type = $type, should be an `Operator`.", + "The given `dims` is not compatible with type = $type, should be a single list of integers.", ), ) diff --git a/test/core-test/quantum_objects_evo.jl b/test/core-test/quantum_objects_evo.jl index 920218ef..981a20cf 100644 --- a/test/core-test/quantum_objects_evo.jl +++ b/test/core-test/quantum_objects_evo.jl @@ -4,6 +4,9 @@ a = MatrixOperator(rand(ComplexF64, 3, 2)) @test_throws DomainError QobjEvo(a, type = SuperOperator) + a = MatrixOperator(rand(ComplexF64, 4, 4)) + @test_throws DomainError QobjEvo(a, type = SuperOperator, dims = ((2,), (2,))) + a = MatrixOperator(rand(ComplexF64, 3, 2)) for t in (Ket, Bra, OperatorKet, OperatorBra) @test_throws ArgumentError QobjEvo(a, type = t) @@ -14,9 +17,6 @@ a = MatrixOperator(rand(ComplexF64, 5, 5)) @test_throws DimensionMismatch QobjEvo(a, type = SuperOperator) - - a = MatrixOperator(rand(ComplexF64, 4, 4)) - @test_throws DimensionMismatch QobjEvo(a, type = SuperOperator, dims = ((2,), (2,))) ψ = fock(10, 3) @test_throws TypeError QobjEvo(ψ)