|
93 | 93 | @test issymmetric(Z) == true |
94 | 94 | end |
95 | 95 |
|
96 | | - # TODO: Implement a new show method for QuantumObjectEvolution |
97 | | - # @testset "REPL show" begin |
98 | | - # N = 10 |
99 | | - # a = QobjEvo(destroy(N)) |
100 | | - |
101 | | - # opstring = sprint((t, s) -> show(t, "text/plain", s), a) |
102 | | - # datastring = sprint((t, s) -> show(t, "text/plain", s), a.data) |
103 | | - # a_dims = a.dims |
104 | | - # a_size = size(a) |
105 | | - # a_isherm = isherm(a) |
106 | | - # @test opstring == |
107 | | - # "Quantum Object: type=Operator dims=$a_dims size=$a_size ishermitian=$a_isherm\n$datastring" |
108 | | - |
109 | | - # a = spre(a) |
110 | | - # opstring = sprint((t, s) -> show(t, "text/plain", s), a) |
111 | | - # datastring = sprint((t, s) -> show(t, "text/plain", s), a.data) |
112 | | - # a_dims = a.dims |
113 | | - # a_size = size(a) |
114 | | - # a_isherm = isherm(a) |
115 | | - # @test opstring == "Quantum Object: type=SuperOperator dims=$a_dims size=$a_size\n$datastring" |
116 | | - # end |
| 96 | + @testset "REPL show" begin |
| 97 | + N = 10 |
| 98 | + a = destroy(N) |
| 99 | + coef(p, t) = exp(-1im * t) |
| 100 | + H = QobjEvo((a' * a, (a, coef))) |
| 101 | + |
| 102 | + opstring = sprint((t, s) -> show(t, "text/plain", s), H) |
| 103 | + datastring = sprint((t, s) -> show(t, "text/plain", s), H.data) |
| 104 | + H_dims = H.dims |
| 105 | + H_size = size(H) |
| 106 | + H_isherm = isherm(H) |
| 107 | + H_isconst = isconstant(H) |
| 108 | + @test opstring == |
| 109 | + "Quantum Object Evo.: type=Operator dims=$H_dims size=$H_size ishermitian=$H_isherm isconstant=$H_isconst\n$datastring" |
| 110 | + |
| 111 | + L = QobjEvo(spre(a)) |
| 112 | + opstring = sprint((t, s) -> show(t, "text/plain", s), L) |
| 113 | + datastring = sprint((t, s) -> show(t, "text/plain", s), L.data) |
| 114 | + L_dims = L.dims |
| 115 | + L_size = size(L) |
| 116 | + L_isherm = isherm(L) |
| 117 | + L_isconst = isconstant(L) |
| 118 | + @test opstring == |
| 119 | + "Quantum Object Evo.: type=SuperOperator dims=$L_dims size=$L_size ishermitian=$L_isherm isconstant=$L_isconst\n$datastring" |
| 120 | + end |
117 | 121 |
|
118 | 122 | @testset "Type Inference (QuantumObject)" begin |
119 | 123 | for T in [ComplexF32, ComplexF64] |
|
0 commit comments