qojulia / QuantumOptics.jl

Library for the numerical simulation of closed as well as open quantum systems.
http://qojulia.org
Other
518 stars 101 forks source link

Phase shift in wignersu2()? #305

Closed kimkyngt closed 3 years ago

kimkyngt commented 3 years ago

It seems like there is a pi phase shift on azimuthal coordinates in the function wignersu2(). I guess it is from -pi on the second argument of the following line. https://github.com/qojulia/QuantumOptics.jl/blob/bc7cd56b94b72904bceec9458ede618c4fb0f666/src/phasespace.jl#L468

Also try

    using QuantumOptics, Plots
N = 30
θ = range(0, π, length = N)
ϕ = range(0, 2π, length  = 2*N)

ψ = coherentspinstate(SpinBasis(8//2), 3π/4, 0)

W = wignersu2(ψ, N)
heatmap(ϕ, θ, W)

In the heatmap, I think, the Wigner function should not be at the center since \phi starts from 0. Or is it shifted for some purpose?

btw, thanks for the nice package. I've been practicing some basics of quantum optics, and the package helps a lot.

david-pl commented 3 years ago

@karolpezet could you look into this?

karolpezet commented 3 years ago

Hi kimkyngt!

The definition of the coherent state in the package is: coherentspinstate(b::SpinBasis, θ::Real, ϕ::Real). The parametrization follows the standard parametrization of a sphere. This is ψ = coherentspinstate(SpinBasis(8//2), π/2, 0) is an eigenstate of the collective spin operator in the x direction. The su(2) Wigner function is constructed in such a way that the x axis points out of the display (the additional pi shift). You may want to look at the example with the quantum kicked top https://docs.qojulia.org/examples/quantum-kicked-top/

HTH ^_^

kimkyngt commented 3 years ago

Hi karolpezet!

I see. It is for the display. I find Dowling, et. al. also use \phi \in [-\pi, \pi). I can fix the the axis label just like the kicked-top example.

Thanks!