--A python package specializing in quantum state simulation, quantum tomography, etc. --It works with Python 2.7+.
Quoted from qutip.org
QuTiP is open-source software for simulating the dynamics of open quantum systems. The QuTiP library depends on the excellent Numpy, Scipy, and Cython numerical packages. In addition, graphical output is provided by Matplotlib. QuTiP aims to provide user-friendly and efficient numerical simulations of a wide variety of Hamiltonians, including those with arbitrary time-dependence, commonly found in a wide range of physics applications such as quantum optics, trapped ions, superconducting circuits, and quantum nanomechanical resonators. QuTiP is freely available for use and/or modification on all major platforms such as Linux, Mac OSX, and Windows*. Being free of any licensing fees, QuTiP is ideal for exploring quantum mechanics and dynamics in the classroom.
QuTiP is open source software for simulating the dynamics of open quantum systems. The QuTiP library relies on the excellent math libraries Numpy, Scipy, Cython. Also, the drawing output is provided by Matplotlib. QuTiP aims to provide easy-to-use and efficient numerical simulations of a wide variety of Hamiltonians, including arbitrary time dependence, commonly found in a wide range of physics applications such as quantum optics, ion traps, superconducting circuits, and quantum name resonators. It is said. QuTiP is freely available for use and / or modification on all major platforms such as Linux, Mac OS X and Windows *. QuTiP, which does not include any license fee, is ideal for exploring quantum mechanics and dynamics, such as in lectures.
--I tried to use python3, but it doesn't work, so I need to use python2. --Reason: python2 is the only QuTiP version supported by conda
--Open Anaconda Prompt and get the information to install QuTiP with the following command
$ anaconda search -t conda qutip
$ conda install -c https://conda.anaconda.org/ajgpitch qutip
--Required to use Bloch3d ()
$ conda install -c https://conda.anaconda.org/menpo mayavi
--Using IPython, it is possible to perform calculations on the prompt, but it is troublesome to define a function every time. --PyCharm is recommended as an IDE for writing and executing scripts. ――It is recommended for students as it can be used free of charge by students.
--Sample code
from mayavi import mlab
import numpy as np
from qutip import *
import matplotlib.pyplot as plt
mlab.test_contour3d()
b = Bloch()
b3d = Bloch3d()
vec = [0, 1, 0]
pnt = [1/np.sqrt(3), 1/np.sqrt(3), 1/np.sqrt(3)]
up = basis(2, 0)
b.add_vectors(vec)
b.add_points(pnt)
b.add_states(up)
b.show()
# state generation
N = 20
rho_coherent = coherent_dm(N, np.sqrt(2))
rho_thermal = thermal_dm(N, 2)
rho_fock = fock_dm(N, 2)
xvec = np.linspace(-5,5,200)
W_coherent = wigner(rho_coherent, xvec, xvec)
W_thermal = wigner(rho_thermal, xvec, xvec)
W_fock = wigner(rho_fock, xvec, xvec)
# fig config
fig, axes = plt.subplots(1, 3, figsize=(12, 3))
cont0 = axes[0].contourf(xvec, xvec, W_coherent, 100)
lbl0 = axes[0].set_title("Coherent state")
cont1 = axes[1].contourf(xvec, xvec, W_thermal, 100)
lbl1 = axes[1].set_title("Thermal state")
cont2 = axes[2].contourf(xvec, xvec, W_fock, 100)
lbl2 = axes[2].set_title("Fock state")
plt.show()
I was able to plot successfully: sushi:
Recommended Posts