Skip to content
Snippets Groups Projects
Forked from kwant / website
62 commits behind the upstream repository.
install.rst 12.02 KiB

Installing Kwant

License and citation request

Kwant is free software covered by the 2-clause BSD license.

If you have used Kwant for work that has lead to a scientific publication, please cite the Kwant paper and possibly other relevant publications.

Prerequisites

In order to use Kwant you will need to install a distribution of the Python language. If you are using a GNU/Linux operating system this should already be installed on your computer.

If you are using Mac OS X or Microsoft Windows you will need to install a Python distribution yourself. Details of how to do this are in the installation instructions of the corresponding platform.

Kwant version 1.2 and newer requires at least Python 3.4.

Those who must use Python 2 can still use Kwant up to version 1.1, which will receive bug fixes for several years after 2015 (but no new features).

The instructions below assume Python 3. They should be also valid for Python 2 if all occurrences of python3, pip3, etc. are replaced by python, pip.

Choose your plaform

Installation instructions are available for the major operating systems:

GNU/Linux

Pre-built packages exist for the following distributions:

We also provide conda packages for users of the Anaconda Python distribution. This is a useful option if you do not have root privileges on the machine where you would like to install Kwant (e.g. on a computing cluster).

If your distribution is not listed above, and you do not want to use the conda packages, you can always install Kwant using pip. Or by directly building from source.

Debian and derivatives

The easiest way to install Kwant on a Debian system is using the pre-built packages we provide. Our packages are known to work with Debian "stable" and Debian "testing", but they may also work on many other recent Debian-derived systems as well. (For example, the following works with recent Ubuntu versions, too.)

The lines prefixed with sudo have to be run as root.

  1. Add the following lines to /etc/apt/sources.list:

    deb http://downloads.kwant-project.org/debian/ stable main
    deb-src http://downloads.kwant-project.org/debian/ stable main
  2. (Optional) Add the OpenPGP key used to sign the repositories by executing:

    sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-key C3F147F5980F3535

    The fingerprint of the key is 5229 9057 FAD7 9965 3C4F 088A C3F1 47F5 980F 3535.

  3. Update the package data, and install Kwant:

    sudo apt-get update
    sudo apt-get install python3-kwant python-kwant-doc

    The python-kwant-doc package is optional and installs the HTML documentation of Kwant in the directory /usr/share/doc/python-kwant-doc.

Should the last command (apt-get install) fail due to unresolved dependencies, you can try to build and install your own packages:

cd /tmp

sudo apt-get build-dep tinyarray
apt-get source --compile tinyarray
sudo dpkg --install python3-tinyarray_*.deb

sudo apt-get build-dep kwant
apt-get source --compile kwant
sudo dpkg --install python3-kwant_*.deb python-kwant-doc_*.deb

This method should work for all Debian-derived systems, even on exotic architectures.

Ubuntu and derivatives

The easiest way to install Kwant on a Debian system is using the pre-built packages we provide. Execute the following commands in a terminal:

sudo apt-add-repository -s ppa:kwant-project/ppa
sudo apt-get update
sudo apt-get install python3-kwant python-kwant-doc

This should provide Kwant for all versions of Ubuntu >= 12.04. The HTML documentation will be installed locally in the directory /usr/share/doc/python-kwant-doc.

Arch Linux

Arch install scripts for Kwant are kindly provided by Jörg Behrmann (formerly by Max Schlemmer). To install, follow the Arch User Repository installation instructions. Note that for checking the validity of the package you need to add the key used for signing to your user's keyring via:

gpg --keyserver pool.sks-keyservers.net --recv-key C3F147F5980F3535

The fingerprint of the key is 5229 9057 FAD7 9965 3C4F 088A C3F1 47F5 980F 3535.