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/extensions/cairomakie.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,18 @@
1
-
# [Extension for CairoMakie.jl](@id doc:CairoMakie)
1
+
# [Extension for the Makie.jl ecosystem](@id doc:Makie)
2
2
3
-
This is an extension to support visualization (plotting functions) using [`CairoMakie.jl`](https://github.com/MakieOrg/Makie.jl/tree/master/CairoMakie) library.
3
+
This is an extension to support visualization (plotting functions) using [`Makie.jl`](https://github.com/MakieOrg/Makie.jl) library.
4
4
5
-
This extension will be automatically loaded if user imports both `QuantumToolbox.jl` and [`CairoMakie.jl`](https://github.com/MakieOrg/Makie.jl/tree/master/CairoMakie):
5
+
This extension will be automatically loaded if user imports both `QuantumToolbox.jl` and [`Makie.jl`](https://github.com/MakieOrg/Makie.jl). It is worth noting that the `Makie.jl` package provides only the engine for plotting, and the user has to import the specific backend. Here we demonstrate the usage of [`CairoMakie.jl`](https://github.com/MakieOrg/Makie.jl/tree/master/CairoMakie), which will automatically import `Makie.jl`.
6
6
7
7
```julia
8
8
using QuantumToolbox
9
9
using CairoMakie
10
10
```
11
11
12
-
To plot with [`CairoMakie.jl`](https://github.com/MakieOrg/Makie.jl/tree/master/CairoMakie) library, specify the keyword argument `library = Val(:CairoMakie)` for the plotting functions.
12
+
To plot with [`CairoMakie.jl`](https://github.com/MakieOrg/Makie.jl/tree/master/CairoMakie) library, specify the keyword argument `library = Val(:Makie)` for the plotting functions.
13
13
14
14
!!! warning "Beware of type-stability!"
15
-
If you want to keep type stability, it is recommended to use `Val(:CairoMakie)` instead of `: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.
15
+
If you want to keep type stability, it is recommended to use `Val(:Makie)` instead of `:Makie`. 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.
16
16
17
17
The supported plotting functions are listed as follows:
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
+
Plot the [Wigner quasipropability distribution](https://en.wikipedia.org/wiki/Wigner_quasiprobability_distribution) of `state` using the [`Makie`](https://github.com/MakieOrg/Makie.jl) plotting library.
22
22
23
23
# Arguments
24
-
- `library::Val{:CairoMakie}`: The plotting library to use.
24
+
- `library::Val{:Makie}`: The plotting library to use.
25
25
- `state::QuantumObject`: The quantum state for which the Wigner function is calculated. It can be either a [`Ket`](@ref), [`Bra`](@ref), or [`Operator`](@ref).
26
26
- `xvec::AbstractVector`: The x-coordinates of the phase space grid. Defaults to a linear range from -7.5 to 7.5 with 200 points.
27
27
- `yvec::AbstractVector`: The y-coordinates of the phase space grid. Defaults to a linear range from -7.5 to 7.5 with 200 points.
@@ -38,13 +38,13 @@ Plot the [Wigner quasipropability distribution](https://en.wikipedia.org/wiki/Wi
38
38
- `hm`: Either the heatmap or surface object, depending on the projection.
39
39
40
40
!!! note "Import library first"
41
-
[`CairoMakie`](https://github.com/MakieOrg/Makie.jl/tree/master/CairoMakie) must first be imported before using this function.
41
+
[`Makie.jl`](https://github.com/MakieOrg/Makie.jl) must first be imported before using this function. This can be done by importing one of the available backends, such as [`CairoMakie.jl`](https://github.com/MakieOrg/Makie.jl/tree/master/CairoMakie), [`GLMakie.jl`](https://github.com/MakieOrg/Makie.jl/tree/master/GLMakie), or [`WGLMakie.jl`](https://github.com/MakieOrg/Makie.jl/tree/master/WGLMakie).
42
42
43
43
!!! warning "Beware of type-stability!"
44
-
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.
44
+
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(:Makie)` 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.
Plot the [Fock state](https://en.wikipedia.org/wiki/Fock_state) distribution of `ρ`.
154
154
155
155
# Arguments
156
-
- `library::Val{:CairoMakie}`: The plotting library to use.
156
+
- `library::Val{:Makie}`: The plotting library to use.
157
157
- `ρ::QuantumObject`: The quantum state for which the Fock state distribution is to be plotted. It can be either a [`Ket`](@ref), [`Bra`](@ref), or [`Operator`](@ref).
158
158
- `location::Union{GridPosition,Nothing}`: The location of the plot in the layout. If `nothing`, the plot is created in a new figure. Default is `nothing`.
159
159
- `fock_numbers::Union{Nothing, AbstractVector}`: list of x ticklabels to represent fock numbers, default is `nothing`.
@@ -166,13 +166,13 @@ Plot the [Fock state](https://en.wikipedia.org/wiki/Fock_state) distribution of
166
166
- `bp`: The barplot object.
167
167
168
168
!!! note "Import library first"
169
-
[`CairoMakie`](https://github.com/MakieOrg/Makie.jl/tree/master/CairoMakie) must first be imported before using this function.
169
+
[`Makie.jl`](https://github.com/MakieOrg/Makie.jl) must first be imported before using this function. This can be done by importing one of the available backends, such as [`CairoMakie.jl`](https://github.com/MakieOrg/Makie.jl/tree/master/CairoMakie), [`GLMakie.jl`](https://github.com/MakieOrg/Makie.jl/tree/master/GLMakie), or [`WGLMakie.jl`](https://github.com/MakieOrg/Makie.jl/tree/master/WGLMakie).
170
170
171
171
!!! warning "Beware of type-stability!"
172
-
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.
172
+
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(:Makie)` 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.
) where {OpType<:Union{BraQuantumObject,KetQuantumObject,OperatorQuantumObject}
9
9
10
10
Plot the [Wigner quasipropability distribution](https://en.wikipedia.org/wiki/Wigner_quasiprobability_distribution) of `state` using the [`wigner`](@ref) function.
11
11
12
-
The `library` keyword argument specifies the plotting library to use, defaulting to [`CairoMakie`](https://github.com/MakieOrg/Makie.jl/tree/master/CairoMakie).
12
+
The `library` keyword argument specifies the plotting library to use, defaulting to [`Makie.jl`](https://github.com/MakieOrg/Makie.jl).
13
13
14
14
# Arguments
15
15
- `state::QuantumObject`: The quantum state for which to plot the Wigner distribution.
16
-
- `library::Union{Val,Symbol}`: The plotting library to use. Default is `Val(:CairoMakie)`.
16
+
- `library::Union{Val,Symbol}`: The plotting library to use. Default is `Val(:Makie)`.
17
17
- `kwargs...`: Additional keyword arguments to pass to the plotting function. See the documentation for the specific plotting library for more information.
18
18
19
19
!!! note "Import library first"
20
20
The plotting libraries must first be imported before using them with this function.
21
21
22
22
!!! warning "Beware of type-stability!"
23
-
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.
23
+
If you want to keep type stability, it is recommended to use `Val(:Makie)` instead of `:Makie` 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.
24
24
"""
25
25
plot_wigner(
26
26
state::QuantumObject{OpType};
27
-
library::Union{Val,Symbol}=Val(:CairoMakie),
27
+
library::Union{Val,Symbol}=Val(:Makie),
28
28
kwargs...,
29
29
) where {OpType<:Union{BraQuantumObject,KetQuantumObject,OperatorQuantumObject}} =
30
30
plot_wigner(makeVal(library), state; kwargs...)
@@ -39,28 +39,28 @@ plot_wigner(
39
39
@docraw"""
40
40
plot_fock_distribution(
41
41
ρ::QuantumObject{SType};
42
-
library::Union{Val, Symbol} = Val(:CairoMakie),
42
+
library::Union{Val, Symbol} = Val(:Makie),
43
43
kwargs...
44
44
) where {SType<:Union{KetQuantumObject,OperatorQuantumObject}}
45
45
46
46
Plot the [Fock state](https://en.wikipedia.org/wiki/Fock_state) distribution of `ρ`.
47
47
48
-
The `library` keyword argument specifies the plotting library to use, defaulting to [`CairoMakie`](https://github.com/MakieOrg/Makie.jl/tree/master/CairoMakie).
48
+
The `library` keyword argument specifies the plotting library to use, defaulting to [`Makie`](https://github.com/MakieOrg/Makie.jl).
49
49
50
50
# Arguments
51
51
- `ρ::QuantumObject`: The quantum state for which to plot the Fock state distribution.
52
-
- `library::Union{Val,Symbol}`: The plotting library to use. Default is `Val(:CairoMakie)`.
52
+
- `library::Union{Val,Symbol}`: The plotting library to use. Default is `Val(:Makie)`.
53
53
- `kwargs...`: Additional keyword arguments to pass to the plotting function. See the documentation for the specific plotting library for more information.
54
54
55
55
!!! note "Import library first"
56
56
The plotting libraries must first be imported before using them with this function.
57
57
58
58
!!! warning "Beware of type-stability!"
59
-
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.
59
+
If you want to keep type stability, it is recommended to use `Val(:Makie)` instead of `:Makie` 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.
60
60
"""
61
61
plot_fock_distribution(
62
62
ρ::QuantumObject{SType};
63
-
library::Union{Val,Symbol}=Val(:CairoMakie),
63
+
library::Union{Val,Symbol}=Val(:Makie),
64
64
kwargs...,
65
65
) where {SType<:Union{BraQuantumObject,KetQuantumObject,OperatorQuantumObject}} =
0 commit comments