Skip to content

Instantly share code, notes, and snippets.

@johnrichardrinehart
Created June 27, 2017 21:44
Show Gist options
  • Save johnrichardrinehart/8dc91b638627d26fa6d9e30e40feb0d1 to your computer and use it in GitHub Desktop.
Save johnrichardrinehart/8dc91b638627d26fa6d9e30e40feb0d1 to your computer and use it in GitHub Desktop.
A plot of a cat state |3> + |-3> for PHYS776 (Resch, Spring 2017) - Assignment 2, Problem 5
import Plots
Plots.plotly()
function f(B)
return function (a,b)
(2/pi)*(
2*e^(-2*(a^2+b^2))*cos(4*b*B)
+
e^(-2*((a+B)^2+b^2))*(1+e^(8*a*B))
)
end
end
x = y = -4:1e-1:4
Plots.plot(x,y,f(3),linetype=:surface)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment