[PYTHON] Use QuTiP on Windows

Tips for using QuTiP on Windows

What is QuTiP?

--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.

Installation of Anaconda

--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

Install QuTiP

--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

install mayavi

--Required to use Bloch3d ()

$ conda install -c https://conda.anaconda.org/menpo mayavi

Install PyCharm

--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.

at the end

--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: figure_1.png

Recommended Posts

Use QuTiP on Windows
Use pyvenv on Windows
Use Ansible on Windows
Use pip on Windows
Use Python on Windows (PyCharm)
Use Linux on Windows 10 (WSL2)
How to use Dataiku on Windows
Use Tensorflow 2.1.0 with Anaconda on Windows 10!
Python on Windows
Use without installing python 2.x on Windows
Pylint on Windows Atom
Linux (WSL) on Windows
Anaconda on Windows Terminal
Install Anaconda on Windows 10
Install python on windows
Install pycuda on Windows10
Build TensorFlow on Windows
Build XGBoost on Windows
Install pygraphviz on Windows 10
Try Poerty on Windows
Install Chainer 1.5.0 on Windows
[Windows] Memo to use Keras on GPU [Tensorflow-GPU]
Install Numpy on virtualenv on Windows
Run Jupyter on Ubuntu on Windows
Run Openpose on Python (Windows)
Use matplotlib on Ubuntu 12 & Python
Install watchdog on Windows + Python 3.3
Install Win-Kex (kali-linux) on Windows 10.
Use music21 on Google Colaboratory
Before trying Veriloggen on Windows
Install cvxpy on windows, Anaconda
Prepare Chainer environment on Windows
Use Github Desktop on Linux
Try using OpenCV on Windows
F2py on Miniconda for Windows
Use Windows 10 fonts with WSL
Make Cython available on Windows.
Fastest Python installation on Windows
Operate ubuntu on VScode (windows10)
Build Python environment on Windows
Django environment development on Windows 10
Build python environment on windows
Set up Polyglot on Windows
Linux on Windows -1-: debian introduction
Use matplot libwidget on mac
Use sshpass on Amazon linux2
I ran python on windows
[Tensorflow] Tensorflow environment construction on Windows 10
Notes on installing Anaconda 3 on Windows
[Python] [Chainer] [Windows] Install Chainer on Windows
Run Jupyter Notebook on windows
Use NeoPixel on Raspberry Pi
Blogging with Pelican on Windows
How to use VS Code in venv environment on windows
Print PDF in Python on Windows: Use an external application
Use Xming to launch an Ubuntu GUI application on Windows.
Use host.docker.internal on linux (docker-compose required)
Use httpie from windows git bash
Python environment construction memo on Windows 10
Use Numpy, Scipy, scikit-learn on Heroku
Remove ubuntu installed on Windows 10 machine