Installation (Linux)

Prerequisites

You need to install the following (mandatory) packages:

  • Python
  • Numpy
  • Scipy
  • Sympy
  • BLAS
  • LAPACK
  • Matplotlib

We also suggest the following (optional) packages:

  • IPython
  • OpenMPI (necessary for parallel calculations on several CPUs or computers)
  • Pip
  • Git
  • mpi4py (also necessary for parallel calculations)

Simple installation

If you are using Ubuntu or Debian (or an other Debian-based distribution), run on the command line:

sudo apt-get install libblas-dev liblapack-dev python python-numpy python-scipy python-sympy python-matplotlib python-setuptools

For the optional packages, run:

sudo apt-get install ipython ipython-notebook openmpi-bin openmpi-doc libopenmpi-dev git python-pip
sudo pip install mpi4py

Optimized installation

To optimize the calculation speed, you need to manually install BLAS and LAPACK and link Numpy appropriately. Popular packages for optimized BLAS/LAPACK are Intel MKL (download, Numpy installation guide, Numpy installation guide 2) and ATLAS (download, Numpy installation guide).

After that, run the commands from Simple installation with omitted libblas-dev, liblapack-dev and python-numpy.

Installation on a cluster

All mandatory packages are standard packages and are probably already installed (as well as the MPI related packages). The program will tell you at the first start if something is missing - please consult your cluster administrator.

Setup

The git repository is located at https://github.com/zonksoft/envTB. On the command line, change to a directory where you want to save the envTB sources and run:

wget https://github.com/zonksoft/envTB/archive/master.tar.gz
tar xzvf master.tar.gz
cd envTB-master
sudo python setup.py install

If you don’t have sudo rights, run:

python setup.py install --user

instead of the last command.

If you change the code in the directory where you downloaded envTB, you have to reissue the installation command.

If you don’t want to install envTB, but rather just use it from the directory where you downloaded it, add:

export PYTHONPATH=/where/you/downloaded/envTB/envTB-master/envtb:$PYTHONPATH

to the .bashrc file in your home directory.

Usage

There are several ways how you can use envTB to do your calculations.

Use the Python command line interpreter

Run python from the command line. This starts the interactive python interpreter where you can type in all the commands you find in the documentation.

Use IPython

Run ipython from the command line. It basically works like the Python interpreter, but has some neat features like autocompletion, built-in documentation and a history.

Use the IPython web frontend

Run ipython notebook --pylab=inline and go to the URL printed on the terminal. It is a convenient, Mathematica-like user interface which you can also access from other computers.

Run a .py file from the command line

If you have a complete calculation saved in a .py file, run:

python myfile.py

Access the built-in documentation

Besides this documentation, envTB has a built in documentation. You can access it using the pydoc command, e.g.:

pydoc envtb.simple

If you are using IPython, you can see the documentation of a class or a function by appending a ? behind the class or function name and executing the command.

Parallelization

If you use a function which supports MPI parallelization and installed OpenMPI and mpi4py, you can enable the parallelization by running:

mpirun -np 4 python myfile.py

-np 4 means that you start 4 parallel processes on your computer. If you want to parallelize over computers, please consult your cluster administrator.

Functions which support parallelization:

  • Hamiltonian.plot_bandstructure
  • Hamiltonian.bandstructure_data

Table Of Contents

Previous topic

Welcome to EnvTB’s documentation!

Next topic

Installation (Windows)

This Page