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 (147)
Showing
with 885 additions and 1057 deletions
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
......@@ -32,59 +32,10 @@ BLOG_DESCRIPTION = "Kwant project website" # (translatable)
#
# Currently supported languages are:
#
# en English
# ar Arabic
# az Azerbaijani
# bg Bulgarian
# ca Catalan
# cs Czech [ALTERNATIVELY cz]
# da Danish
# de German
# el Greek [NOT gr]
# eo Esperanto
# es Spanish
# et Estonian
# eu Basque
# fa Persian
# fi Finnish
# fr French
# hi Hindi
# hr Croatian
# id Indonesian
# it Italian
# ja Japanese [NOT jp]
# ko Korean
# nb Norwegian Bokmål
# nl Dutch
# pl Polish
# pt_br Portuguese (Brasil)
# ru Russian
# sk Slovak
# sl Slovene
# sr Serbian (Cyrillic)
# sv Swedish
# tr Turkish [NOT tr_TR]
# uk Ukrainian
# ur Urdu
# zh_cn Chinese (Simplified)
#
# If you want to use Nikola with a non-supported language you have to provide
# a module containing the necessary translations
# (cf. the modules at nikola/data/themes/base/messages/).
# If a specific post is not translated to a language, then the version
# in the default language will be shown instead.
# What is the default language?
DEFAULT_LANG = "en"
# What other languages do you have?
# The format is {"translationcode" : "path/to/translation" }
# the path will be used as a prefix for the generated pages location
TRANSLATIONS = {
DEFAULT_LANG: "",
# Example for another language:
# "es": "./es",
}
# What will translated input files be named like?
......@@ -123,16 +74,25 @@ TRANSLATIONS_PATTERN = "{path}.{lang}.{ext}"
NAVIGATION_LINKS = {
DEFAULT_LANG: (
("/install", "install"),
("/doc", "documentation"),
("/community", "community"),
("/authors", "authors"),
("/citing", "citing")
("/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 = "bootstrap3-jinja"
THEME = "kwant"
# Below this point, everything is optional
......@@ -152,7 +112,7 @@ TIMEZONE = "UTC"
# Date format used to display post dates.
# (str used by datetime.datetime.strftime)
# DATE_FORMAT = '%Y-%m-%d %H:%M'
DATE_FORMAT = '%Y-%m-%d'
# Date format used to display post dates, if local dates are used.
# (str used by moment.js)
......@@ -203,7 +163,9 @@ TIMEZONE = "UTC"
# just independent HTML pages.
#
POSTS = () # No blog entries yet.
POSTS = (
("posts/*.rst", "", "post.tmpl"),
)
PAGES = (
("content/*.rst", "", "story.tmpl"),
......@@ -262,15 +224,15 @@ COMPILERS = {
# 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 = ''
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 = True
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 = True
WRITE_TAG_CLOUD = False
# Paths for different autogenerated bits. These are combined with the
# translation paths.
......@@ -407,11 +369,30 @@ REDIRECTIONS = []
# 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.
# DEPLOY_COMMANDS = {
# 'default': [
# "rsync -rav --delete output/ joe@my.site:/srv/www/site",
# ]
# }
# 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.
......@@ -607,13 +588,11 @@ IMAGE_FOLDERS = {'images': 'images'}
# FAVICONS contains (name, file, size) tuples.
# Used to create favicon link like this:
# <link rel="name" href="file" sizes="size"/>
# FAVICONS = (
# ("icon", "/favicon.ico", "16x16"),
# ("icon", "/icon_128x128.png", "128x128"),
# )
FAVICONS = (
("icon", "/kwant_icon.png", "32x32"),)
# Show only teasers in the index pages? Defaults to False.
# INDEX_TEASERS = False
INDEX_TEASERS = True
# HTML fragments with the Read more... links.
# The following tags exist and are replaced for you:
......@@ -628,9 +607,9 @@ IMAGE_FOLDERS = {'images': 'images'}
# }} A literal } (U+007D RIGHT CURLY BRACKET)
# 'Read more...' for the index page, if INDEX_TEASERS is True (translatable)
INDEX_READ_MORE_LINK = '<p class="more"><a href="{link}">{read_more}…</a></p>'
INDEX_READ_MORE_LINK = ''
# 'Read more...' for the RSS_FEED, if RSS_TEASERS is True (translatable)
RSS_READ_MORE_LINK = '<p><a href="{link}">{read_more}…</a> ({min_remaining_read})</p>'
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.
......@@ -640,7 +619,7 @@ RSS_READ_MORE_LINK = '<p><a href="{link}">{read_more}…</a> ({min_remaining_rea
# {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"
RSS_LINKS_APPEND_QUERY = False
FEED_LINKS_APPEND_QUERY = False
# A HTML fragment describing the license, for the sidebar.
# (translatable)
......@@ -655,7 +634,7 @@ LICENSE = ""
# A small copyright notice for the page footer (in HTML).
# (translatable)
CONTENT_FOOTER = 'Contents &copy; {date} <a href="mailto:{email}">{author}</a> - Powered by <a href="https://getnikola.com" rel="nofollow">Nikola</a> {license}'
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
......@@ -672,7 +651,7 @@ CONTENT_FOOTER_FORMATS = {
DEFAULT_LANG: (
(),
{
"email": BLOG_EMAIL,
"url": "/authors",
"author": BLOG_AUTHOR,
"date": time.gmtime().tm_year,
"license": LICENSE
......@@ -740,7 +719,7 @@ STRIP_INDEXES = False
# This can be disabled on a per-page/post basis by adding
# .. pretty_url: False
# to the metadata.
PRETTY_URLS = True
PRETTY_URLS = False
# If True, publish future dated posts right away instead of scheduling them.
# Defaults to False.
......@@ -829,7 +808,7 @@ COPY_SOURCES = False
# 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
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.
......@@ -838,7 +817,7 @@ COPY_SOURCES = False
# 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 = False
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
......@@ -907,7 +886,26 @@ COPY_SOURCES = False
# Google Analytics or whatever else you use. Added to the bottom of <body>
# in the default template (base.tmpl).
# (translatable)
# BODY_END = ""
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.
......
*.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 2 June 2015**: Please fill out the `Kwant user survey </2015-survey>`_ and ask other Kwant users you know to do so. Thank you for your feedback!
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
=================================================
General mailing list
--------------------
The `kwant-discuss
<https://mailman-mail5.webfaction.com/listinfo/kwant-discuss>`_ 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
<p><form id="searchgmane" method="get" action="http://search.gmane.org/">
<input type="text" name="query" size=25 value="Your query" onblur="if (this.value == '') {this.value='Your query'}" onfocus="if (this.value == 'Your query') {this.value=''}" />
<input type="hidden" name="group" value="gmane.comp.science.kwant.user" />
<input type="submit" value="Search kwant-discuss" />
</form></p>
- .. 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 kwant-discuss" />
</form>
… and receive new messages with your regular email. (Use the `kwant-discuss options page <https://mailman-mail5.webfaction.com/options/kwant-discuss>`_ to unsubscribe.)
- Follow the list through a web interface: `kwant-discuss on Gmane <http://dir.gmane.org/gmane.comp.science.kwant.user>`_ or
`kwant-discuss on Mail-archive <https://www.mail-archive.com/kwant-discuss@kwant-project.org/>`_.
Gmane allows to write new messages (action: post) and to reply (action: followup).
Both Gmane and Mail-archive provide RSS feeds.
- 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.)
Development list
----------------
Those who are interested (or would like to participate) in the further
development of Kwant are invited to subscribe to the `kwant-devel
<https://mailman-mail5.webfaction.com/listinfo/kwant-devel>`_ mailing list.
This is the place for technical discussions about changes to Kwant.
Please do not send bug reports to this list but rather to kwant-discuss.
Kwant-devel works in the same way as kwant-discuss:
- .. raw:: html
<p><form id="searchgmane" method="get" action="http://search.gmane.org/">
<input type="text" name="query" size=25 value="Your query" onblur="if (this.value == '') {this.value='Your query'}" onfocus="if (this.value == 'Your query') {this.value=''}" />
<input type="hidden" name="group" value="gmane.comp.science.kwant.devel" />
<input type="submit" value="Search kwant-devel" />
</form></p>
- .. raw:: html
<form method=post action="https://mailman-mail5.webfaction.com/subscribe/kwant-devel">
<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 kwant-devel" />
</form>
(Use the `kwant-devel options page <https://mailman-mail5.webfaction.com/options/kwant-devel>`_ to unsubscribe.)
- There exist web interfaces: `kwant-devel on Gmane <http://dir.gmane.org/gmane.comp.science.kwant.devel>`_ and
`kwant-devel on Mail-archive <https://www.mail-archive.com/kwant-devel@kwant-project.org/>`_.
Both provide RSS feeds, Gmane also allows posting through the web interface.
- Message can be sent directly to kwant-devel@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 (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.
- View archives: `kwant-announce on Gmane <http://dir.gmane.org/gmane.comp.science.kwant.announce>`_ or `kwant-announce on Mail-archive <https://www.mail-archive.com/kwant-announce@kwant-project.org/>`_. Both Gmane and Mail-archive provide RSS feeds.
- .. 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>
(Use the `kwant-announce options page <https://mailman-mail5.webfaction.com/options/kwant-announce>`_ to unsubscribe.)
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 general mailing list. (You may use the search
box at the top of this page.)
If the problem is not known yet, please send a bug report to
kwant-discuss@kwant-project.org. 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.
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 general mailing list kwant-discuss@kwant-project.org, 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 build Kwant and the documentation as
described in the `build instructions
</doc/1.0/pre/install.html#building-and-installing-from-source>`_.
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.
We recommend that you keep your changes on a separate `topic branch
<https://www.kernel.org/pub/software/scm/git/docs/gitworkflows.html#_topic_branches>`_
that starts at *master*. To create such a branch, use the command::
git checkout -b my_topic_branch master
Once you have something that you would like to share, let us know about it by
posting to kwant-devel@kwant-project.org. We are happy to receive useful
contributions in any reasonable way: you can send patches to the mailing list,
make your git repository available on the web (you could use a service like
github), or even directly send the file that you modified.
The recommended way is sending patches to the mailing list. (This avoids
confusion by publishing unfinished git branches and allows code review.) See
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/>`_,
it’s easy.
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.
* Create a logical sequence of commits with clear commit messages.
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 --cython
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.
The option ``--cython`` enables the translation of .pyx files into .c files.
It is only needed if any .pyx files have been modified.
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/>`_,
* `download PDF <http://downloads.kwant-project.org/doc/kwant-doc-1.1.1.pdf>`_,
* `download zipped HTML
<http://downloads.kwant-project.org/doc/kwant-doc-1.1.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 GNU/Linux (`Debian <#debian-and-derivatives>`_, `Ubuntu
<#ubuntu-and-derivatives>`_, and their variants, `Arch Linux`_), `Mac OS X`_,
and `Microsoft Windows`_. 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).
Debian and derivatives
======================
The easiest way to install Kwant on a Debian system is using the pre-built
packages we provide. Our packages are known to work with Debian "stable" and
Debian "testing", but they may also work on many other recent Debian-derived
systems as well. (For example, the following works with recent Ubuntu
versions, too.)
The lines prefixed with ``sudo`` have to be run as root.
1. Add the following lines to ``/etc/apt/sources.list``::
deb http://downloads.kwant-project.org/debian/ stable main
deb-src http://downloads.kwant-project.org/debian/ stable main
2. (Optional) Add the OpenPGP key used to sign the repositories by executing::
sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-key C3F147F5980F3535
The fingerprint of the key is 5229 9057 FAD7 9965 3C4F 088A C3F1 47F5 980F
3535.
3. Update the package data, and install Kwant::
sudo apt-get update
sudo apt-get install 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.
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``.
Arch Linux
==========
Arch install scripts for Kwant are kindly provided by Jörg Behrmann (formerly
by Max Schlemmer). To install, follow the `Arch User Repository installation
instructions
<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
========
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 gcc python
5. Add additional repositories ::
brew tap homebrew/science
brew tap homebrew/python
brew tap michaelwimmer/kwant
6. Install Kwant and its prerequisites ::
pip install nose six
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.
Microsoft 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. Download the necessary packages (with the ending ``.whl``) for your
operating system (32 or 64 bit) and Python version (e.g. ``cp27`` for Python
2.7) 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>`_, `Nose <http://www.lfd.uci.edu/~gohlke/pythonlibs/#nose>`_, `Tinyarray <http://www.lfd.uci.edu/~gohlke/pythonlibs/#tinyarray>`_, and `Kwant <http://www.lfd.uci.edu/~gohlke/pythonlibs/#kwant>`_ itself.
7. 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 <filename>
for each of the downloaded files (replacing ``<filename>`` with it).
Now you are done, you can ``import kwant`` from within Python scripts.
(Note that many other userful 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>`_.)
File moved