Skip to content

Commit f8f335d

Browse files
Improve docs
1 parent e24f003 commit f8f335d

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

docs/src/tutorials/logo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ xvec = range(-ρ, ρ, 500) .* 1.5
7676
yvec = xvec .+ (abs(imag(α1)) - abs(imag(α2))) / 2
7777
7878
fig = Figure(size = (250, 250), figure_padding = 0)
79-
fig, ax, hm = plot_wigner(ψ, library = Val(:CairoMakie), xvec = xvec, yvec = yvec, g = 2, location = fig[1,1])
79+
fig, ax, hm = plot_wigner(ψ, xvec = xvec, yvec = yvec, g = 2, library = Val(:CairoMakie), location = fig[1,1])
8080
hidespines!(ax)
8181
hidexdecorations!(ax)
8282
hideydecorations!(ax)
@@ -110,7 +110,7 @@ And the Wigner function becomes more uniform:
110110

111111
```@example logo
112112
fig = Figure(size = (250, 250), figure_padding = 0)
113-
fig, ax, hm = plot_wigner(sol.states[end], library = Val(:CairoMakie), xvec = xvec, yvec = yvec, g = 2, location = fig[1,1])
113+
fig, ax, hm = plot_wigner(sol.states[end], xvec = xvec, yvec = yvec, g = 2, library = Val(:CairoMakie), location = fig[1,1])
114114
hidespines!(ax)
115115
hidexdecorations!(ax)
116116
hideydecorations!(ax)

ext/QuantumToolboxCairoMakieExt.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ using CairoMakie
1717
kwargs...
1818
) where {DT,OpType}
1919
20-
Plot the [Wigner quasipropability distribution](https://en.wikipedia.org/wiki/Wigner_quasiprobability_distribution) of `state` using the [CairoMakie](https://github.com/MakieOrg/Makie.jl/tree/master/CairoMakie) plotting library.
21-
22-
Note that CairoMakie must first be imported before using this function.
20+
Plot the [Wigner quasipropability distribution](https://en.wikipedia.org/wiki/Wigner_quasiprobability_distribution) of `state` using the [`CairoMakie`](https://github.com/MakieOrg/Makie.jl/tree/master/CairoMakie) plotting library.
2321
2422
# Arguments
2523
- `library::Val{:CairoMakie}`: The plotting library to use.
26-
- `state::QuantumObject`: The quantum state for which the Wigner function is calculated. It can be either a [`KetQuantumObject`](@ref), [`BraQuantumObject`](@ref), or [`OperatorQuantumObject`](@ref).
24+
- `state::QuantumObject`: The quantum state for which the Wigner function is calculated. It can be either a [`Ket`](@ref), [`Bra`](@ref), or [`Operator`](@ref).
2725
- `xvec::AbstractVector`: The x-coordinates of the phase space grid. Defaults to a linear range from -7.5 to 7.5 with 200 points.
2826
- `yvec::AbstractVector`: The y-coordinates of the phase space grid. Defaults to a linear range from -7.5 to 7.5 with 200 points.
2927
- `g::Real`: The scaling factor related to the value of ``\hbar`` in the commutation relation ``[x, y] = i \hbar`` via ``\hbar=2/g^2``.
@@ -38,6 +36,9 @@ Note that CairoMakie must first be imported before using this function.
3836
- `ax`: The axis object.
3937
- `hm`: Either the heatmap or surface object, depending on the projection.
4038
39+
!!! note "Import library first"
40+
[`CairoMakie`](https://github.com/MakieOrg/Makie.jl/tree/master/CairoMakie) must first be imported before using this function.
41+
4142
!!! warning "Beware of type-stability!"
4243
If you want to keep type stability, it is recommended to use `Val(:two_dim)` and `Val(:three_dim)` instead of `:two_dim` and `:three_dim`, respectively. Also, specify the library as `Val(:CairoMakie)` See [this link](https://docs.julialang.org/en/v1/manual/performance-tips/#man-performance-value-type) and the [related Section](@ref doc:Type-Stability) about type stability for more details.
4344
"""

src/visualization.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@ export plot_wigner
99
1010
Plot the [Wigner quasipropability distribution](https://en.wikipedia.org/wiki/Wigner_quasiprobability_distribution) of `state` using the [`wigner`](@ref) function.
1111
12-
The `library` keyword argument specifies the plotting library to use, defaulting to `CairoMakie`. Note that plotting libraries must first be imported before using them with this function.
12+
The `library` keyword argument specifies the plotting library to use, defaulting to [`CairoMakie`](https://github.com/MakieOrg/Makie.jl/tree/master/CairoMakie).
1313
1414
# Arguments
1515
- `state::QuantumObject{DT,OpType}`: The quantum state for which to plot the Wigner distribution.
1616
- `library::Union{Val,Symbol}`: The plotting library to use. Default is `Val(:CairoMakie)`.
1717
- `kwargs...`: Additional keyword arguments to pass to the plotting function. See the documentation for the specific plotting library for more information.
1818
19+
!!! note "Import library first"
20+
The plotting libraries must first be imported before using them with this function.
21+
1922
!!! warning "Beware of type-stability!"
2023
If you want to keep type stability, it is recommended to use `Val(:CairoMakie)` instead of `:CairoMakie` as the plotting library. See [this link](https://docs.julialang.org/en/v1/manual/performance-tips/#man-performance-value-type) and the [related Section](@ref doc:Type-Stability) about type stability for more details.
2124
"""

0 commit comments

Comments
 (0)