Skip to content

Commit 2eead23

Browse files
authored
minor changes in docs
1 parent b524893 commit 2eead23

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

docs/src/users_guide/plotting_the_bloch_sphere.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,19 +243,22 @@ c_op_list = (
243243
ψ0 = basis(2, 0)
244244
tlist = LinRange(0, 4, 250)
245245
sol = mesolve(H, ψ0, tlist, c_op_list, e_ops = (sx, sy, sz), progress_bar = Val(false))
246-
x = real(sol.expect[1,:])
247-
y = real(sol.expect[2,:])
248-
z = real(sol.expect[3,:])
249246
```
250247

251248
To animate a set of vectors or data points, we use the `record` function provided by [`Makie.jl`](https://docs.makie.org/stable/):
252249

253250
```@example Bloch_sphere_rendering
251+
# expectation values
252+
x = real(sol.expect[1,:])
253+
y = real(sol.expect[2,:])
254+
z = real(sol.expect[3,:])
255+
256+
# create Bloch sphere
254257
b = Bloch()
255258
b.view = [50,30]
256-
257259
fig, lscene = render(b)
258260
261+
# save animation
259262
record(fig, "qubit_decay.mp4", eachindex(tlist), framerate = 20) do idx
260263
clear!(b)
261264
add_vectors!(b, [sin(θ), 0, cos(θ)])

0 commit comments

Comments
 (0)