You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/users_guide/plotting_the_bloch_sphere.md
+19-10Lines changed: 19 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,9 @@ In [`QuantumToolbox`](https://qutip.org/QuantumToolbox.jl/), this can be done us
17
17
18
18
In [`QuantumToolbox`](https://qutip.org/QuantumToolbox.jl/), creating a [`Bloch`](@ref) sphere is accomplished by calling either:
19
19
20
+
!!! note "Import plotting libraries"
21
+
Remember to import plotting libraries first. Here, we demonstrate the functionalities with [`CairoMakie.jl`](https://docs.makie.org/stable/explanations/backends/cairomakie.html).
22
+
20
23
```@example Bloch_sphere_rendering
21
24
b = Bloch()
22
25
```
@@ -163,19 +166,25 @@ fig
163
166
164
167
## [Configuring the Bloch sphere](@id doc:Configuring-the-Bloch-sphere)
165
168
166
-
At the end of the last section we saw that the colors and marker shapes of the data plotted on the Bloch sphere are automatically varied according to the number of points and vectors added. But what if you want a different choice of color, or you want your sphere to be purple with different axes labels? Well then you are in luck as the Bloch class has many attributes which one can control. Assuming `b = Bloch()`:
169
+
At the end of the last section we saw that the colors and marker shapes of the data plotted on the Bloch sphere are automatically varied according to the number of points and vectors added. But what if you want a different choice of color, or you want your sphere to be purple with different axes labels? Well then you are in luck as the [`Bloch`](@ref) structure has many fields which one can control. Assuming `b = Bloch()`:
|`b.points`| Points to plot on the Bloch sphere (3D coordinates) |`Vector{Matrix{Float64}}()` (empty) |
171
176
|`b.vectors`| Vectors to plot on the Bloch sphere |`Vector{Vector{Float64}}()` (empty) |
172
-
|`b.lines`| Lines to draw on the sphere (points, style, properties)|`Vector{Tuple{Vector{Vector{Float64}},String}}()` (empty) |
177
+
|`b.lines`| Lines to draw on the sphere with each line given as `([start_pt, end_pt], line_format)`|`Vector{Tuple{Vector{Vector{Float64}},String}}()` (empty) |
173
178
|`b.arcs`| Arcs to draw on the sphere |`Vector{Vector{Vector{Float64}}}()` (empty) |
|`b.font_color`| Color of axis labels and text |`"black"`|
175
-
|`b.font_size`| Font size for labels |`15`|
176
-
|`b.frame_alpha`| Transparency of the frame background |`0.1`|
177
-
|`b.frame_color`| Background color of the frame |`"gray"`|
178
-
|`b.frame_limit`| Axis limits for the 3D frame (symmetric around origin) |`1.2`|
185
+
|`b.font_size`| Font size for labels |`20`|
186
+
|`b.frame_alpha`| Transparency of the wire frame |`0.1`|
187
+
|`b.frame_color`| Color of the wire frame |`"gray"`|
179
188
|`b.point_default_color`| Default color cycle for points |`["blue", "red", "green", "#CC6600"]`|
180
189
|`b.point_color`| List of colors for Bloch point markers to cycle through |`Union{Nothing,String}[]`|
181
190
|`b.point_marker`| List of point marker shapes to cycle through |`[:circle, :rect, :diamond, :utriangle]`|
@@ -186,14 +195,14 @@ At the end of the last section we saw that the colors and marker shapes of the d
186
195
|`b.sphere_alpha`| Transparency of sphere surface |`"#FFDDDD"`|
187
196
|`b.vector_color`| Colors for vectors |`["green", "#CC6600", "blue", "red"]`|
188
197
|`b.vector_width`| Width of vectors |`0.025`|
189
-
|`b.vector_arrowsize`|Arrow size parameters as (head length, head width, stem width)|`[0.07, 0.08, 0.08]`|
198
+
|`b.vector_arrowsize`|Scales the size of the arrow head. The first two elements scale the radius (in `x/y` direction) and the last one is the length of the cone.|`[0.07, 0.08, 0.08]`|
190
199
|`b.view`| Azimuthal and elevation viewing angles in degrees |`[30, 30]`|
191
200
|`b.xlabel`| Labels for x-axis |`[L"x", ""]` (``+x`` and ``-x``) |
192
-
|`b.xlpos`| Positions of x-axis labels |`[1.0, -1.0]`|
201
+
|`b.xlpos`| Positions of x-axis labels |`[1.2, -1.2]`|
193
202
|`b.ylabel`| Labels for y-axis |`[L"y", ""]` (``+y`` and ``-y``) |
194
-
|`b.ylpos`| Positions of y-axis labels |`[1.0, -1.0]`|
203
+
|`b.ylpos`| Positions of y-axis labels |`[1.2, -1.2]`|
195
204
|`b.zlabel`| Labels for z-axis |`[L"\|0\rangle", L"\|1\rangle]"` (``+z`` and ``-z``) |
196
-
|`b.zlpos`| Positions of z-axis labels |`[1.0, -1.0]`|
205
+
|`b.zlpos`| Positions of z-axis labels |`[1.2, -1.2]`|
197
206
198
207
These properties can also be accessed via the `print` command:
0 commit comments