Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 229
Kernel: R (R-Project)

demos?

import qutip
from qutip import * a = destroy(3)
a

Quantum object: dims = [[3], [3]], shape = (3, 3), type = oper, isherm = FalseParseError: KaTeX parse error: Unknown column alignment: * at position 38: …(\begin{array}{*̲{11}c}0.0 & 1.0…

a*a

Quantum object: dims = [[3], [3]], shape = (3, 3), type = oper, isherm = FalseParseError: KaTeX parse error: Unknown column alignment: * at position 38: …(\begin{array}{*̲{11}c}0.0 & 0.0…

Demo Notebook!

2 + 289
291
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
import sys sys.executable
'/ext/anaconda5/bin/python3'

3-d plot

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()
Image in a Jupyter notebook
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)]'
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>]
Image in a Jupyter notebook