Skip to content

Commit 921cce9

Browse files
Format code
1 parent 4e91089 commit 921cce9

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

ext/QuantumToolboxMakieExt.jl

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -377,13 +377,7 @@ function _setup_bloch_plot!(b::Bloch, location)
377377
fig, location = _getFigAndLocation(location)
378378
bg_color = parse(RGBf, b.frame_color)
379379
frame_color = RGBAf(bg_color, b.frame_alpha)
380-
lscene = LScene(
381-
location,
382-
show_axis = false,
383-
scenekw = (
384-
backgroundcolor = frame_color,
385-
)
386-
)
380+
lscene = LScene(location, show_axis = false, scenekw = (backgroundcolor = frame_color,))
387381
length(b.view) == 2 || throw(ArgumentError("The length of `Bloch.view` must be 2."))
388382
cam3d!(lscene.scene, center = false)
389383
update_cam!(lscene.scene, (1, 0, 0), (0, 0, 0))
@@ -413,15 +407,31 @@ function _draw_bloch_sphere!(b::Bloch, lscene)
413407
x_line = [radius * sin(ϕ) * cos(θi) for ϕ in φ_curve]
414408
y_line = [radius * sin(ϕ) * sin(θi) for ϕ in φ_curve]
415409
z_line = [radius * cos(ϕ) for ϕ in φ_curve]
416-
lines!(lscene, x_line, y_line, z_line; color = RGBAf(0.5, 0.5, 0.5, line_alpha), linewidth = 1, transparency = true)
410+
lines!(
411+
lscene,
412+
x_line,
413+
y_line,
414+
z_line;
415+
color = RGBAf(0.5, 0.5, 0.5, line_alpha),
416+
linewidth = 1,
417+
transparency = true,
418+
)
417419
end
418420
φ_vals = range(0.0f0, π, length = n_lat + 2)
419421
θ_curve = range(0.0f0, 2π, length = 600)
420422
for ϕ in φ_vals
421423
x_ring = [radius * sin(ϕ) * cos(θi) for θi in θ_curve]
422424
y_ring = [radius * sin(ϕ) * sin(θi) for θi in θ_curve]
423425
z_ring = fill(radius * cos(ϕ), length(θ_curve))
424-
lines!(lscene, x_ring, y_ring, z_ring; color = RGBAf(0.5, 0.5, 0.5, line_alpha), linewidth = 1, transparency = true)
426+
lines!(
427+
lscene,
428+
x_ring,
429+
y_ring,
430+
z_ring;
431+
color = RGBAf(0.5, 0.5, 0.5, line_alpha),
432+
linewidth = 1,
433+
transparency = true,
434+
)
425435
end
426436
end
427437

0 commit comments

Comments
 (0)