Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • kwant/website
  • jbweston/website
  • basnijholt/website
  • r-j-skolasinski/website
  • marwahaha/website
5 results
Show changes
Commits on Source (160)
Showing
with 1835 additions and 900 deletions
*~
*.pyc
/catalog.yaml
.doit.db
cache/
output/
image: kwant/website-deploy
before_script:
- nikola build
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- eval $(ssh-agent -s)
test_deploy:
script:
- echo "$TEST_WEBSITE_KEY" | tr -d '\r' | ssh-add -
- nikola deploy
except:
- master
master_deploy:
script:
- echo "$MASTER_WEBSITE_KEY" | tr -d '\r' | ssh-add -
- nikola deploy master
only:
- master
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
# !! This is the configuration of Nikola. !! #
# !! You should edit it to your liking. !! #
# ! Some settings can be different in different languages.
# ! A comment stating (translatable) is used to denote those.
# ! There are two ways to specify a translatable setting:
# ! (a) BLOG_TITLE = "My Blog"
# ! (b) BLOG_TITLE = {"en": "My Blog", "es": "Mi Blog"}
# ! Option (a) is used when you don't want that setting translated.
# ! Option (b) is used for settings that are different in different languages.
# Data about this site
BLOG_AUTHOR = "Kwant authors" # (translatable)
BLOG_TITLE = "Kwant" # (translatable)
# This is the main URL for your site. It will be used
# in a prominent link
SITE_URL = "/"
# This is the URL where Nikola's output will be deployed.
# If not set, defaults to SITE_URL
# BASE_URL = "http://kwant-project.org/"
BLOG_EMAIL = "authors@kwant-project.org"
BLOG_DESCRIPTION = "Kwant project website" # (translatable)
# Nikola is multilingual!
#
# Currently supported languages are:
#
# What is the default language?
DEFAULT_LANG = "en"
# What will translated input files be named like?
# If you have a page something.rst, then something.pl.rst will be considered
# its Polish translation.
# (in the above example: path == "something", ext == "rst", lang == "pl")
# this pattern is also used for metadata:
# something.meta -> something.pl.meta
TRANSLATIONS_PATTERN = "{path}.{lang}.{ext}"
# Links for the sidebar / navigation bar. (translatable)
# This is a dict. The keys are languages, and values are tuples.
#
# For regular links:
# ('https://getnikola.com/', 'Nikola Homepage')
#
# For submenus:
# (
# (
# ('http://apple.com/', 'Apple'),
# ('http://orange.com/', 'Orange'),
# ),
# 'Fruits'
# )
#
# WARNING: Support for submenus is theme-dependent.
# Only one level of submenus is supported.
# WARNING: Some themes, including the default Bootstrap 3 theme,
# may present issues if the menu is too large.
# (in bootstrap3, the navbar can grow too large and cover contents.)
# WARNING: If you link to directories, make sure to follow
# ``STRIP_INDEXES``. If it’s set to ``True``, end your links
# with a ``/``, otherwise end them with ``/index.html`` — or
# else they won’t be highlighted when active.
NAVIGATION_LINKS = {
DEFAULT_LANG: (
("/about.html", "<i class='glyphicon glyphicon-info-sign visible-xs-inline-block'></i>"
"<span class='hidden-xs'>about</span>"),
("/blog/index.html", "<i class='glyphicon glyphicon-bullhorn visible-xs-inline-block'></i>"
"<span class='hidden-xs'>blog</span>"),
("/install.html", "<i class='glyphicon glyphicon-download visible-xs-inline-block'></i>"
"<span class='hidden-xs'>install</span>"),
("/doc", "<i class='glyphicon glyphicon-book visible-xs-inline-block'></i>"
"<span class='hidden-xs'>documentation</span>"),
("/community.html", "<i class='glyphicon glyphicon-comment visible-xs-inline-block'></i>"
"<span class='hidden-xs'>community</span>"),
("/contribute.html", "<i class='glyphicon glyphicon-wrench visible-xs-inline-block'></i>"
"<span class='hidden-xs'>contribute</span>"),
("/cite", "<i class='glyphicon glyphicon-edit visible-xs-inline-block'></i>"
"<span class='hidden-xs'>cite</span>")
),
}
# Name of the theme to use.
THEME = "kwant"
# Below this point, everything is optional
# Post's dates are considered in UTC by default, if you want to use
# another time zone, please set TIMEZONE to match. Check the available
# list from Wikipedia:
# http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
# (e.g. 'Europe/Zurich')
# Also, if you want to use a different time zone in some of your posts,
# you can use the ISO 8601/RFC 3339 format (ex. 2012-03-30T23:00:00+02:00)
TIMEZONE = "UTC"
# If you want to use ISO 8601 (also valid RFC 3339) throughout Nikola
# (especially in new_post), set this to True.
# Note that this does not affect DATE_FORMAT.
# FORCE_ISO8601 = False
# Date format used to display post dates.
# (str used by datetime.datetime.strftime)
DATE_FORMAT = '%Y-%m-%d'
# Date format used to display post dates, if local dates are used.
# (str used by moment.js)
# JS_DATE_FORMAT = 'YYYY-MM-DD HH:mm'
# Date fanciness.
#
# 0 = using DATE_FORMAT and TIMEZONE
# 1 = using JS_DATE_FORMAT and local user time (via moment.js)
# 2 = using a string like “2 days ago”
#
# Your theme must support it, bootstrap and bootstrap3 already do.
# DATE_FANCINESS = 0
# While Nikola can select a sensible locale for each language,
# sometimes explicit control can come handy.
# In this file we express locales in the string form that
# python's locales will accept in your OS, by example
# "en_US.utf8" in Unix-like OS, "English_United States" in Windows.
# LOCALES = dict mapping language --> explicit locale for the languages
# in TRANSLATIONS. You can omit one or more keys.
# LOCALE_FALLBACK = locale to use when an explicit locale is unavailable
# LOCALE_DEFAULT = locale to use for languages not mentioned in LOCALES; if
# not set the default Nikola mapping is used.
# POSTS and PAGES contains (wildcard, destination, template) tuples.
#
# The wildcard is used to generate a list of reSt source files
# (whatever/thing.txt).
#
# That fragment could have an associated metadata file (whatever/thing.meta),
# and optionally translated files (example for Spanish, with code "es"):
# whatever/thing.es.txt and whatever/thing.es.meta
#
# This assumes you use the default TRANSLATIONS_PATTERN.
#
# From those files, a set of HTML fragment files will be generated:
# cache/whatever/thing.html (and maybe cache/whatever/thing.html.es)
#
# These files are combined with the template to produce rendered
# pages, which will be placed at
# output / TRANSLATIONS[lang] / destination / pagename.html
#
# where "pagename" is the "slug" specified in the metadata file.
#
# The difference between POSTS and PAGES is that POSTS are added
# to feeds and are considered part of a blog, while PAGES are
# just independent HTML pages.
#
POSTS = (
("posts/*.rst", "", "post.tmpl"),
)
PAGES = (
("content/*.rst", "", "story.tmpl"),
("content/*.txt", "", "story.tmpl"),
)
# One or more folders containing files to be copied as-is into the output.
# The format is a dictionary of {source: relative destination}.
# Default is:
# FILES_FOLDERS = {'files': ''}
# Which means copy 'files' into 'output'
# One or more folders containing listings to be processed and stored into
# the output. The format is a dictionary of {source: relative destination}.
# Default is:
# LISTINGS_FOLDERS = {'listings': 'listings'}
# Which means process listings from 'listings' into 'output/listings'
# A mapping of languages to file-extensions that represent that language.
# Feel free to add or delete extensions to any list, but don't add any new
# compilers unless you write the interface for it yourself.
#
# 'rest' is reStructuredText
# 'markdown' is MarkDown
# 'html' assumes the file is HTML and just copies it
COMPILERS = {
"rest": ('.rst', '.txt'),
"markdown": ('.md', '.mdown', '.markdown'),
"textile": ('.textile',),
"txt2tags": ('.t2t',),
"bbcode": ('.bb',),
"wiki": ('.wiki',),
"ipynb": ('.ipynb',),
"html": ('.html', '.htm'),
# PHP files are rendered the usual way (i.e. with the full templates).
# The resulting files have .php extensions, making it possible to run
# them without reconfiguring your server to recognize them.
"php": ('.php',),
# Pandoc detects the input from the source filename
# but is disabled by default as it would conflict
# with many of the others.
# "pandoc": ('.rst', '.md', '.txt'),
}
# Create by default posts in one file format?
# Set to False for two-file posts, with separate metadata.
# ONE_FILE_POSTS = True
# If this is set to True, the DEFAULT_LANG version will be displayed for
# untranslated posts.
# If this is set to False, then posts that are not translated to a language
# LANG will not be visible at all in the pages in that language.
# Formerly known as HIDE_UNTRANSLATED_POSTS (inverse)
# SHOW_UNTRANSLATED_POSTS = True
# Nikola supports logo display. If you have one, you can put the URL here.
# Final output is <img src="LOGO_URL" id="logo" alt="BLOG_TITLE">.
# The URL may be relative to the site root.
LOGO_URL = '/kwant_logo.png'
# If you want to hide the title of your website (for example, if your logo
# already contains the text), set this to False.
SHOW_BLOG_TITLE = False
# Writes tag cloud data in form of tag_cloud_data.json.
# Warning: this option will change its default value to False in v8!
WRITE_TAG_CLOUD = False
# Paths for different autogenerated bits. These are combined with the
# translation paths.
# Final locations are:
# output / TRANSLATION[lang] / TAG_PATH / index.html (list of tags)
# output / TRANSLATION[lang] / TAG_PATH / tag.html (list of posts for a tag)
# output / TRANSLATION[lang] / TAG_PATH / tag.xml (RSS feed for a tag)
# TAG_PATH = "categories"
# If TAG_PAGES_ARE_INDEXES is set to True, each tag's page will contain
# the posts themselves. If set to False, it will be just a list of links.
# TAG_PAGES_ARE_INDEXES = False
# Set descriptions for tag pages to make them more interesting. The
# default is no description. The value is used in the meta description
# and displayed underneath the tag list or index page’s title.
# TAG_PAGES_DESCRIPTIONS = {
# DEFAULT_LANG: {
# "blogging": "Meta-blog posts about blogging about blogging.",
# "open source": "My contributions to my many, varied, ever-changing, and eternal libre software projects."
# },
#}
# If you do not want to display a tag publicly, you can mark it as hidden.
# The tag will not be displayed on the tag list page, the tag cloud and posts.
# Tag pages will still be generated.
HIDDEN_TAGS = ['mathjax']
# Only include tags on the tag list/overview page if there are at least
# TAGLIST_MINIMUM_POSTS number of posts or more with every tag. Every tag
# page is still generated, linked from posts, and included in the sitemap.
# However, more obscure tags can be hidden from the tag index page.
# TAGLIST_MINIMUM_POSTS = 1
# Final locations are:
# output / TRANSLATION[lang] / CATEGORY_PATH / index.html (list of categories)
# output / TRANSLATION[lang] / CATEGORY_PATH / CATEGORY_PREFIX category.html (list of posts for a category)
# output / TRANSLATION[lang] / CATEGORY_PATH / CATEGORY_PREFIX category.xml (RSS feed for a category)
# CATEGORY_PATH = "categories"
# CATEGORY_PREFIX = "cat_"
# If CATEGORY_ALLOW_HIERARCHIES is set to True, categories can be organized in
# hierarchies. For a post, the whole path in the hierarchy must be specified,
# using a forward slash ('/') to separate paths. Use a backslash ('\') to escape
# a forward slash or a backslash (i.e. '\//\\' is a path specifying the
# subcategory called '\' of the top-level category called '/').
# CATEGORY_ALLOW_HIERARCHIES = False
# If CATEGORY_OUTPUT_FLAT_HIERARCHY is set to True, the output written to output
# contains only the name of the leaf category and not the whole path.
# CATEGORY_OUTPUT_FLAT_HIERARCHY = False
# If CATEGORY_PAGES_ARE_INDEXES is set to True, each category's page will contain
# the posts themselves. If set to False, it will be just a list of links.
# CATEGORY_PAGES_ARE_INDEXES = False
# Set descriptions for category pages to make them more interesting. The
# default is no description. The value is used in the meta description
# and displayed underneath the category list or index page’s title.
# CATEGORY_PAGES_DESCRIPTIONS = {
# DEFAULT_LANG: {
# "blogging": "Meta-blog posts about blogging about blogging.",
# "open source": "My contributions to my many, varied, ever-changing, and eternal libre software projects."
# },
#}
# If you do not want to display a category publicly, you can mark it as hidden.
# The category will not be displayed on the category list page.
# Category pages will still be generated.
HIDDEN_CATEGORIES = []
# Final location for the main blog page and sibling paginated pages is
# output / TRANSLATION[lang] / INDEX_PATH / index-*.html
# Modified to avoid a conflict because blogs try to generate /index.html
INDEX_PATH = "blog"
# Create per-month archives instead of per-year
# CREATE_MONTHLY_ARCHIVE = False
# Create one large archive instead of per-year
# CREATE_SINGLE_ARCHIVE = False
# Create year, month, and day archives each with a (long) list of posts
# (overrides both CREATE_MONTHLY_ARCHIVE and CREATE_SINGLE_ARCHIVE)
# CREATE_FULL_ARCHIVES = False
# If monthly archives or full archives are created, adds also one archive per day
# CREATE_DAILY_ARCHIVE = False
# Final locations for the archives are:
# output / TRANSLATION[lang] / ARCHIVE_PATH / ARCHIVE_FILENAME
# output / TRANSLATION[lang] / ARCHIVE_PATH / YEAR / index.html
# output / TRANSLATION[lang] / ARCHIVE_PATH / YEAR / MONTH / index.html
# output / TRANSLATION[lang] / ARCHIVE_PATH / YEAR / MONTH / DAY / index.html
# ARCHIVE_PATH = ""
# ARCHIVE_FILENAME = "archive.html"
# If ARCHIVES_ARE_INDEXES is set to True, each archive page which contains a list
# of posts will contain the posts themselves. If set to False, it will be just a
# list of links.
# ARCHIVES_ARE_INDEXES = False
# URLs to other posts/pages can take 3 forms:
# rel_path: a relative URL to the current page/post (default)
# full_path: a URL with the full path from the root
# absolute: a complete URL (that includes the SITE_URL)
# URL_TYPE = 'rel_path'
# Final location for the blog main RSS feed is:
# output / TRANSLATION[lang] / RSS_PATH / rss.xml
# RSS_PATH = ""
# Number of posts in RSS feeds
# FEED_LENGTH = 10
# Slug the Tag URL easier for users to type, special characters are
# often removed or replaced as well.
# SLUG_TAG_PATH = True
# A list of redirection tuples, [("foo/from.html", "/bar/to.html")].
#
# A HTML file will be created in output/foo/from.html that redirects
# to the "/bar/to.html" URL. notice that the "from" side MUST be a
# relative URL.
#
# If you don't need any of these, just set to []
REDIRECTIONS = []
# Presets of commands to execute to deploy. Can be anything, for
# example, you may use rsync:
# "rsync -rav --delete output/ joe@my.site:/srv/www/site"
# And then do a backup, or run `nikola ping` from the `ping`
# plugin (`nikola plugin -i ping`). Or run `nikola check -l`.
# You may also want to use github_deploy (see below).
# You can define multiple presets and specify them as arguments
# to `nikola deploy`. If no arguments are specified, a preset
# named `default` will be executed. You can use as many presets
# in a `nikola deploy` command as you like.
# rsync is used to send documentation to our web servers: we never send any
# secret information, and using 'ssh-keyscan' causes the CI server's IP to
# be blacklisted, so we specify "StrictHostKeyChecking=no".
SSH_OPTS = ["StrictHostKeyChecking=no", "UserKnownHostsFile=/dev/null"]
SSH_OPTS = ' '.join('-o ' + opt for opt in SSH_OPTS)
DEPLOY_COMMANDS = {
'default': [
"rsync -rlv -e 'ssh {}' --delete "
"--filter 'P doc/*' --filter 'P extensions/*' output/* kwant2@iapetus.uberspace.de:"
.format(SSH_OPTS),
"rsync -lv -e 'ssh {}' htaccess-apache kwant2@iapetus.uberspace.de:/.htaccess"
.format(SSH_OPTS),
],
'master': [
"rsync -rlv -e 'ssh {}' --delete "
"--filter 'P doc/*' --filter 'P extensions/*' output/* kwant@fornjot.uberspace.de:"
.format(SSH_OPTS),
"rsync -lv -e 'ssh {}' htaccess-apache kwant@fornjot.uberspace.de:/.htaccess"
.format(SSH_OPTS),
]
}
# For user.github.io OR organization.github.io pages, the DEPLOY branch
# MUST be 'master', and 'gh-pages' for other repositories.
# GITHUB_SOURCE_BRANCH = 'master'
# GITHUB_DEPLOY_BRANCH = 'gh-pages'
# The name of the remote where you wish to push to, using github_deploy.
# GITHUB_REMOTE_NAME = 'origin'
# Where the output site should be located
# If you don't use an absolute path, it will be considered as relative
# to the location of conf.py
# OUTPUT_FOLDER = 'output'
# where the "cache" of partial generated content should be located
# default: 'cache'
# CACHE_FOLDER = 'cache'
# Filters to apply to the output.
# A directory where the keys are either: a file extensions, or
# a tuple of file extensions.
#
# And the value is a list of commands to be applied in order.
#
# Each command must be either:
#
# A string containing a '%s' which will
# be replaced with a filename. The command *must* produce output
# in place.
#
# Or:
#
# A python callable, which will be called with the filename as
# argument.
#
# By default, only .php files uses filters to inject PHP into
# Nikola’s templates. All other filters must be enabled through FILTERS.
#
# Many filters are shipped with Nikola. A list is available in the manual:
# <https://getnikola.com/handbook.html#post-processing-filters>
#
# from nikola import filters
# FILTERS = {
# ".html": [filters.typogrify],
# ".js": [filters.closure_compiler],
# ".jpg": ["jpegoptim --strip-all -m75 -v %s"],
# }
# Expert setting! Create a gzipped copy of each generated file. Cheap server-
# side optimization for very high traffic sites or low memory servers.
# GZIP_FILES = False
# File extensions that will be compressed
# GZIP_EXTENSIONS = ('.txt', '.htm', '.html', '.css', '.js', '.json', '.atom', '.xml')
# Use an external gzip command? None means no.
# Example: GZIP_COMMAND = "pigz -k {filename}"
# GZIP_COMMAND = None
# Make sure the server does not return a "Accept-Ranges: bytes" header for
# files compressed by this option! OR make sure that a ranged request does not
# return partial content of another representation for these resources. Do not
# use this feature if you do not understand what this means.
# Compiler to process LESS files.
# LESS_COMPILER = 'lessc'
# A list of options to pass to the LESS compiler.
# Final command is: LESS_COMPILER LESS_OPTIONS file.less
# LESS_OPTIONS = []
# Compiler to process Sass files.
# SASS_COMPILER = 'sass'
# A list of options to pass to the Sass compiler.
# Final command is: SASS_COMPILER SASS_OPTIONS file.s(a|c)ss
# SASS_OPTIONS = []
# #############################################################################
# Image Gallery Options
# #############################################################################
# One or more folders containing galleries. The format is a dictionary of
# {"source": "relative_destination"}, where galleries are looked for in
# "source/" and the results will be located in
# "OUTPUT_PATH/relative_destination/gallery_name"
# Default is:
# GALLERY_FOLDERS = {"galleries": "galleries"}
# More gallery options:
# THUMBNAIL_SIZE = 180
# MAX_IMAGE_SIZE = 1280
# USE_FILENAME_AS_TITLE = True
# EXTRA_IMAGE_EXTENSIONS = []
#
# If set to False, it will sort by filename instead. Defaults to True
# GALLERY_SORT_BY_DATE = True
#
# Folders containing images to be used in normal posts or pages. Images will be
# scaled down according to IMAGE_THUMBNAIL_SIZE and MAX_IMAGE_SIZE options, but
# will have to be referenced manually to be visible on the site
# (the thumbnail has ``.thumbnail`` added before the file extension).
# The format is a dictionary of {source: relative destination}.
IMAGE_FOLDERS = {'images': 'images'}
# IMAGE_THUMBNAIL_SIZE = 400
# #############################################################################
# HTML fragments and diverse things that are used by the templates
# #############################################################################
# Data about post-per-page indexes.
# INDEXES_PAGES defaults to ' old posts, page %d' or ' page %d' (translated),
# depending on the value of INDEXES_PAGES_MAIN.
#
# (translatable) If the following is empty, defaults to BLOG_TITLE:
# INDEXES_TITLE = ""
#
# (translatable) If the following is empty, defaults to ' [old posts,] page %d' (see above):
# INDEXES_PAGES = ""
#
# If the following is True, INDEXES_PAGES is also displayed on the main (the
# newest) index page (index.html):
# INDEXES_PAGES_MAIN = False
#
# If the following is True, index-1.html has the oldest posts, index-2.html the
# second-oldest posts, etc., and index.html has the newest posts. This ensures
# that all posts on index-x.html will forever stay on that page, now matter how
# many new posts are added.
# If False, index-1.html has the second-newest posts, index-2.html the third-newest,
# and index-n.html the oldest posts. When this is active, old posts can be moved
# to other index pages when new posts are added.
# INDEXES_STATIC = True
#
# (translatable) If PRETTY_URLS is set to True, this setting will be used to create
# prettier URLs for index pages, such as page/2/index.html instead of index-2.html.
# Valid values for this settings are:
# * False,
# * a list or tuple, specifying the path to be generated,
# * a dictionary mapping languages to lists or tuples.
# Every list or tuple must consist of strings which are used to combine the path;
# for example:
# ['page', '{number}', '{index_file}']
# The replacements
# {number} --> (logical) page number;
# {old_number} --> the page number inserted into index-n.html before (zero for
# the main page);
# {index_file} --> value of option INDEX_FILE
# are made.
# Note that in case INDEXES_PAGES_MAIN is set to True, a redirection will be created
# for the full URL with the page number of the main page to the normal (shorter) main
# page URL.
# INDEXES_PRETTY_PAGE_URL = False
# Color scheme to be used for code blocks. If your theme provides
# "assets/css/code.css" this is ignored.
# Can be any of:
# algol
# algol_nu
# arduino
# autumn
# borland
# bw
# colorful
# default
# emacs
# friendly
# fruity
# igor
# lovelace
# manni
# monokai
# murphy
# native
# paraiso_dark
# paraiso_light
# pastie
# perldoc
# rrt
# tango
# trac
# vim
# vs
# xcode
# This list MAY be incomplete since pygments adds styles every now and then.
# CODE_COLOR_SCHEME = 'default'
# If you use 'site-reveal' theme you can select several subthemes
# THEME_REVEAL_CONFIG_SUBTHEME = 'sky'
# You can also use: beige/serif/simple/night/default
# Again, if you use 'site-reveal' theme you can select several transitions
# between the slides
# THEME_REVEAL_CONFIG_TRANSITION = 'cube'
# You can also use: page/concave/linear/none/default
# FAVICONS contains (name, file, size) tuples.
# Used to create favicon link like this:
# <link rel="name" href="file" sizes="size"/>
FAVICONS = (
("icon", "/kwant_icon.png", "32x32"),)
# Show only teasers in the index pages? Defaults to False.
INDEX_TEASERS = True
# HTML fragments with the Read more... links.
# The following tags exist and are replaced for you:
# {link} A link to the full post page.
# {read_more} The string “Read more” in the current language.
# {reading_time} An estimate of how long it will take to read the post.
# {remaining_reading_time} An estimate of how long it will take to read the post, sans the teaser.
# {min_remaining_read} The string “{remaining_reading_time} min remaining to read” in the current language.
# {paragraph_count} The amount of paragraphs in the post.
# {remaining_paragraph_count} The amount of paragraphs in the post, sans the teaser.
# {{ A literal { (U+007B LEFT CURLY BRACKET)
# }} A literal } (U+007D RIGHT CURLY BRACKET)
# 'Read more...' for the index page, if INDEX_TEASERS is True (translatable)
INDEX_READ_MORE_LINK = ''
# 'Read more...' for the RSS_FEED, if RSS_TEASERS is True (translatable)
FEED_READ_MORE_LINK = '<p><a href="{link}">{read_more}…</a> ({min_remaining_read})</p>'
# Append a URL query to the RSS_READ_MORE_LINK in Atom and RSS feeds. Advanced
# option used for traffic source tracking.
# Minimum example for use with Piwik: "pk_campaign=feed"
# The following tags exist and are replaced for you:
# {feedRelUri} A relative link to the feed.
# {feedFormat} The name of the syndication format.
# Example using replacement for use with Google Analytics:
# "utm_source={feedRelUri}&utm_medium=nikola_feed&utm_campaign={feedFormat}_feed"
FEED_LINKS_APPEND_QUERY = False
# A HTML fragment describing the license, for the sidebar.
# (translatable)
LICENSE = ""
# I recommend using the Creative Commons' wizard:
# http://creativecommons.org/choose/
# LICENSE = """
# <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/ar/">
# <img alt="Creative Commons License BY-NC-SA"
# style="border-width:0; margin-bottom:12px;"
# src="http://i.creativecommons.org/l/by-nc-sa/2.5/ar/88x31.png"></a>"""
# A small copyright notice for the page footer (in HTML).
# (translatable)
CONTENT_FOOTER = 'Contents &copy; 2013-{date} <a href="{url}">{author}</a> {license}'
# Things that will be passed to CONTENT_FOOTER.format(). This is done
# for translatability, as dicts are not formattable. Nikola will
# intelligently format the setting properly.
# The setting takes a dict. The keys are languages. The values are
# tuples of tuples of positional arguments and dicts of keyword arguments
# to format(). For example, {'en': (('Hello'), {'target': 'World'})}
# results in CONTENT_FOOTER['en'].format('Hello', target='World').
# WARNING: If you do not use multiple languages with CONTENT_FOOTER, this
# still needs to be a dict of this format. (it can be empty if you
# do not need formatting)
# (translatable)
CONTENT_FOOTER_FORMATS = {
DEFAULT_LANG: (
(),
{
"url": "/authors",
"author": BLOG_AUTHOR,
"date": time.gmtime().tm_year,
"license": LICENSE
}
)
}
# To use comments, you can choose between different third party comment
# systems. The following comment systems are supported by Nikola:
# disqus, facebook, googleplus, intensedebate, isso, livefyre, muut
# You can leave this option blank to disable comments.
COMMENT_SYSTEM = ""
# And you also need to add your COMMENT_SYSTEM_ID which
# depends on what comment system you use. The default is
# "nikolademo" which is a test account for Disqus. More information
# is in the manual.
COMMENT_SYSTEM_ID = ""
# Enable annotations using annotateit.org?
# If set to False, you can still enable them for individual posts and pages
# setting the "annotations" metadata.
# If set to True, you can disable them for individual posts and pages using
# the "noannotations" metadata.
# ANNOTATIONS = False
# Create index.html for page (story) folders?
# WARNING: if a page would conflict with the index file (usually
# caused by setting slug to `index`), the STORY_INDEX
# will not be generated for that directory.
# STORY_INDEX = False
# Enable comments on story pages?
# COMMENTS_IN_STORIES = False
# Enable comments on picture gallery pages?
# COMMENTS_IN_GALLERIES = False
# What file should be used for directory indexes?
# Defaults to index.html
# Common other alternatives: default.html for IIS, index.php
# INDEX_FILE = "index.html"
# If a link ends in /index.html, drop the index.html part.
# http://mysite/foo/bar/index.html => http://mysite/foo/bar/
# (Uses the INDEX_FILE setting, so if that is, say, default.html,
# it will instead /foo/default.html => /foo)
# (Note: This was briefly STRIP_INDEX_HTML in v 5.4.3 and 5.4.4)
# Default = False
STRIP_INDEXES = False
# Should the sitemap list directories which only include other directories
# and no files.
# Default to True
# If this is False
# e.g. /2012 includes only /01, /02, /03, /04, ...: don't add it to the sitemap
# if /2012 includes any files (including index.html)... add it to the sitemap
# SITEMAP_INCLUDE_FILELESS_DIRS = True
# List of files relative to the server root (!) that will be asked to be excluded
# from indexing and other robotic spidering. * is supported. Will only be effective
# if SITE_URL points to server root. The list is used to exclude resources from
# /robots.txt and /sitemap.xml, and to inform search engines about /sitemapindex.xml.
# ROBOTS_EXCLUSIONS = ["/archive.html", "/category/*.html"]
# Instead of putting files in <slug>.html, put them in <slug>/index.html.
# No web server configuration is required. Also enables STRIP_INDEXES.
# This can be disabled on a per-page/post basis by adding
# .. pretty_url: False
# to the metadata.
PRETTY_URLS = False
# If True, publish future dated posts right away instead of scheduling them.
# Defaults to False.
# FUTURE_IS_NOW = False
# If True, future dated posts are allowed in deployed output
# Only the individual posts are published/deployed; not in indexes/sitemap
# Generally, you want FUTURE_IS_NOW and DEPLOY_FUTURE to be the same value.
# DEPLOY_FUTURE = False
# If False, draft posts will not be deployed
# DEPLOY_DRAFTS = True
# Allows scheduling of posts using the rule specified here (new_post -s)
# Specify an iCal Recurrence Rule: http://www.kanzaki.com/docs/ical/rrule.html
# SCHEDULE_RULE = ''
# If True, use the scheduling rule to all posts by default
# SCHEDULE_ALL = False
# Do you want a add a Mathjax config file?
# MATHJAX_CONFIG = ""
# If you are using the compile-ipynb plugin, just add this one:
# MATHJAX_CONFIG = """
# <script type="text/x-mathjax-config">
# MathJax.Hub.Config({
# tex2jax: {
# inlineMath: [ ['$','$'], ["\\\(","\\\)"] ],
# displayMath: [ ['$$','$$'], ["\\\[","\\\]"] ],
# processEscapes: true
# },
# displayAlign: 'left', // Change this to 'center' to center equations.
# "HTML-CSS": {
# styles: {'.MathJax_Display': {"margin": 0}}
# }
# });
# </script>
# """
# Do you want to customize the nbconversion of your IPython notebook?
# IPYNB_CONFIG = {}
# With the following example configuration you can use a custom jinja template
# called `toggle.tpl` which has to be located in your site/blog main folder:
# IPYNB_CONFIG = {'Exporter':{'template_file': 'toggle'}}
# What Markdown extensions to enable?
# You will also get gist, nikola and podcast because those are
# done in the code, hope you don't mind ;-)
# Note: most Nikola-specific extensions are done via the Nikola plugin system,
# with the MarkdownExtension class and should not be added here.
# The default is ['fenced_code', 'codehilite']
MARKDOWN_EXTENSIONS = ['fenced_code', 'codehilite', 'extra']
# Extra options to pass to the pandoc comand.
# by default, it's empty, is a list of strings, for example
# ['-F', 'pandoc-citeproc', '--bibliography=/Users/foo/references.bib']
# PANDOC_OPTIONS = []
# Social buttons. This is sample code for AddThis (which was the default for a
# long time). Insert anything you want here, or even make it empty (which is
# the default right now)
# (translatable)
# SOCIAL_BUTTONS_CODE = """
# <!-- Social buttons -->
# <div id="addthisbox" class="addthis_toolbox addthis_peekaboo_style addthis_default_style addthis_label_style addthis_32x32_style">
# <a class="addthis_button_more">Share</a>
# <ul><li><a class="addthis_button_facebook"></a>
# <li><a class="addthis_button_google_plusone_share"></a>
# <li><a class="addthis_button_linkedin"></a>
# <li><a class="addthis_button_twitter"></a>
# </ul>
# </div>
# <script src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4f7088a56bb93798"></script>
# <!-- End of social buttons -->
# """
# Show link to source for the posts?
# Formerly known as HIDE_SOURCELINK (inverse)
SHOW_SOURCELINK = False
# Copy the source files for your pages?
# Setting it to False implies SHOW_SOURCELINK = False
COPY_SOURCES = False
# Modify the number of Post per Index Page
# Defaults to 10
# INDEX_DISPLAY_POST_COUNT = 10
# By default, Nikola generates RSS files for the website and for tags, and
# links to it. Set this to False to disable everything RSS-related.
GENERATE_RSS = True
# By default, Nikola does not generates Atom files for indexes and links to
# them. Generate Atom for tags by setting TAG_PAGES_ARE_INDEXES to True.
# Atom feeds are built based on INDEX_DISPLAY_POST_COUNT and not FEED_LENGTH
# Switch between plain-text summaries and full HTML content using the
# RSS_TEASER option. RSS_LINKS_APPEND_QUERY is also respected. Atom feeds
# are generated even for old indexes and have pagination link relations
# between each other. Old Atom feeds with no changes are marked as archived.
GENERATE_ATOM = True
# RSS_LINK is a HTML fragment to link the RSS or Atom feeds. If set to None,
# the base.tmpl will use the feed Nikola generates. However, you may want to
# change it for a FeedBurner feed or something else.
# RSS_LINK = None
# Show only teasers in the RSS and Atom feeds? Default to True
# RSS_TEASERS = True
# Strip HTML in the RSS feed? Default to False
# RSS_PLAIN = False
# A search form to search this site, for the sidebar. You can use a Google
# custom search (http://www.google.com/cse/)
# Or a DuckDuckGo search: https://duckduckgo.com/search_box.html
# Default is no search form.
# (translatable)
# SEARCH_FORM = ""
#
# This search form works for any site and looks good in the "site" theme where
# it appears on the navigation bar:
#
# SEARCH_FORM = """
# <!-- Custom search -->
# <form method="get" id="search" action="//duckduckgo.com/"
# class="navbar-form pull-left">
# <input type="hidden" name="sites" value="%s"/>
# <input type="hidden" name="k8" value="#444444"/>
# <input type="hidden" name="k9" value="#D51920"/>
# <input type="hidden" name="kt" value="h"/>
# <input type="text" name="q" maxlength="255"
# placeholder="Search&hellip;" class="span2" style="margin-top: 4px;"/>
# <input type="submit" value="DuckDuckGo Search" style="visibility: hidden;" />
# </form>
# <!-- End of custom search -->
# """ % SITE_URL
#
# If you prefer a Google search form, here's an example that should just work:
# SEARCH_FORM = """
# <!-- Custom search with Google-->
# <form id="search" action="//www.google.com/search" method="get" class="navbar-form pull-left">
# <input type="hidden" name="q" value="site:%s" />
# <input type="text" name="q" maxlength="255" results="0" placeholder="Search"/>
# </form>
# <!-- End of custom search -->
#""" % SITE_URL
# Use content distribution networks for jQuery, twitter-bootstrap css and js,
# and html5shiv (for older versions of Internet Explorer)
# If this is True, jQuery and html5shiv are served from the Google CDN and
# Bootstrap is served from BootstrapCDN (provided by MaxCDN)
# Set this to False if you want to host your site without requiring access to
# external resources.
# USE_CDN = False
# Check for USE_CDN compatibility.
# If you are using custom themes, have configured the CSS properly and are
# receiving warnings about incompatibility but believe they are incorrect, you
# can set this to False.
# USE_CDN_WARNING = True
# Extra things you want in the pages HEAD tag. This will be added right
# before </head>
# (translatable)
# EXTRA_HEAD_DATA = ""
# Google Analytics or whatever else you use. Added to the bottom of <body>
# in the default template (base.tmpl).
# (translatable)
BODY_END = """
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
_paq.push(["setCookieDomain", "*.kwant-project.org"]);
_paq.push(["setDomains", ["*.kwant-project.org","*.downloads.kwant-project.org","*.git.kwant-project.org","*.gitlab.kwant-project.org"]]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//piwik.kwant-project.org/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', 1]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="//piwik.kwant-project.org/piwik.php?idsite=1" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code: Analytics are used by us to improve the site, and not sent to anyone. -->
"""
# The possibility to extract metadata from the filename by using a
# regular expression.
# To make it work you need to name parts of your regular expression.
# The following names will be used to extract metadata:
# - title
# - slug
# - date
# - tags
# - link
# - description
#
# An example re is the following:
# '(?P<date>\d{4}-\d{2}-\d{2})-(?P<slug>.*)-(?P<title>.*)\.md'
# FILE_METADATA_REGEXP = None
# If you hate "Filenames with Capital Letters and Spaces.md", you should
# set this to true.
UNSLUGIFY_TITLES = True
# Additional metadata that is added to a post when creating a new_post
# ADDITIONAL_METADATA = {}
# Nikola supports Open Graph Protocol data for enhancing link sharing and
# discoverability of your site on Facebook, Google+, and other services.
# Open Graph is enabled by default.
# USE_OPEN_GRAPH = True
# Nikola supports Twitter Card summaries, but they are disabled by default.
# They make it possible for you to attach media to Tweets that link
# to your content.
#
# IMPORTANT:
# Please note, that you need to opt-in for using Twitter Cards!
# To do this please visit https://cards-dev.twitter.com/validator
#
# Uncomment and modify to following lines to match your accounts.
# Images displayed come from the `previewimage` meta tag.
# You can specify the card type by using the `card` parameter in TWITTER_CARD.
# TWITTER_CARD = {
# # 'use_twitter_cards': True, # enable Twitter Cards
# # 'card': 'summary', # Card type, you can also use 'summary_large_image',
# # see https://dev.twitter.com/cards/types
# # 'site': '@website', # twitter nick for the website
# # 'creator': '@username', # Username for the content creator / author.
# }
# If webassets is installed, bundle JS and CSS into single files to make
# site loading faster in a HTTP/1.1 environment but is not recommended for
# HTTP/2.0 when caching is used. Defaults to True.
# USE_BUNDLES = True
# Plugins you don't want to use. Be careful :-)
# DISABLED_PLUGINS = ["render_galleries"]
# Add the absolute paths to directories containing plugins to use them.
# For example, the `plugins` directory of your clone of the Nikola plugins
# repository.
# EXTRA_PLUGINS_DIRS = []
# List of regular expressions, links matching them will always be considered
# valid by "nikola check -l"
# LINK_CHECK_WHITELIST = []
# If set to True, enable optional hyphenation in your posts (requires pyphen)
# HYPHENATE = False
# The <hN> tags in HTML generated by certain compilers (reST/Markdown)
# will be demoted by that much (1 → h1 will become h2 and so on)
# This was a hidden feature of the Markdown and reST compilers in the
# past. Useful especially if your post titles are in <h1> tags too, for
# example.
# (defaults to 1.)
# DEMOTE_HEADERS = 1
# If you don’t like slugified file names ([a-z0-9] and a literal dash),
# and would prefer to use all the characters your file system allows.
# USE WITH CARE! This is also not guaranteed to be perfect, and may
# sometimes crash Nikola, your web server, or eat your cat.
# USE_SLUGIFY = True
# You can configure the logging handlers installed as plugins or change the
# log level of the default stderr handler.
# WARNING: The stderr handler allows only the loglevels of 'INFO' and 'DEBUG'.
# This is done for safety reasons, as blocking out anything other
# than 'DEBUG' may hide important information and break the user
# experience!
LOGGING_HANDLERS = {
'stderr': {'loglevel': 'INFO', 'bubble': True},
# 'smtp': {
# 'from_addr': 'test-errors@example.com',
# 'recipients': ('test@example.com'),
# 'credentials':('testusername', 'password'),
# 'server_addr': ('127.0.0.1', 25),
# 'secure': (),
# 'level': 'DEBUG',
# 'bubble': True
# }
}
# Templates will use those filters, along with the defaults.
# Consult your engine's documentation on filters if you need help defining
# those.
# TEMPLATE_FILTERS = {}
# Put in global_context things you want available on all your templates.
# It can be anything, data, functions, modules, etc.
GLOBAL_CONTEXT = {}
# Add functions here and they will be called with template
# GLOBAL_CONTEXT as parameter when the template is about to be
# rendered
GLOBAL_CONTEXT_FILLER = []
WRITE_TAG_CLOUD = False
*.html
Kwant user survey
=================
The kwant user survey is finished, please use the `mailing list
</community.html>`_ if you would like to leave feedback.
Quantum transport simulations made easy
=======================================
**Update 11 May 2015**: Kwant is one of the main tools in a massive open online course on `topology in condensed matter <http://topocondmat.org>`_, check out the course materials!
Kwant is a `free (open source) <http://git.kwant-project.org/kwant>`_ Python
Kwant is a `free (open source) <https://gitlab.kwant-project.org/kwant/kwant>`_ Python
package for numerical calculations on tight-binding models with a strong focus
on quantum transport. It is designed to be flexible and easy to use. Thanks to
the use of innovative algorithms, Kwant is often faster than other available
......@@ -22,7 +20,7 @@ summarized as follows:
.. raw:: html
<object type="image/svg+xml" data="kwant-workflow.svgz" width="100%">kwant-workflow.svgz</object>
<object type="image/svg+xml" data="kwant-workflow.svgz" class="img-responsive">kwant-workflow.svgz</object>
Kwant was designed to be easy to use: Section 2 of the `Kwant paper
<http://downloads.kwant-project.org/doc/kwant-paper.pdf>`_ contains a
......@@ -35,32 +33,30 @@ Examples of Kwant usage
-----------------------
The following examples are meant to give an overview of what is possible with
Kwant. The tutorial section of `Kwant documentation <doc/1.0/>`_ and the
Kwant. The tutorial section of `Kwant documentation <doc/1/>`_ and the
`Kwant paper`_ each contain several pedagogical examples with line-by-line
explanations (`zipfile of all examples
<http://downloads.kwant-project.org/examples/kwant-examples-1.0.0.zip>`_).
Graphene flake
..............
.. container:: rightside
.. raw:: html
.. raw:: html
<object type="image/svg+xml" class="col-md-4 pull-left img-responsive" data="graphene-edgestate.svgz">graphene-edgestate.svgz</object>
<object type="image/svg+xml" data="graphene-edgestate.svgz" style="width: 15em;">graphene-edgestate.svgz</object>
The complete code that constructs the graphene flake shown on the right side is
The complete code that constructs the graphene flake shown on the right side
is::
.. code:: python
def disk(pos):
x, y = pos
return x**2 + y**2 < 8**2
def disk(pos):
x, y = pos
return x**2 + y**2 < 8**2
lat = kwant.lattice.honeycomb()
sys = kwant.Builder()
sys[lat.shape(disk, (0, 0))] = 0
sys[lat.neighbors()] = -1
lat = kwant.lattice.honeycomb()
syst = kwant.Builder()
syst[lat.shape(disk, (0, 0))] = 0
syst[lat.neighbors()] = -1
In addition to the flake itself, the image also shows the wave function of a
low energy eigenstate. The size of each circle is proportional to the wave
......@@ -68,23 +64,19 @@ function probability amplitude on that site. It can be clearly seen that the
wave function is peaked near the zigzag segments of the boundary, as `expected
<http://arxiv.org/abs/1003.4602>`_ for graphene quantum dots.
Taken from the Kwant `plotting tutorial <doc/1.0/tutorial/tutorial6.html>`_.
Taken from the Kwant `plotting tutorial <doc/1/tutorial/tutorial6.html>`_.
.. class:: row nomargin
Quantum Hall effect
...................
.. container:: rightside
.. raw:: html
<object type="image/svg+xml" data="qhe-edgestate.svgz" style="width: 15em;">qhe-edgestate.svgz</object>
.. raw:: html
.. container:: leftside
<object type="image/svg+xml" class="col-md-4 img-responsive pull-left" data="qhe-edgestate.svgz">qhe-edgestate.svgz</object>
.. raw:: html
<object type="image/svg+xml" class="col-md-4 img-responsive pull-right" data="qhe-plateaus.svgz">qhe-plateaus.svgz</object>
<object type="image/svg+xml" data="qhe-plateaus.svgz" style="width: 15em;">qhe-plateaus.svgz</object>
One of the most common applications of Kwant is to calculate the conductance of
a nanoelectronic system. The plot on the left shows the conductance through a
......@@ -98,13 +90,14 @@ is shown on the right.
Taken from example 6 of the `Kwant paper
<http://downloads.kwant-project.org/doc/kwant-paper.pdf>`_.
.. class:: row
3-d system: Majorana states
...........................
.. container:: rightside
.. class:: col-md-4 img-responsive pull-left
.. image:: quantum-wire.png
.. image:: quantum-wire.png
Kwant allows systems of any dimensionality, for example three-dimensional ones.
This image shows a 3-d model of a semiconducting quantum wire (gray cylinder).
......@@ -114,13 +107,14 @@ Majorana bound state appears close to the superconducting-normal interface.
Taken from an unpublished work by S. Mi, A. R. Akhmerov, and M. Wimmer.
.. class:: row
Numerical experiment: flying qubit
..................................
.. container:: rightside
.. class:: col-md-4 col-sm-12 img-responsive pull-right
.. image:: flying-qubit.png
.. image:: flying-qubit.png
Numerical simulations and experimental results for a flying qubit sample made in
a GaAs/GaAlAs heterostrucutre. The Kwant simulations were performed with
......@@ -134,19 +128,18 @@ Taken from an unpublished work by T. Bautze et al. See Yamamoto et al., `Nature
Nanotechnology 7, 247 (2012) <http://dx.doi.org/doi:10.1038/nnano.2012.28>`_ for
details about the experiment.
.. class:: row
Conductance of a Corbino disk in a quantum Hall regime
......................................................
.. container:: leftside
.. raw:: html
.. raw:: html
<object type="image/svg+xml" data="corbino-layout.svgz" style="width: 15em;">corbino-layout.svgz</object>
<object type="image/svg+xml" class="col-md-4 col-sm-6 img-responsive pull-left" data="corbino-layout.svgz">corbino-layout.svgz</object>
.. container:: rightside
.. class:: col-md-4 col-sm-6 img-responsive pull-right
.. image:: corbino-conductance.png
.. image:: corbino-conductance.png
Transport properties of a Corbino disk across a quantum Hall transition. Left:
geometry of the sample consisting of a ring-shaped two-dimensional electron gas
......
File moved
File moved
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7056 2011-06-17 10:50:48Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math {
margin-left: 2em ;
margin-right: 2em }
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
@import url(html4css1.css);
/* Keeping a scrollbar always there to make centering work properly. */
html {
overflow-y: scroll;
}
body {
min-width: 20em;
max-width: 55em;
margin: 0 auto;
font-family: "Bitstream Vera Serif", Georgia, serif;
}
div.padding {
margin: 1em;
}
/* Enable hyphenation. */
body {
text-align:justify;
-webkit-hyphens: auto;
-moz-hyphens: auto;
-ms-hyphens: auto;
-o-hyphens: auto;
hyphens: auto;
}
tt, pre {
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
-o-hyphens: none;
hyphens: none;
}
a {
color: #07c;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
ul.navigation{
display: block;
text-align: center;
padding: 0.4em;
border-radius: 5px;
background-color: #eeeeee;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
-o-hyphens: none;
hyphens: none;
}
ul.navigation li{
display: inline;
margin: 0 1em;
}
.hidden_structure {
display: none;
}
#header { margin-top: 0.5em; }
#footer { margin: 2em 0; }
#header, #header a, #footer {
color: black;
}
h1, h2, h3, h4, h5, h6 {
font-family: "Bitstream Vera Sans", Verdana, sans-serif;
font-weight: normal;
}
li {
margin-top: 0.3em;
}
li:first-child {
margin-top:0;
}
ol.simple, ul.simple {
margin-bottom: 0 }
img {
display: block;
margin-left: auto;
margin-right: auto;
}
pre, code { background-color: #eee; border: 1px solid #ccc; }
pre.literal-block { overflow: hidden }
pre { padding: 0.3em; }
code { padding: 0 0.1em; }
pre > code { border: none; padding: 0; }
div.leftside {
float: left;
margin: 0 2em 0 0;
}
div.rightside {
float: right;
margin: 0 0 0 2em;
}
div.section{
height: auto;
overflow: auto;
}
The Kwant community
===================
The Kwant project is an international collaboration.
Everybody is welcome to participate in the community
by asking and replying to questions, reporting bugs, providing suggestions,
and `contributing to the code and documentation </contribute.html>`_.
The Kwant community uses three public communication channels:
the mailing list for generic discussions, questions, and announcements;
the gitlab instance for development discussions and reporting bugs;
and the chat for real-time discussions related to development.
A list of `Kwant authors </authors>`_ is included in the documentation.
Please contact the authors directly only for matters that cannot be discussed on the public channels.
Mailing list
------------
The kwant-discuss mailing list is the main public communication platform for anything related to Kwant:
questions, discussions, development, and announcements.
It may be used both as a web forum and as a classical mailing list.
The `kwant-discuss web interface <https://mail.python.org/archives/list/kwant-discuss@python.org/>`_
allows to follow discussions and search the archives.
To start a new discussion thread, you may either use the web interface
(sign-in required)
or write directly to
kwant-discuss@python.org.
In order to avoid spam,
messages of unsubscribed participants are held for moderation.
Similarly, replying is possible either by mail
(if you received the post to which you want reply by mail),
or using the web interface:
the “reply” button under each message allows to compose directly
(for signed-in users),
or triggers a reply by mail (otherwise).
You may subscribe to receive posts to the list by mail.
Subscription is done either through the
`kwant-discuss info page
<https://mail.python.org/mailman3/lists/kwant-discuss.python.org/>`_
or by sending any message to
kwant-discuss-join@python.org.
(The subject and content are ignored and may be empty.)
To unsubscribe, either use the info page,
or send any message to kwant-discuss-leave@python.org.
List etiquette :
- When asking questions,
`help others to help you <https://stackoverflow.com/help/how-to-ask>`_.
In particular, use the search function before posting.
- When replying, please avoid quoting the complete original message.
Instead, consider
`bottom-posting <https://en.wikipedia.org/wiki/Posting_style#Bottom-posting>`_.
Announcements mailing list
--------------------------
This read-only list is used for important announcements like new releases of Kwant.
Only a few messages are sent per year.
These announcements are also posted on the main mailing list,
so there is no need to subscribe to both lists.
We recommend every user of Kwant to subscribe at least to this list in order to stay informed about new developments.
The `kwant-announce archives <https://mail.python.org/archives/list/kwant-announce@python.org/>`_
are available on the web.
To subscribe, either use the form on the `kwant-announce info page <https://mail.python.org/mailman3/lists/kwant-announce.python.org/>`_
or simply send any message to kwant-announce-join@python.org.
(The subject and content are ignored and may be empty.)
To unsubscribe, either use the info page, or send any message to kwant-announce-leave@python.org.
Development chat
----------------
The Kwant developer chat is accessible to the community via `Gitter <https://gitter.im/kwant-project/Lobby>`_.
Come say hi if you would like to get involved with developing Kwant!
Gitlab instance
---------------
The Kwant project runs a `gitlab instance <https://gitlab.kwant-project.org/>`_
that hosts the `main Kwant code repository <https://gitlab.kwant-project.org/kwant/kwant>`_
as well as the `repositories of related projects <https://gitlab.kwant-project.org/kwant>`_.
The gitlab instance is used for reporting bugs (see next section) and `development </contribute.html>`_
Reporting bugs
--------------
If you encounter a problem with Kwant,
first try to reproduce it with as simple a system as possible.
Double-check with the documentation that what you observe is actually a bug in Kwant.
If you think it is, please check `the list of known bugs in Kwant <https://gitlab.kwant-project.org/kwant/kwant/issues?label_name=bug>`_.
It may be also a good idea to search or ask on the general mailing list.
(You can use the search box at the top of this page.)
If after checking you still think that you have found a bug, please add it to
the above-mentioned list of bugs by creating an issue with the “bug” label. A
useful bug report should contain:
- The versions of software you are using: Kwant, Python, operating system, etc.
- A description of the problem, i.e. what exactly goes wrong. This should
include any relevant error messages.
- Enough information to reproduce the bug, preferably in the form of a simple
script.
Getting help, contributing and reporting problems
=================================================
Mailing list
------------
The mailing list is the main public communication platform for anything related
to Kwant: questions, bug reports, discussions, and announcements. You can use
it in various ways:
- .. raw:: html
<form method=post action="https://mailman-mail5.webfaction.com/subscribe/kwant-discuss">
<input type="text" name="email" size=25 value="Your email address" onblur="if (this.value == '') {this.value='Your email address'}" onfocus="if (this.value == 'Your email address') {this.value=''}" />
<input type="submit" name="email-button" value="Subscribe to the mailing list" />
</form>
… and read it together with your regular email. (To unsubscribe, follow the
link in the footer of a message.)
- Read the list via the `Gmane web interface
<http://news.gmane.org/gmane.comp.science.kwant.user>`_. The web interface
allows to write new messages (action: post) and to reply (action: followup).
- .. raw:: html
<p><form id="searchgmane" method="get" action="http://search.gmane.org/">
<input type="text" size=25 name="query" />
<input type="hidden" name="group" value="gmane.comp.science.kwant.user" />
<input type="submit" value="Search the mailing list" />
</form></p>
- Send a message directly to kwant-discuss@kwant-project.org. (If you are not
subscribed, it is not guaranteed that any followups will reach you by email,
so you should ask to be CCed.)
Announcements of new releases (low-volume)
------------------------------------------
This read-only list is reserved for important announcements like new releases of
Kwant. Only a few messages will be sent per year. These announcements will be also posted on the main mailing list, so there is no need to subscribe to both lists. We recommend every user of Kwant to subscribe at least to this list in order to stay informed about new developments.
.. raw:: html
<form method=post action="https://mailman-mail5.webfaction.com/subscribe/kwant-announce">
<input type="text" name="email" size=25 value="Your email address" onblur="if (this.value == '') {this.value='Your email address'}" onfocus="if (this.value == 'Your email address') {this.value=''}" />
<input type="submit" name="email-button" value="Subscribe to announcements" />
</form>
Reporting bugs
--------------
If you encounter a problem with Kwant, first try to reproduce it with as simple
a system as possible. Double-check with the documentation that what you
observe is actually a bug in Kwant. If you think it is, please check whether
the problem is already known by searching the mailing list.
If the problem is not known yet, please send a bug report to the mailing list.
A report should contain:
* The versions of software you are using (Kwant, Python, operating system, etc.)
* A description of the problem, i.e. what exactly goes wrong.
* Enough information to reproduce the bug, preferably in the form of a simple
script.
Contributing
------------
We see Kwant not just as a package with fixed functionality, but rather as a
framework for implementing different physics-related algorithms using a common
set of concepts and, if possible, a shared interface. We have designed it
leaving room for growth, and plan to keep extending it.
External contributions to Kwant are highly welcome. You can help to advance
the project not only by writing code, but also by reporting bugs, and
fixing/improving the documentation. A `mailing list
</community.html>`_ is available for discussions.
If you have some code that works well with Kwant, or extends it in some useful
way, please consider sharing it. Any external contribution will be clearly
marked as such, and relevant papers will be added to the list of `suggested
acknowledgements </citing.html>`_. The complete development history is also
made available through a `web interface <http://git.kwant-project.org/kwant>`_.
If you plan to contribute, it is best to coordinate with us in advance either
through the mailing list, or directly at authors@kwant-project.org for matters
that you prefer to not discuss publicly.
How to contribute
.................
We use the version control system `Git <http://git-scm.com/>`_ to coordinate the
development of Kwant. If you are new to Git, we invite you to learn its basics.
(There's a plethora of information available on the Web.) Kwant's Git
repository contains not only the source code, but also all of the reference
documentation and the tutorial.
It is best to base your work on the latest version of Kwant::
git clone http://git.kwant-project.org/kwant
Then you can modify the code, and build Kwant and the documentation as
described in the `build instructions
</doc/1.0/pre/install.html#building-and-installing-from-source>`_.
Some things to keep in mind:
* Please keep the code consistent by adhering to the prevailing naming and
formatting conventions. We generally follow the `"Style Guide for Python
Code" <http://www.python.org/dev/peps/pep-0008/>`_ For docstrings, we follow
`NumPy's "Docstring Standard"
<http://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt>`_ and
`Python's "Docstring Conventions"
<http://www.python.org/dev/peps/pep-0257/>`_.
* Write tests for all the important functionality you add. Be sure not to
break existing tests.
A useful trick for working on the source code is to build in-place so that there
is no need to re-install after each change. This can be done with the following
command ::
python setup.py build_ext -i
The ``kwant`` subdirectory of the source distribution will be thus turned into
a proper Python package that can be imported. To be able to import Kwant from
within Python, one can either work in the root directory of the distribution
(where the subdirectory ``kwant`` is located), or make a (symbolic) link from
somewhere in the Python search path to the the package subdirectory.
Contributing to Kwant
=====================
We see Kwant not just as a package with fixed functionality, but rather as a
framework for implementing different physics-related algorithms using a common
set of concepts. Contributions to Kwant are highly welcome. You can help the
project not only by writing code, but also by reporting bugs, and
fixing/improving the website and the documentation.
Where help is needed
--------------------
The `Kwant issue tracker
<https://gitlab.kwant-project.org/kwant/kwant/issues>`_ serves to track bugs
in Kwant, but most issues are in fact ideas for enhancements. The issues are
categorized with labels, so that it is possible to view `all the “easy” issues
<https://gitlab.kwant-project.org/kwant/kwant/issues?label_name=difficulty%3A+easy>`_
for example.
Please do feel free to enter new issues yourself. If you are unsure about some aspect It may be a good idea to discuss your idea on the mailing list kwant-discuss@kwant-project.org before filing an issue.
If you already have some code that extends Kwant in a useful way, please
consider sharing it. If your extension fits well with Kwant and is of wide
enough interest, we will be happy to include it into Kwant proper. For more
specialized cases, we will find a solution as well. (We could, for example,
add a list of Kwant-related modules to this website.) In any case, external
contributions will be clearly marked as such, and relevant papers will be
added to the list of `suggested acknowledgements </cite.html>`_.
Getting the source code
-----------------------
The source code of released versions of Kwant is available for `download
<http://downloads.kwant-project.org/kwant/>`_. You can follow the development
through the `Kwant page of our GitLab instance
<https://gitlab.kwant-project.org/kwant/kwant>`_. The `Git
<http://git-scm.com/>`_ repository of Kwant can be cloned directly with the
command ::
git clone https://gitlab.kwant-project.org/kwant/kwant.git
The Kwant git repository has two main branches: The branch *master*
contains the development towards the next release. The branch *stable* contains
the most recent release that is considered stable, and only bugfixes are applied
to it.
Setting up for development
--------------------------
When working with the Kwant source, regular `build instructions
</doc/1/pre/install.html#building-and-installing-from-source>`_ apply. It
would be tiresome, however, to have to reinstall the modified Kwant after each
modification.
One easy way to avoid this is to build in-place so that there is no need to
reinstall after each change. This can be done with the following command ::
python3 setup.py build_ext -i
No further installation is necessary. The “inner” ``kwant`` subdirectory has
been turned into a proper Python package that can be imported from the “outer”
directory, i.e. the directory where ``setup.py`` is located. Any script
inside that directory that imports Kwant will get the modified version. (To
be able to import the modified Kwant from another directory one can create a
symbolic link to the package.)
The above ``build_ext`` command does not have to be rerun when a Python file
is modified. Recompilation is only necessary whenever a Cython file
(``.pyx``) has been changed.
Modifying the source code
-------------------------
We recommend that you keep each of your changes to Kwant on a separate “topic
branch” that starts at *master*. Try to not mix up unrelated changes in a
single branch. To create a topic branch, use the command::
git checkout -b my_topic master
Now you can begin to implement your idea. As you go, register your changes
with Git as explained, for example, in the `Pro Git book
<https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository>`_
that is freely available online.
Once you feel that you would like to show your work to other interested people
(because you would like to receive feedback, or because you consider it
ready), it's time to inspect your branch. Run ``git status`` to make sure
that you have committed all of your changes, then use a tool like ``gitk`` to
view your branch.
In the following, two methods to share your commits are described. The first
will be familiar if you have experience with the popular GitHub service. If
you do not, you might prefer the second method, since it is simpler.
Method 1: Using the Kwant GitLab instance
.........................................
Go the `GitLab page of the official Kwant repository
<https://gitlab.kwant-project.org/kwant/kwant>`_. Since you do not have write
access to this repository, you have to create an own “fork” of it by clicking
on the button just right of the “star” button.
You created a public copy of the Kwant repository that is controlled by you.
Add it as a remote repository to the clone of Kwant on your computer::
git remote add own https://gitlab.kwant-project.org/<USERNAME>/kwant.git
You can copy-and-paste your own version of the above URL from the main page of
your repository. (If you know about SSH, you may also prefer to upload your
public ssh key to GitLab and to use SSH as transport.) The string ``own`` is
the local name you give to the remote, it can be anything.
Now you can push your topic branch to your repository::
git push own my_branch
This will make your branch appear in GitLab. Now you can let us know about
your branch by `creating a merge request in GitLab
<https://gitlab.kwant-project.org/help/workflow/forking_workflow.md>`_ or by
sending a message to kwant-discuss@kwant-project.org.
Method 2: Sending patches to the mailing list
.............................................
Run the command ::
git format-patch origin/master
This will create a “patch” file for each commit on your branch. Now simply
send these patches as email attachments to kwant-discuss@kwant-project.org,
together with an explanation of your idea. You do not have to be subscribed
to the mailing list.
(Or, even better, use ``git send-email`` as shown in this `example of usage
<https://kernel.org/pub/software/scm/git/docs/git-send-email.html#_example>`_
and this `git send-email howto
<http://www.freedesktop.org/wiki/Software/PulseAudio/HowToUseGitSendEmail/>`_.)
Coding style
------------
* Please keep the code consistent by adhering to the prevailing naming and
formatting conventions. We generally respect the `"Style Guide for Python
Code" <http://www.python.org/dev/peps/pep-0008/>`_. For docstrings, we
follow `NumPy's "Docstring Standard"
<http://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt>`_ and
`Python's "Docstring Conventions"
<http://www.python.org/dev/peps/pep-0257/>`_.
* Write tests for all the important functionality you add. Be sure not to
break existing tests.
* Create a logical sequence of commits with clear commit messages. Each
commit message consists of a summary line, and, whenever necessary, a
more detailed explanation. Both parts are separated by a blank line
and wrapped to 72 characters (unless quoting error messages and such).
The summary line should be as clear as possible. The detailed
explanation should be included whenever it helps to motivate or
understand the commit. Bear in mind that the merge request text and
discussions are not part of a commit.
Documentation
=============
Tutorial and reference manual
-----------------------------
.. class:: docs-list, button-links
* **Online**:
+ `stable version </doc/1/>`_
+ `development version </doc/dev/>`_
* **Downloads**:
+ `PDF <http://downloads.kwant-project.org/doc/latest.pdf>`_
+ `zipped HTML <http://downloads.kwant-project.org/doc/latest.zip>`_
Interactive online course
-------------------------
The APS March meeting 2016 tutorial “Introduction to Computational Quantum Nanoelectronics” focuses on the physics, but also serves as a crash course on Kwant. `All the materials are available online </mm16.html>`_ and can be run directly in a web browser, without installing Kwant locally.
Screencast
----------
.. raw:: html
A brief video introduction of Kwant:
<ul class="button-links inline-list">
<li> <a href="kwant-screencast-2014.html">watch</a> </li>
<li> <a href="http://downloads.kwant-project.org/doc/kwant-screencast-2014.mp4" download>download</a> </li>
</ul>
Article
-------
This paper (`download PDF <http://downloads.kwant-project.org/doc/kwant-paper.pdf>`__) introduces Kwant in a systematic way and discusses its design and performance (`New J. Phys. 16, 063065 (2014) <http://iopscience.iop.org/1367-2630/16/6/063065/article>`_).
Documentation
=============
Screencast
----------
.. raw:: html
A brief video introduction of Kwant:
<a href="kwant-screencast-2014.html">watch</a>,
<a href="http://downloads.kwant-project.org/doc/kwant-screencast-2014.mp4" download>download</a>.
Tutorial and Manual
-------------------
* `Browse online </doc/1.0>`_,
* `download PDF <http://downloads.kwant-project.org/doc/kwant-doc-1.0.1.pdf>`_,
* `download zipped HTML
<http://downloads.kwant-project.org/doc/kwant-doc-1.0.1.zip>`_ (for reading
without web access).
Article
-------
This paper (`download PDF <http://downloads.kwant-project.org/doc/kwant-paper.pdf>`__) introduces Kwant in a more systematic way and discusses its design and performance (`New J. Phys. 16, 063065 (2014) <http://iopscience.iop.org/1367-2630/16/6/063065/article>`_).
================
Kwant extensions
================
Going beyond the core package, there are several tools that extend Kwant in useful ways.
You can check these out below.
If you have some re-usable code that you think would be useful to the wider Kwant community,
post to the `Kwant development mailing list <mailto:kwant-discuss@kwant-project.org>`_ with a
link to the code and a couple of sentences describing it, and we'll add it to this page.
Semicon: k·p simulations made easy
----------------------------------
**Get the code**: https://gitlab.kwant-project.org/semicon/semicon
A package of tools for doing k·p simulations. Contains: model definitions, material parameters,
and helper functions for generating template Kwant systems.
Generating quasicrystals
------------------------
**Get the code**: https://arxiv.org/src/1510.06035v2/anc/quasicrystal.py
Code for reproducing numerics from the paper "`Aperiodic Weak Topological Superconductors <https://arxiv.org/abs/1510.06035>`_"
by Fulga et al.
Contains functionality for building 2D Ammann-Beenker tilings, an example of a quasicrystal, and
Kwant systems constructed from such tilings.
Time-dependent transport
------------------------
**Get the code**: https://gitlab.kwant-project.org/kwant/tkwant
A package for defining time-dependent systems with Kwant, and calculating
time-dependent quantities. Details of the algorithm can be found in the
following two papers:
+ `Towards realistic time-resolved simulations of quantum devices <https://dx.doi.org/10.1007/s10825-016-0855-9>`_
+ `Numerical simulations of time resolved quantum electronics <https://dx.doi.org/10.1016/j.physrep.2013.09.001>`_
Qsymm: Symmetry finder and symmetric Hamiltonian generator
----------------------------------------------------------
**Get the code**: https://gitlab.kwant-project.org/qt/qsymm
A package that makes symmetry analysis simple. It automatically generates model Hamiltonians from symmetry constraints and finds the full symmetry group of your Hamiltonian. Works with tight-binging and k dot p Hamiltonians and supports all kinds of symmetries, including conserved quantities, space group symmetries, time reversal, particle-hole and all combinations of these.
+ `Qsymm: algorithmic symmetry finding and symmetric Hamiltonian generation <http://dx.doi.org/10.1088/1367-2630/aadf67>`_
......@@ -2,5 +2,5 @@ Trial pre-release of Kwant
==========================
With the release of Kwant the instructions that were here were rendered
obsolete. Please go to the `installation instructions </install>`_ for the
obsolete. Please go to the `installation instructions </install.html>`_ for the
latest Kwant release.
Quantum transport simulations made easy
=======================================
.. raw:: html
<div class="workflow-image">
<object type="image/svg+xml" data="kwant-workflow.svgz" class="img-responsive">kwant-workflow.svgz</object>
</div>
Kwant is a `free (open source) <https://gitlab.kwant-project.org/kwant/kwant>`_,
powerful, and easy to use Python package for numerical calculations on tight-binding
models with a strong focus on quantum transport.
.. raw:: html
<div id="recent-posts" class="section col-sm-6">
<h2> Recent blog posts </h2>
.. post-list::
:stop: 4
.. raw:: html
</div>
.. raw:: html
<div id="kwant-uses" class="section col-sm-5">
<h2> Use Kwant to... </h2>
<ul id="kwant-uses-list">
<li>
<a href="/about#quantum-hall-effect"> Compute differential conductance </a>
</li>
<li>
<a href="/about#graphene-flake"> Visualize edge states </a>
</li>
<li>
<a href="/about#numerical-experiment-flying-qubit"> Conduct numerical experiments </a>
</li>
<li>
<a href="/doc/1/tutorial/spectrum#band-structure-calculations"> Explore band structure </a>
</li>
<li>
<a href="https://tkwant.kwant-project.org/"> Simulate time-dependent problems </a>
</li>
</div>
================================
Installing Kwant
================================
License and citation request
============================
Kwant is free software covered by the `2-clause BSD license </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
</cite>`_.
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``.
Platforms
=========
Installation instructions are available for the major operating systems:
+ `GNU/Linux`_
+ `Mac OS X`_
+ `Microsoft Windows`_
+ `Building from source`_
GNU/Linux
=========
Pre-built packages exist for the following distributions:
+ `Debian <#debian-and-derivatives>`_
+ `Ubuntu <#ubuntu-and-derivatives>`_
+ `Arch Linux`_
We also provide `Conda packages <#conda>`_ for users of the `Anaconda
<https://www.continuum.io/downloads>`_ 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 <#building-from-source>`_.
Debian and derivatives
----------------------
The easiest way to install Kwant on a Debian system is using the pre-built
packages we provide. We target Debian "stable", but our packages may also work
on many other recent Debian-derived distributions as well.
The following instructions will install Kwant on Debian stable "buster".
They need to be executed as root.
1. Add the following lines to ``/etc/apt/sources.list``::
deb http://ftp.debian.org/debian buster main
deb http://downloads.kwant-project.org/debian/ buster main
deb-src http://downloads.kwant-project.org/debian/ buster main
2. (Optional) Add the OpenPGP key used to sign the repositories by executing::
apt-key adv --keyserver keyserver.ubuntu.com --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::
apt-get update
apt-get install python3-kwant
Ubuntu and derivatives
----------------------
The easiest way to install Kwant on an Ubuntu 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
This should provide up-to-date Kwant for all recent versions of Ubuntu,
up to at least the last LTS version.
Debian or Ubuntu: building packages from source
-----------------------------------------------
It is straightforward to build Debian/Ubuntu packages from source. This can be
useful when the installation from pre-built packages has failed for some
reason (e.g. for non-x86 CPUs).
As a prerequisite, a ``deb-src`` entry for Kwant is needed in
``/etc/apt/sources.list``. (It will be present if either of the above
instructions for Debian or for Ubuntu have been followed.)
FIrst, install the build dependencies (as root)::
apt-get build-dep tinyarray kwant
Then, compile Tinyarray and Kwant. This may be done as a normal user. ::
cd /tmp
apt-get source --compile tinyarray
apt-get source --compile kwant
Finally, install the built packages (again as root)::
dpkg --install python3-tinyarray_*.deb
dpkg --install python3-kwant_*.deb
Arch Linux
----------
`Arch install scripts for Kwant
<https://aur.archlinux.org/packages/python-kwant/>`_ are kindly provided by
Jörg Behrmann (formerly by Max Schlemmer). To install, follow the `Arch User
Repository installation instructions
<https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages>`_.
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.
Mac OS X
========
`Pre-built packages <#conda>`_ for Max OS X exist for the Conda package
manager, which is a part of the ``Anaconda`` Python distribution.
Using Conda is the recommended way to install Kwant on Mac OS X.
If you do not want to use the Conda packages, you can always install Kwant
using `pip`_. Or by directly `building from source`_.
We previously maintained Homebrew and Macports packages for Kwant, but due to
effort required to keep them up to date we have dropped support for these
installation methods. We recommend that people use the Conda packages
whenever possible.
Microsoft Windows
=================
`Pre-built packages <#conda>`_ for Microsoft Windows exist for the Conda
package manager, which is a part of the ``Anaconda`` Python distribution.
Using Conda is the recommended way to install Kwant on Microsoft Windows.
We previously recommended using that Kwant packages built by
Christoph Gohlke, however due to the complexity of the installation
instructions the Conda packages are preferred. Installation of the
package provided by Christoph Gohlke is only needed if the integration
with MUMPS is required (as this is still not available for the Conda packages).
The instructions for installing the alternative package are included below
Alternative Package
-------------------
The following instructions explain how to install the official version
of Python 3, Kwant, and its dependencies.
1. Determine whether you have a 32-bit or 64-bit Windows installation by
following these `instructions <http://support.microsoft.com/kb/827218>`_.
2. Download and install Python 3 for the appropriate architecture (32-bit: “x86” or
64-bit: “x86-64”) from the official `Python download site for Windows
<http://www.python.org/download/windows>`_. The current stable version
at the time of writing is Python 3.6.
3. Open a command prompt, as described in "How do I get a command prompt" at
the `Microsoft Windows website <http://windows.microsoft.com/en-us/windows/command-prompt-faq>`_.
4. In the command prompt window, execute::
C:\Python36\python.exe C:\Python36\Tools\Scripts\win_add2path.py
(Instead of typing this command, you can also just copy it from here and
paste it into the command prompt window). If you did not use the default
location to install Python in step 2, then replace ``C:\Python36`` by the
actual location where Python is installed. You may also need to adjust the
version (“36” signifies Python 3.6).
5. Reboot your computer.
6. Download the necessary packages (with the ending ``.whl``) for your
operating system (32 or 64 bit) and Python version (e.g. ``cp35`` for
Python 3.5) from the website of `Christoph Gohlke
<http://www.lfd.uci.edu/~gohlke/pythonlibs/>`_. For Kwant, we recommend to
download at least `NumPy
<http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy>`_, `SciPy
<http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy>`_, `Matplotlib
<http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib>`_, `Sympy
<http://www.lfd.uci.edu/~gohlke/pythonlibs/#sympy>`_, `MPMath
<http://www.lfd.uci.edu/~gohlke/pythonlibs/#mpmath>`_, `Pytest
<http://www.lfd.uci.edu/~gohlke/pythonlibs/#pytest>`_, `Six
<http://www.lfd.uci.edu/~gohlke/pythonlibs/#six>`_, `Tinyarray
<http://www.lfd.uci.edu/~gohlke/pythonlibs/#tinyarray>`_, and `Kwant
<http://www.lfd.uci.edu/~gohlke/pythonlibs/#kwant>`_ itself. Make sure to
put the downloaded files into a directory without any other ``.whl`` files.
7. Open a command prompt with administrator rights, as described in “How do I
run a command with elevated permissions” at the `Microsoft Windows website
<http://windows.microsoft.com/en-us/windows/command-prompt-faq>`_.
Go to the directory with the ``.whl`` files, e.g.::
cd c:\Users\YOUR_USERNAME\Downloads
To install all the ``.whl``-files in the current directory, execute ::
python -c "import pip, glob; pip.main(['install', '--no-deps'] + glob.glob('*.whl'))"
The above cryptic command is equivalent to ``pip install --no-deps
*.whl``, i.e. it installs all the wheel files in the current directory
using pip. Because the Windows command interpreter does not support globs,
we have to rely on the globbing as provided by Python itself.
Now you are done, you can ``import kwant`` from within Python scripts.
(Note that many other useful scientific packages are available in Gohlke’s
repository. For example, you might want to install `IPython
<http://www.lfd.uci.edu/~gohlke/pythonlibs/#ipython>`_ and its various
dependencies so that you can use the `IPython notebook <http://ipython.org/notebook.html>`_.)
If you do not want to use the Conda packages, you can always install Kwant
using `pip`_. Or by directly `building from source`_.
Conda
=====
Conda is the package manager for the Anaconda Python distribution.
Kwant currently has Conda packages for GNU/Linux, Mac OS X, and Microsoft Windows.
1. Download the Python 3.6 version of `Anaconda <https://www.continuum.io/downloads>`_ for
your platform and install it.
2. Execute the following command in a terminal::
conda install -c conda-forge kwant
The above command installs Kwant and all of its dependencies from the
``conda-forge`` channel.
``pip``
=======
.. caution::
Installing Kwant with ``pip`` is not easy because Kwant has several
non-Python dependencies and requires a C compiler. These instructions
are provided for advanced users only.
``pip`` is the standard Python package manager that downloads and installs
packages from the `Python package index <https://pypi.python.org/>`_.
1. Install the non-Python dependencies of Kwant: a C compiler, BLAS, Lapack,
and (optionally) MUMPS (see `Installing non-Python dependencies`_).
2. Execute the following command in a terminal::
sudo pip3 install kwant
The above command installs Kwant and all of its Python dependencies from the
Python package index.
The latest development build of Kwant can be installed directly from Kwant's
Git repository::
sudo pip3 install git+https://gitlab.kwant-project.org/kwant/kwant.git
Each of the above commands will perform a system-wide install (to
``/usr/local`` on Unix). Type ``pip3 help install`` for installation options
and see `pip documentation <https://pip.readthedocs.org/>`_ for a detailed
description of ``pip``.
Installing non-Python dependencies
----------------------------------
As mentioned above, ``pip`` will not install any non-Python dependencies
required by Kwant. Kwant has several non-Python dependencies:
+ a C compiler (e.g. ``gcc``)
+ BLAS
+ Lapack
+ `MUMPS <http://graal.ens-lyon.fr/MUMPS/>`_.
If you using a GNU/Linux system then your distribution probably has packages
for these libraries; you will need to install the `-dev` or `-devel` versions
of the packages.
As an example, on a Debian or Ubuntu system, the following
command will install the non-Python dependencies of Kwant::
sudo apt-get install build-essential gfortran libopenblas-dev liblapack-dev libmumps-scotch-dev
On Debian or Ubuntu systems the Kwant build scripts should find libraries that
have been installed in the above way automatically. This will be signaled at
the end of the build process as follows::
******************************** Build summary ********************************
Default LAPACK and BLAS
Auto-configured MUMPS
*******************************************************************************
On other platforms it is possible that MUMPS is not linked against Kwant during
installation. If this is the case the build process must be `configured
manually <doc/1/pre/install.html#build-configuration>`_ by writing a
``build.conf`` file. You can then tell ``pip`` to use this ``build.conf`` when
installing kwant::
sudo pip install --global-option="--configfile=/path/to/build.conf" kwant
Building from source
====================
If no packages are available for the system you use, or if you would like to
build Kwant from source for another reason (expert users may want to customize
Kwant to use certain optimized versions of libraries), you can `download
the source code <https://downloads.kwant-project.org/kwant>`_ and consult the
documentation on `how to install Kwant from source <doc/1/pre/install.html>`_.
================================
Downloading and installing Kwant
================================
The quickest and easiest way to install Kwant is using the prepared packages
that are available for `Windows`_, GNU/Linux (`Debian
<#debian-and-derivatives>`_, `Ubuntu <#ubuntu-and-derivatives>`_, and their
variants, `Arch Linux`_), and `Mac OS X`_. It is possible to be notified about new releases
of Kwant through an `announcement mailing list
<community.html#announcements-of-new-releases>`_.
If no packages are available for the system you use, or if you would like to
build Kwant from source for another reason (expert users may want to customize
Kwant to use certain optimized versions of libraries), please consult the `full
installation instructions
<doc/1.0/pre/install.html#building-and-installing-from-source>`_ in the
documentation.
The source code of released versions of Kwant is available for `download
<http://downloads.kwant-project.org/kwant/>`_. You can follow the development
by cloning the `Git repository of Kwant <http://git.kwant-project.org/kwant>`_
(browsable online).
Windows
=======
There are multiple distributions of scientific Python software for Windows that
provide the prerequisites for Kwant. We recommend to use the packages kindly
provided by Christoph Gohlke. To install Kwant on Windows
1. Determine whether you have a 32-bit or 64-bit Windows installation by
following these `instructions <http://support.microsoft.com/kb/827218>`_.
2. Download and install Python 2.7 for the appropriate architecture (32-bit or
64-bit) from the official `Python download site
<http://www.python.org/download/>`_.
3. Open a command prompt, as described in "How do I get a command prompt" at
the `Microsoft Windows website <http://windows.microsoft.com/en-us/windows/command-prompt-faq>`_.
4. In the command prompt window, execute::
C:\Python27\python.exe C:\Python27\Tools\Scripts\win_add2path.py
(Instead of typing this command, you can also just copy it from here and
paste it into the command prompt window). If you did not use the default
location to install python in step 2, then replace ``C:\Python27`` by the
actual location where python is installed.
5. Reboot your computer
6. Now open a command prompt with administrator rights, as described in
"How do I run a command with elevated permissions" at the
`Microsoft Windows website <http://windows.microsoft.com/en-us/windows/command-prompt-faq>`_.
In this new command prompt window, execute::
pip install -U pip
pip install pyreadline
pip install --find-links http://downloads.kwant-project.org/gohlke-mirror/ ^
--trusted-host downloads.kwant-project.org --no-index numpy scipy ^
matplotlib ipython tornado pyzmq jinja2 nose tinyarray kwant
Now you are done!
If you want to run ipython notebook, open a command prompt (no need for
Adminstrator rights this time), and type::
ipython notebook
If you wish to install later other python packages form the website of
`Christoph Gohlke <http://www.lfd.uci.edu/~gohlke/pythonlibs/>`_, download
the package (with the ending ``.whl``) for your operating system (32 or 64 bit)
and install it from a command prompt as::
pip install filename
where filename is the name of the downloaded file.
Ubuntu and derivatives
======================
Execute the following commands::
sudo apt-add-repository ppa:kwant-project/ppa
sudo apt-get update
sudo apt-get install python-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``.
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 "wheezy" and
Debian "jessie", but they may also work on many other recent Debian-derived
systems as well. (For example, the following works with recent Ubuntu versions.)
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 pgp.mit.edu --recv-key C3F147F5980F3535
3. Update the package data, and install Kwant::
sudo apt-get update
sudo apt-get install python-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, which is
surprisingly easy::
cd /tmp
sudo apt-get build-dep tinyarray
apt-get source --compile tinyarray
sudo dpkg -i python-tinyarray_*.deb
sudo apt-get build-dep kwant
apt-get source --compile kwant
sudo dpkg -i python-kwant_*.deb python-kwant-doc_*.deb
This method should work for virtually all Debian-derived systems, even on exotic
architectures.
Arch Linux
==========
`Arch install scripts for Kwant <https://aur.archlinux.org/packages/python2-kwant/>`_ are kindly provided by Max Schlemmer.
To install, follow the `Arch User Repository installation instructions <https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages>`_.
Mac OS X
========
There is a number of different package managers for bringing software from the
Unix/Linux world to Mac OS X. Since the community is quite split, we provide
Kwant and its dependencies both via the `homebrew <http://brew.sh>`_ and the
`MacPorts <http://www.macports.org>`_ systems.
Mac OS X: homebrew
==================
homebrew is a recent addition to the package managers on Mac OS X. It is
lightweight, tries to be as minimalistic as possible and give the user
freedom than Macports. We recommend this option if you have no preferences.
1. Open a terminal and install homebrew as described on the `homebrew
homepage <http://brew.sh>`_ (instructions are towards the end of
the page)
2. Run ::
brew doctor
and follow its directions. It will ask for a few prerequisites to be
installed, in particular
* the Xcode developer tools (compiler suite for Mac OS X) from
`<http://developer.apple.com/downloads>`_. You will need an Apple ID to
download. Note that if you have one already from using the App store on the
Mac/Ipad/Iphone/... you can use that one. Downloading the command line
tools (not the full Xcode suite) is sufficient. If you have the full Xcode
suite installed, you might need to download the command line tools manually
if you have version 4 or higher. In this case go to `Xcode->Preferences`,
click on `Download`, go to `Components`, select `Command Line Tools` and
click on `Install`.
* although `brew doctor` might not complain about it right away, while we're
at it, you should also install the X11 server from the `XQuartz project
<http://xquartz.macosforge.org>`_ if you have Mac OS X 10.8 or higher.
3. Add permanently ``/usr/local/bin`` before ``/usr/bin/`` in the ``$PATH$``
environment variable of your shell, for example by adding ::
export PATH=/usr/local/bin:$PATH
at the end of your ``.bash_profile`` or ``.profile``. Then close
the terminal and reopen it again.
4. Install a few prerequisites ::
brew install gfortran python
5. Add additional repositories ::
brew tap homebrew/science
brew tap samueljohn/python
brew tap michaelwimmer/kwant
6. Install Kwant and its prerequisites ::
pip install nose
brew install numpy scipy matplotlib
brew install kwant
Notes:
- If something does not work as expected, use ``brew doctor`` for
instructions (it will find conflicts and things like that).
- As mentioned, homebrew allows for quite some freedom. In particular,
if you are an expert, you don't need necessarily to install
numpy/scipy/matplotlib from homebrew, but can use your own installation.
The only prerequisite is that they are importable from python. (the
Kwant installation will in any case complain if they are not)
- In principle, you need not install the homebrew python, but could use
Apple's already installed python. Homebrew's python is more up-to-date,
though.
Mac OS X: MacPorts
==================
MacPorts is a full-fledged package manager that recreates a whole Linux-like
environment on your Mac.
In order to install Kwant using MacPorts, you have to
1. Install a recent version of MacPorts, as explained in the
`installation instructions of MacPorts
<http://www.macports.org/install.php>`_.
In particular, as explained there, you will have to install also a
few prerequisites, namely
* the Xcode developer tools (compiler suite for Mac OS X) from
`<http://developer.apple.com/downloads>`_. You will need an Apple ID to
download. Note that if you have one already from using the App store
on the Mac/Ipad/Iphone/... you can use that one. You will also need the
command line tools: Within Xcode 4, you have to download them by going to
`Xcode->Preferences`, click on `Download`, go to `Components`,
select `Command Line Tools` and click on `Install`. Alternatively, you can
also directly download the command line tools from the
Apple developer website.
* if you have Mac OS X 10.8 or higher, the X11 server from the
`XQuartz project <http://xquartz.macosforge.org>`_.
2. After the installation, open a terminal and execute ::
echo http://downloads.kwant-project.org/macports/ports.tar |\
sudo tee -a /opt/local/etc/macports/sources.conf >/dev/null
(this adds the Kwant MacPorts download link
`<http://downloads.kwant-project.org/macports/ports.tar>`_ at the end of the
``sources.conf`` file.)
3. Execute ::
sudo port selfupdate
4. Now, install Kwant and its prerequisites ::
sudo port install py27-kwant
5. Finally, we choose python 2.7 to be the default python ::
sudo port select --set python python27
After that, you will need to close and reopen the terminal to
have all changes in effect.
Notes:
* If you have problems with macports because your institution's firewall
blocks macports (more precisely, the `rsync` port), resulting in
errors from ``sudo port selfupdate``, follow
`these instructions <https://trac.macports.org/wiki/howto/PortTreeTarball>`_.
* Of course, if you already have macports installed, you can skip step 1
and continue with step 2.