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: ext/QuantumToolboxCairoMakieExt.jl
+65-5Lines changed: 65 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -24,8 +24,8 @@ Note that CairoMakie must first be imported before using this function.
24
24
# Arguments
25
25
- `library::Val{:CairoMakie}`: The plotting library to use.
26
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).
27
-
- `xvec::AbstractVector`: The x-coordinates of the phase space grid. Default is # TODO
28
-
- `yvec::AbstractVector`: The y-coordinates of the phase space grid. Default is # TODO
27
+
- `xvec::AbstractVector`: The x-coordinates of the phase space grid. Defaults to a linear range from -7.5 to 7.5 with 200 points.
28
+
- `yvec::AbstractVector`: The y-coordinates of the phase space grid. Defaults to a linear range from -7.5 to 7.5 with 200 points.
29
29
- `g::Real`: The scaling factor related to the value of ``\hbar`` in the commutation relation ``[x, y] = i \hbar`` via ``\hbar=2/g^2``.
30
30
- `method::WignerSolver`: The method used to calculate the Wigner function. It can be either `WignerLaguerre()` or `WignerClenshaw()`, with `WignerClenshaw()` as default. The `WignerLaguerre` method has the optional `parallel` and `tol` parameters, with default values `true` and `1e-14`, respectively.
31
31
- `projection::Union{Val,Symbol}`: Wheather to plot the Wigner function in 2D or 3D. It can be either `Val(:two_dim)` or `Val(:three_dim)`, with `Val(:two_dim)` as default.
@@ -44,8 +44,8 @@ Note that CairoMakie must first be imported before using this function.
Copy file name to clipboardExpand all lines: src/visualization.jl
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,9 @@ The `library` keyword argument specifies the plotting library to use, defaulting
15
15
- `state::QuantumObject{<:AbstractArray{T},OpType}`: The quantum state for which to plot the Wigner distribution.
16
16
- `library::Union{Val,Symbol}`: The plotting library to use. Default is `Val(:CairoMakie)`.
17
17
- `kwargs...`: Additional keyword arguments to pass to the plotting function. See the documentation for the specific plotting library for more information.
18
+
19
+
!!! warning "Beware of type-stability!"
20
+
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.
0 commit comments