Author: J. R. Johansson (robert@riken.jp), https://jrjohansson.github.io/
This lecture series was developed by J.R. Johannson. The original lecture notebooks are available here.
This is a slightly modified version of the lectures, to work with the current release of QuTiP. You can find these lectures as a part of the qutip-tutorials repository. This lecture and other tutorial notebooks are indexed at the QuTiP Tutorial webpage.
import matplotlib.pyplot as plt
import numpy as np
from IPython.display import display
from qutip import (about, basis, coherent, coherent_dm, displace, fock, ket2dm,
plot_wigner, squeeze, thermal_dm)
%matplotlib inline
N = 20
def plot_wigner_2d_3d(psi):
fig = plt.figure(figsize=(17, 8))
ax = fig.add_subplot(1, 2, 1)
plot_wigner(psi, fig=fig, ax=ax, alpha_max=6)
ax = fig.add_subplot(1, 2, 2, projection="3d")
plot_wigner(psi, fig=fig, ax=ax, projection="3d", alpha_max=6)
plt.close(fig)
return fig
psi = basis(N, 0)
plot_wigner_2d_3d(psi)
psi = thermal_dm(N, 2)
plot_wigner_2d_3d(psi)
psi = coherent(N, 2.0)
plot_wigner_2d_3d(psi)