forked from qutip/qutip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL.txt
164 lines (110 loc) · 7.51 KB
/
INSTALL.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
################################
# QuTiP INSTALLATION GUIDE
# Version: 3.0.0
# P.D. Nation and J.R. Johansson
################################
A complete guide may be found at http://qutip.org
GENERAL REQUIREMENTS
********************
Package Version Details
------- ------- --------
Python 2.7+ Including version 3.
Numpy 1.6+ Requires new array creation methods.
Scipy 0.11+ Some routines not available/fail on lower versions.
Matplotlib 1.2+ Some plotting routines do not work on lower versions.
GCC Compiler 4.2+ Needed for compiling c-code files used for ODE solvers.
Python Headers 2.7+ LINUX ONLY. Needed for compiling c-code files.
Cython 0.15+ Needed for compiling list-string format time-dependent Hamiltonians.
BLAS Libs 1.2+ Optional. Needed to install Fortran based monte-carlo solver.
Mayavi 4.1+ Optional. Needed for 3D Bloch sphere only.
LaTex Texlive 2009+ Optional. Needed if using LaTex in figure labels.
nose 1.1.2+ Optional. Needed to run the test scripts.
INSTALLATION
************
On all platforms (Linux, Mac, Windows), QuTiP works "out-of-the-box" using the Anaconda CE: https://store.continuum.io/cshop/anaconda. This distribution is created by the developers of Numpy, and is free for both commercial and noncommercial use.
As of version 2.2, QuTiP includes an optional Fortran-based Monte Carlo solver that has a substantial performance benefit when compared with the Python-based solver. In order to install this package you must have a Fortran compiler (for example gfortran) and BLAS development libraries. At present, these packages are only tested on the Linux and OS X platforms.
UBUNTU LINUX (RECOMMENDED PLATFORM FOR QUTIP)
=============================================
Ubuntu PPA
----------
The easiest way to install QuTiP in Ubuntu (12.04 and later) is to use the QuTiP PPA:
>>> sudo add-apt-repository ppa:jrjohansson/qutip-releases
>>> sudo apt-get update
>>> sudo apt-get install python-qutip
With this method the most important dependencies are installed automatically, and when new version of QuTiP is released it can be upgraded through the standard package management system. In addition to the required dependencies, it is also strongly recommended that you install the texlive-latex-extra package.
Manual Installation
-------------------
First install the following dependency packages:
>>> sudo apt-get install python-scipy
>>> sudo apt-get install python-pyside
>>> sudo apt-get install python-setuptools
>>> sudo apt-get install python-dev
>>> sudo apt-get install python-matplotlib
>>> sudo apt-get install cython
>>> sudo apt-get install python-nose # recommended, for testing
>>> sudo apt-get install texlive-latex-extra # recommended
>>> sudo apt-get install libblas-dev # optional, for Fortran Monte Carlo solver
>>> sudo apt-get install mayavi2 # optional, for Bloch3d only
Ubuntu 11.04 and lower do not have Matplotlib>=1.1, and we therefore need to add the unofficial repository (in Ubuntu 11.10+, skip this step)
>>> sudo add-apt-repository ppa:bgamari/matplotlib-unofficial
>>> sudo apt-get update
before running
>>> sudo apt-get install python-matplotlib
Install QuTiP
-------------
For a standard installation, run this command in the QuTiP source code directory:
>>> sudo python setup.py install
To install QuTiP with the optional Fortran Monte Carlo function use:
>>> sudo python setup.py install --with-f90mc
APPLE MAC OSX (10.6+)
======================
If you have not done so already, install the Apple XCode developer tools from the Apple App Store.
After intallation, open Xcode and go to: Preferences -> Downloads, and install the ‘Command Line Tools’.
MacPorts
--------
On the Mac, it is recommended that you install the required libraries via MacPorts.
After installation, the necessary “ports” for QuTiP may be installed using:
>>> sudo port install py27-scipy
>>> sudo port install py27-matplotlib +latex
>>> sudo port install py27-cython
Finally, at your option, you can install the following packages:
>>> sudo port install py27-ipython +notebook+parallel #ipython
>>> sudo port install vtk5 +python27 #used for the Bloch3d class
>>> sudo port install py27-mayavi #used for the Bloch3d class
Now, we want to tell OSX which Python and iPython we are going to use::
>>> sudo port select python python27
>>> sudo port select ipython ipython27
SciPy Superpack
---------------
A second option is to install the required Python packages using the SciPy Superpack. Further information on installing the superpack can be found on the SciPy Downloads page. Note that, if you choose this option, the GUI elements of QuTiP will not be available without further installing either the PyQt4 or PySide packages separately.
Anaconda CE Distribution
-----------------------------
Finally, one can also use the Anaconda CE: https://store.continuum.io/cshop/anaconda to satisfy the QuTiP dependencies.
Install QuTiP
-------------
No matter which installation path you choose, installing a standard QuTiP installation is the same as on linux. From the QuTiP directory run::
>>> sudo python setup.py install
In order to install the Fortran Monte Carlo solver (when running macports) use the following command::
>>> sudo python setup.py install --with-f90mc
However, this additionally requires a Fortran compiler to be installed. For
example the GNU Fortran compiler, which can be installed using:
>>> sudo apt-get install gfortran
Installation on Windows
========================
QuTiP is primarily developed for Unix-based platforms such as Linux an Mac OS X, but it can also be used on Windows. We have limited experience and ability to help troubleshoot problems on Windows, but the following installation steps have been reported to work:
1. Install the Python(X,Y): http://code.google.com/p/pythonxy/ distribution (tested with version 2.7.3.1). Other Python distributions, such as Enthought Python Distribution: http://www.enthought.com/products/epd.php or Anaconda CE: http://continuum.io/downloads.html might work too, but this has not been verified.
2. When installing Python(x,y), explicitly select to include the Cython package in the installation. This package is not selected by default.
3. Add the following content to the file `C:/Python27/Lib/distutils/distutils.cfg` (or create the file if it does not already exists)::
[build]
compiler = mingw32
[build_ext]
compiler = mingw32
The directory where the distutils.cfg file should be placed might be different if you have installed the Python environment in a different location than in the example above.
4. Obtain the QuTiP source code, unpack it and run the following command in the source code directory::
python setup.py install
VERIFY INSTALLATION
*******************
QuTiP now includes a collection of built-in test scripts to verify that the installation was indeed successful. To run the suite of tests scripts, after installing QuTiP, from the Python command line (or IPython) call:
>>> import qutip.testing as qt
>>> qt.run()
If successful, these tests indicate that all of the QuTiP functions are working properly. If any errors occur, please check that your have installed all of the required modules. If these tests still fail, then head over to the QuTiP Discussion Board and post a message detailing your particular issue.