QuantumStatePlots

Documentation for QuantumStatePlots.

About

Render Wigner function

Based on the definition of Wigner function in Fock basis:

\[W_{mn}(x, p) = \frac{1}{2\pi} \int_{-\infty}^{\infty} dy \, e^{-ipy/h} \psi_m^*(x+\frac{y}{2}) \psi_n(x-\frac{y}{2})\]

Owing to the fact that the Moyal function is a generalized Wigner function. We can therefore implies that

\[W(x, p) = \sum_{m, n} \rho_{m, n} W_{m, n}(x, p)\]

Here, $\rho$ is the density matrix of the quantum state, defined as:

\[\rho = \sum_{m, n, i} \, p_i \, | n \rangle \langle n | \hat{\rho}_i | m \rangle \langle m |\]

\[\hat{\rho}_i = | \psi_i \rangle \langle \psi_i |\]

\[\hat{\rho}_i \, \text{is a density operator of pure state.}\]

And, $W_{m, n}(x, p)$ is the generalized Wigner function

\[W_{m, n} = \{ \begin{array}{rcl} \frac{1}{\pi} exp[-(x^2 + y^2)] (-1)^m \sqrt{2^{n-m} \frac{m!}{n!}} (x-ip)^{n-m} L_m^{n-m} (2x^2 + 2p^2), \, n \geq m \\ \frac{1}{\pi} exp[-(x^2 + y^2)] (-1)^n \sqrt{2^{m-n} \frac{n!}{m!}} (x+ip)^{m-n} L_n^{m-n} (2x^2 + 2p^2), \, n < m \\ \end{array}\]

Example

The quantum state and its wigner function:

julia> using QuantumStateBase

julia> ρ = SqueezedState(0.8, π/8, Matrix, dim=100)

julia> w = wigner(ρ, LinRange(-3, 3, 101), LinRange(-3, 3, 101));

Wigner function

Surface

julia> using QuantumStatePlots, Plots

julia> surface(w)

Heatmap

julia> using QuantumStatePlots, Plots

julia> heatmap(w)

Contour

julia> using QuantumStatePlots, Plots

julia> contour(w)

Density matrix

Real part

julia> using QuantumStatePlots, Plots

julia> plot_real(ρ, 35)

Imag part

julia> using QuantumStatePlots, Plots

julia> plot_imag(ρ, 35)

Reference

Index

APIs

Plots.contourMethod
Plots.contour(w::WignerSurface; kwargv...)

Plot Wigner function in contour.

source
Plots.heatmapMethod
Plots.heatmap(w::WignerSurface; kwargv...)

Plot Wigner function in heatmap.

source
Plots.surfaceMethod
Plots.surface(w::WignerSurface; kwargv...)

Plot Wigner function in surface.

source
QuantumStatePlots.plot_imagFunction
plot_imag(ρ, [truncate::Integer]; kwargv...)

Plot imag part of a density matrix.

Arguments

  • truncate: Truncate photon number
source
QuantumStatePlots.plot_realFunction
plot_real(ρ, [truncate::Integer]; kwargv...)

Plot real part of a density matrix.

Arguments

  • truncate: Truncate photon number
source