@@ -42,15 +42,23 @@ op = DenseOperator(b_fock, b_fock ⊗ SpinBasis(1//2))
4242 0.0+0.0im 0.0+0.0im 0.0+0.0im 0.0+0.0im 0.0+0.0im 0.0+0.0im 0.0+0.0im 0.0+0.0im 0.0+0.0im 0.0+0.0im"
4343
4444op = SparseOperator (b_fock, b_fock ⊗ SpinBasis (1 // 2 ))
45+ if VERSION < v " 1.6.0-beta1"
4546@test sprint (show, op) == " Operator(dim=5x10)
4647 basis left: Fock(cutoff=4)
4748 basis right: [Fock(cutoff=4) ⊗ Spin(1/2)]
4849 []"
50+ else
51+ @test sprint (show, op) == " Operator(dim=5x10)\n basis left: Fock(cutoff=4)\n basis right: [Fock(cutoff=4) ⊗ Spin(1/2)]\n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ \n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ \n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ \n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ \n ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ "
52+ end
4953
5054op = SparseOperator (b_fock)
5155op. data[2 ,2 ] = 1
56+ if VERSION < v " 1.6.0-beta1"
5257@test replace (sprint (show, op), " \t " => " " ) == " Operator(dim=5x5)
5358 basis: Fock(cutoff=4)\n [2, 2] = 1.0+0.0im"
59+ else
60+ @test replace (sprint (show, op), " \t " => " " ) == " Operator(dim=5x5)\n basis: Fock(cutoff=4)\n ⋅ ⋅ ⋅ ⋅ ⋅ \n ⋅ 1.0+0.0im ⋅ ⋅ ⋅ \n ⋅ ⋅ ⋅ ⋅ ⋅ \n ⋅ ⋅ ⋅ ⋅ ⋅ \n ⋅ ⋅ ⋅ ⋅ ⋅ "
61+ end
5462
5563op = LazySum (SparseOperator (b_fock), DenseOperator (b_fock))
5664@test sprint (show, op) == " LazySum(dim=5x5)
@@ -98,7 +106,11 @@ state_data_str = sprint(Base.print_array, conj.(state_data))
98106
99107op = dm (state)
100108op_data = state_data * state_data'
101- type_len = length (" Complex{Float64}" )
109+ type_len = if VERSION < v " 1.6.0-beta1"
110+ length (" Complex{Float64}" )
111+ else
112+ length (" ComplexF64" )
113+ end
102114op_data_str1 = split (sprint (show, op_data)[type_len+ 2 : end - 1 ], " ;" )
103115for i= 1 : length (op_data_str1)
104116 op_data_str1[i] = join (split (op_data_str1[i]), " " )
0 commit comments