|
65 | 65 |
|
66 | 66 | @testset "Makie Bloch sphere" begin |
67 | 67 | ρ = 0.7 * ket2dm(basis(2, 0)) + 0.3 * ket2dm(basis(2, 1)) |
68 | | - fig, ax = plot_bloch(ρ) |
| 68 | + fig, lscene = plot_bloch(ρ) |
69 | 69 | @test fig isa Figure |
70 | | - @test ax isa Axis3 |
| 70 | + @test lscene isa LScene |
71 | 71 |
|
72 | 72 | ψ = (basis(2, 0) + basis(2, 1)) / √2 |
73 | | - fig, ax = plot_bloch(ψ) |
| 73 | + fig, lscene = plot_bloch(ψ) |
74 | 74 | @test fig isa Figure |
75 | | - @test ax isa Axis3 |
| 75 | + @test lscene isa LScene |
76 | 76 |
|
77 | 77 | ϕ = dag(ψ) |
78 | | - fig, ax = plot_bloch(ϕ) |
| 78 | + fig, lscene = plot_bloch(ϕ) |
79 | 79 | @test fig isa Figure |
80 | | - @test ax isa Axis3 |
| 80 | + @test lscene isa LScene |
81 | 81 |
|
82 | 82 | fig = Figure() |
83 | | - pos = fig[1, 1] |
84 | | - fig1, ax = plot_bloch(ψ; location = pos) |
| 83 | + ax = Axis(fig[1, 1]) |
| 84 | + pos = fig[1, 2] |
| 85 | + fig1, lscene = plot_bloch(ψ; location = pos) |
85 | 86 | @test fig1 === fig |
86 | 87 |
|
87 | 88 | b = Bloch() |
|
141 | 142 | add_line!(b, [0, 0, 0], [1, 1, 1]) |
142 | 143 | add_arc!(b, [1, 0, 0], [0, 1, 0], [0, 0, 1]) |
143 | 144 | try |
144 | | - fig, ax = QuantumToolbox.render(b) |
| 145 | + fig, lscene = render(b) |
145 | 146 | @test !isnothing(fig) |
146 | | - @test !isnothing(ax) |
| 147 | + @test !isnothing(lscene) |
147 | 148 | catch e |
148 | 149 | @test false |
149 | 150 | @info "Render threw unexpected error" exception=e |
|
153 | 154 | ψ₂ = normalize(basis(2, 0) - im * basis(2, 1)) |
154 | 155 | add_line!(b, ψ₁, ψ₂; fmt = "r--") |
155 | 156 | try |
156 | | - fig, ax = QuantumToolbox.render(b) |
| 157 | + fig, lscene = render(b) |
157 | 158 | @test !isnothing(fig) |
158 | | - @test !isnothing(ax) |
| 159 | + @test !isnothing(lscene) |
159 | 160 | catch e |
160 | 161 | @test false |
161 | 162 | @info "Render threw unexpected error" exception=e |
|
187 | 188 | add_line!(b, [1, 0, 0], [0, 1, 0]) |
188 | 189 | add_arc!(b, [1, 0, 0], [0, 1, 0], [0, 0, 1]) |
189 | 190 | try |
190 | | - fig, ax = render(b) |
| 191 | + fig, lscene = render(b) |
191 | 192 | @test !isnothing(fig) |
192 | | - @test !isnothing(ax) |
| 193 | + @test !isnothing(lscene) |
193 | 194 | catch e |
194 | 195 | @test false |
195 | 196 | @info "Render threw unexpected error" exception=e |
|
202 | 203 | add_arc!(b, ψ₁, ψ₂) |
203 | 204 | add_arc!(b, ψ₂, ψ₃, ψ₁) |
204 | 205 | try |
205 | | - fig, ax = render(b) |
| 206 | + fig, lscene = render(b) |
206 | 207 | @test !isnothing(fig) |
207 | | - @test !isnothing(ax) |
| 208 | + @test !isnothing(lscene) |
208 | 209 | catch e |
209 | 210 | @test false |
210 | 211 | @info "Render threw unexpected error" exception=e |
|
0 commit comments