wigner_spectral
Graham Dennis
Simulation of the Wigner function for an anharmonic oscillator with the initial state being a coherent state.

This is a modification of wigner.xmds to be more like a true spectral method by evaluating the temporal derivatives in spectral (fourier) space. This script runs faster than the original wigner.xmds

WARNING: This simulation will take a couple of hours.
/* physical constants */ const real hbar = 1.05457148e-34;

/* system constants */ const real omega = 0.0; const real Uint = 1.0*hbar;

/* initial state constants */ const real alpha_0 = 3.0;

/* used for calculating constants derived from arguments */ bool firstTime = true;

/* absorbing boundary constants */ const real absorb = 8.0; const real width = 0.3;

/* derived constants */ const complex miOmega = -i*omega; const complex miUint_hbar = -i*Uint/hbar; const real Uint_hbar = Uint/hbar;
t
W
W = 2.0/M_PI * exp(-2.0*(y*y + (x-alpha_0)*(x-alpha_0)));
damping
real r = sqrt(x*x + y*y);

if (r > _max_x-width) damping = 0.0; else damping = 1.0;
200
Lx Ly LxR LyR
real r2 = x*x + y*y; if (r2 > (_max_x-width)*(_max_x-width)) { Lx = Ly = LxR = LyR = 0.0; } else { Lx = x; Ly = y; LxR = x*(r2-1.0); LyR = y*(r2-1.0); }
main
dW_dt = -i*omega*(kx*Ly[W] - ky*Lx[W]) -i*Uint_hbar*(kx*LyR[W] - ky*LxR[W]) -i*Uint_hbar/16.0*((kx*kx*kx+ky*ky*kx)*Ly[W] - (ky*ky*ky + ky*kx*kx)*Lx[W]);
WR WI
main
WR = W.Re(); WI = W.Im();