For now QmeQ can be installed by building it from source. To be able to use and build QmeQ you need to have:
- Python 2.7 or 3.0 with setuptools installed,
- Cython 0.22 and a C compiler compatible with it,
- NumPy package,
- SciPy package.
The indicated versions are the minimal required versions. Optionally, such packages are used:
- Matplotlib for plotting,
- Jupyter for the tutorials.
An easy way to obtain the above packages is by using Python package manager pip. After setting up pip the above packages can be obtained by using the following command
$ pip install cython, numpy, scipy, matplotlib, jupyter
QmeQ is installed by going into the downloaded source directory and running
$ python setup.py install
We note that the binaries pip and python have to be in the system path.
For Linux and Mac we recommend to use the C compiler in the conventional gcc suite, which will be recognized by Cython. For Windows the Visual Studio or Windows SDK C/C++ compiler can be used and more instructions how to setup these compilers to work with Cython are available here.
The 32-bit gcc compiler can be used on Windows with 32-bit Python 2.7. This can be achieved by using the gcc compiler in MinGW suite by adding
[build]
compiler = mingw32
to 'path to python'\Lib\distutils\distutils.cfg. If the file does not exist then simply create it. We note that instead of using the actual MinGW it is possible to use Python package Mingwpy, which can be obtained using
$ pip install -i https://pypi.anaconda.org/carlkl/simple mingwpy
For a good performance of the calculations NumPy needs to be linked to so-called ATLAS, OpenBLAS, or MKL libraries. To check if NumPy is linked go to Python interpreter and write
import numpy
numpy.show_config()
If all of the entries like atlas_info, openblas_info, or mkl_info says NOT AVAILABLE then it is likely that your NumPy does not perform well.
For Windows the NumPy and SciPy libraries linked to MKL can be obtained from Unofficial Windows Binaries for Python Extension Packages by Christoph Gohlke.
To run the tests included with QmeQ we use
- py.test testing framework.
To install it run
$ pip install pytest
Then the tests can be performed by calling
$ cd 'path to qmeq source'/qmeq
$ pytest tests
For now QmeQ contains just the documentation generated from docstrings in the source code. The QmeQ documentation can be generated in html, latex, and other formats using
- Sphinx 1.3 package,
- sphinx-rtd-theme Read the Docs Sphinx theme.
To install the above packages run
$ pip install sphinx, sphinx-rtd-theme
For example, to generate the documentation in html format run
$ cd 'path to qmeq source'/docs
$ make html
The generated documentation should be in 'path to qmeq source'/docs/build/index.html