Appendix B — From classical densities to the Wigner function
So far we have:
a probability density\(\rho(x,p,t)\) for classical ensembles, obeying Liouville’s equation;
a wavefunction\(\psi(x,t)\) or a density operator\(\hat\rho\) for quantum systems, obeying the Schrödinger/von Neumann equations.
The Wigner function builds a bridge between these two pictures.
It lives in phase space like \(\rho(x,p)\), yet it is derived from \(\hat\rho\) and keeps all quantum information.
B.1 Definition
For a one–dimensional system the Wigner function is
In Chapter 7 we solved the Liouville equation for a classical nonlinear oscillator with Hamiltonian
\[
H = \frac{p^2}{2m} + \frac{1}{2} k x^2 + g x^4.
\tag{B.2}\]
Moreover, in Chapter 10 we solved the Schrödinger equation using QuTiP for aq simple harmonic oscillator. We now combine these two approaches to study the quantum nonlinear oscillator with Hamiltonian Equation B.2, but with the quantum operator\(\hat x\) and \(\hat p\) instead of the classical variables \(x\) and \(p\).
import numpy as npfrom qutip import*N =120m =0.5# Mass of the particlek =2.0# Spring constantG =0.15# Nonlinear constantw = np.sqrt(k/m) # Angular frequencya = destroy(N)x = np.sqrt(m * w /2) * (a + a.dag())p =1j* np.sqrt(m * w /2) * (a.dag() - a)H = p**2/ (2* m) + k * x**2/2+ G * x**4# Initial state: coherent statealpha = np.sqrt(1/ (2* m * w)) *1+1j* np.sqrt(m * w /2) *0.1psi_0 = coherent(N, alpha)tlist = np.linspace(0, 2, 500)result = sesolve(H, psi_0, tlist)result
<Result
Solver: sesolve
Solver stats:
method: 'scipy zvode adams'
init time: 0.00020766258239746094
preparation time: 0.00016641616821289062
run time: 0.9459991455078125
solver: 'Schrodinger Evolution'
Time interval: [0.0, 2.0] (500 steps)
Number of e_ops: 0
States saved.
>
The Wigner function can be computed from the resulting state using QuTiP’s wigner function. Let’s plot its evolution over time: