Skip to content

Commit f07c055

Browse files
committed
fix document
1 parent d6fda72 commit f07c055

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

docs/src/users_guide/plotting_the_bloch_sphere.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,19 +166,25 @@ fig
166166

167167
## [Configuring the Bloch sphere](@id doc:Configuring-the-Bloch-sphere)
168168

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 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()`:
170+
171+
### Data storage
170172

171173
| **Field** | **Description** | **Default setting** |
172174
|:----------|:----------------|:--------------------|
173175
| `b.points` | Points to plot on the Bloch sphere (3D coordinates) | `Vector{Matrix{Float64}}()` (empty) |
174176
| `b.vectors` | Vectors to plot on the Bloch sphere | `Vector{Vector{Float64}}()` (empty) |
175177
| `b.lines` | Lines to draw on the sphere (points, style, properties) | `Vector{Tuple{Vector{Vector{Float64}},String}}()` (empty) |
176178
| `b.arcs` | Arcs to draw on the sphere | `Vector{Vector{Vector{Float64}}}()` (empty) |
179+
180+
### Properties
181+
182+
| **Field** | **Description** | **Default setting** |
183+
|:----------|:----------------|:--------------------|
177184
| `b.font_color` | Color of axis labels and text | `"black"` |
178185
| `b.font_size` | Font size for labels | `20` |
179-
| `b.frame_alpha` | Transparency of the frame background | `0.1` |
180-
| `b.frame_color` | Background color of the frame | `"gray"` |
181-
| `b.frame_limit` | Axis limits for the 3D frame (symmetric around origin) | `1.2` |
186+
| `b.frame_alpha` | Transparency of the wire frame | `0.1` |
187+
| `b.frame_color` | Color of the wire frame | `"gray"` |
182188
| `b.point_default_color` | Default color cycle for points | `["blue", "red", "green", "#CC6600"]` |
183189
| `b.point_color` | List of colors for Bloch point markers to cycle through | `Union{Nothing,String}[]` |
184190
| `b.point_marker` | List of point marker shapes to cycle through | `[:circle, :rect, :diamond, :utriangle]` |
@@ -192,11 +198,11 @@ At the end of the last section we saw that the colors and marker shapes of the d
192198
| `b.vector_arrowsize` | Arrow size parameters as (head length, head width, stem width) | `[0.07, 0.08, 0.08]` |
193199
| `b.view` | Azimuthal and elevation viewing angles in degrees | `[30, 30]` |
194200
| `b.xlabel` | Labels for x-axis | `[L"x", ""]` (``+x`` and ``-x``) |
195-
| `b.xlpos` | Positions of x-axis labels | `[1.0, -1.0]` |
201+
| `b.xlpos` | Positions of x-axis labels | `[1.2, -1.2]` |
196202
| `b.ylabel` | Labels for y-axis | `[L"y", ""]` (``+y`` and ``-y``) |
197-
| `b.ylpos` | Positions of y-axis labels | `[1.0, -1.0]` |
203+
| `b.ylpos` | Positions of y-axis labels | `[1.2, -1.2]` |
198204
| `b.zlabel` | Labels for z-axis | `[L"\|0\rangle", L"\|1\rangle]"` (``+z`` and ``-z``) |
199-
| `b.zlpos` | Positions of z-axis labels | `[1.0, -1.0]` |
205+
| `b.zlpos` | Positions of z-axis labels | `[1.2, -1.2]` |
200206

201207
These properties can also be accessed via the `print` command:
202208

src/visualization.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ plot_fock_distribution(::Val{T}, ρ::QuantumObject{SType}; kwargs...) where {T,S
6565
throw(ArgumentError("The specified plotting library $T is not available. Try running `using $T` first."))
6666

6767
@doc raw"""
68-
Bloch()
68+
Bloch(kwargs...)
6969
70-
A structure representing a Bloch sphere visualization for quantum states.
70+
A structure representing a Bloch sphere visualization for quantum states. Available keyword arguments are listed in the following fields.
7171
7272
# Fields
7373
@@ -81,8 +81,8 @@ A structure representing a Bloch sphere visualization for quantum states.
8181
8282
- `font_color::String`: Color of axis labels and text
8383
- `font_size::Int`: Font size for labels. Default: `20`
84-
- `frame_alpha::Float64`: Transparency of the wireframe
85-
- `frame_color::String`: Color of the wireframe
84+
- `frame_alpha::Float64`: Transparency of the wire frame
85+
- `frame_color::String`: Color of the wire frame
8686
8787
## Point properties
8888
@@ -98,7 +98,7 @@ A structure representing a Bloch sphere visualization for quantum states.
9898
- `sphere_color::String`: Color of Bloch sphere surface
9999
- `sphere_alpha::Float64`: Transparency of sphere surface. Default: `0.2`
100100
101-
# Vector properties
101+
## Vector properties
102102
103103
- `vector_color`::Vector{String}: Colors for vectors
104104
- `vector_width`::Float64: Width of vectors
@@ -109,6 +109,7 @@ A structure representing a Bloch sphere visualization for quantum states.
109109
- `view::Vector{Int}`: Azimuthal and elevation viewing angles in degrees. Default: `[30, 30]`
110110
111111
## Label properties
112+
112113
- `xlabel::Vector{AbstractString}`: Labels for x-axis. Default: `[L"x", ""]`
113114
- `xlpos::Vector{Float64}`: Positions of x-axis labels. Default: `[1.2, -1.2]`
114115
- `ylabel::Vector{AbstractString}`: Labels for y-axis. Default: `[L"y", ""]`

0 commit comments

Comments
 (0)