CoCalc Public Files2018-07-26-140117.ipynbOpen with one click!
Authors: John Jeng, Harald Schilly, ℏal Snyder, William A. Stein
Views : 109
Compute Environment: Ubuntu 18.04 (Deprecated)

demos?

In [ ]:
In [12]:
import qutip
In [21]:
from qutip import * a = destroy(3)
In [22]:
a
Quantum object: dims = [[3], [3]], shape = (3, 3), type = oper, isherm = False
In [24]:
a*a
Quantum object: dims = [[3], [3]], shape = (3, 3), type = oper, isherm = False

Demo Notebook!

In [10]:
2 + 289
291
In [8]:
import time, sys for i in range(10): print(i) sys.stdout.flush() time.sleep(1)
0 1 2 3 4 5 6 7 8 9
In [2]:
import sys sys.executable
'/ext/anaconda5/bin/python3'

3-d plot

In [2]:
import numpy as np from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm # Silly example data X = np.arange(-5, 5, 0.25) Y = np.arange(-5, 5, 0.25) X, Y = np.meshgrid(X, Y) R = np.sqrt(X**2 + Y**2) Z = np.sin(R) # Make the plot fig = plt.figure() ax = fig.gca(projection="3d") surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.coolwarm, linewidth=0, antialiased=False) ax.set_zlim(-1.01, 1.01) fig.colorbar(surf, shrink=0.5, aspect=5) plt.show()
In [3]:
sys.version
'3.6.5 | packaged by conda-forge | (default, Apr 6 2018, 13:39:56) \n[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)]'
In [1]:
import matplotlib.pyplot as plt plt.plot([3,2,3,2,3,2,1,2,3,2,3,2,1,2,3,2])
[<matplotlib.lines.Line2D at 0x7fce2d596940>]
In [ ]: