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
Showing
with 8568 additions and 268 deletions
File moved
import os
import yaml
from mako.lookup import TemplateLookup
import pyrtek, pyrtek.rst, pyrtek.mako
mako_filter = pyrtek.mako.Filter(TemplateLookup(['../templates']))
rst_filter = pyrtek.rst.Filter()
filters = {'mako': mako_filter,
'rst': rst_filter,
'default': pyrtek.chain_filters(rst_filter, mako_filter)}
default_meta = {'__filter__': 'default',
'__template__': 'default.mako'}
# rexp, repl, priority, func
rules = [(r'(.*)\.txt$', r'\1.html', 0,
lambda s, d: pyrtek.Text(s, d, filters, default_meta))]
def main():
# Load catalog, if it exists.
try:
with open('catalog.yaml') as f:
catalog = yaml.load(f)
except IOError:
catalog = {}
# The following block of code is executed inside the content directory.
saved_cwd = os.getcwd();
os.chdir('content')
try:
catalog = pyrtek.build(pyrtek.expand_rules(rules), catalog)
finally:
os.chdir(saved_cwd)
# Save catalog.
with open('catalog.yaml', 'w') as f:
yaml.dump(catalog, f)
if __name__ == '__main__':
main()
......@@ -29,3 +29,19 @@ RewriteRule ^(.*[^/])$ /$1.html [L]
# Remove trailing slash if the requested directory does not exist.
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [R=301,L]
Redirect 302 /contact /doc/latest/pre/authors
Redirect 302 /authors /doc/latest/pre/authors
Redirect 302 /citing /doc/latest/pre/citing
Redirect 302 /cite /doc/latest/pre/citing
Redirect 302 /license /doc/latest/pre/license
Redirect 302 /download /install
# Redirect old tutorial URLs to new ones.
# The tutorial numbers refer to the tutorial enumeration in Kwant 1.2.x
Redirect 302 /doc/1/tutorial/tutorial1 /doc/1/tutorial/first_steps
Redirect 302 /doc/1/tutorial/tutorial2 /doc/1/tutorial/spin_potential_shape
Redirect 302 /doc/1/tutorial/tutorial3 /doc/1/tutorial/spectrum
Redirect 302 /doc/1/tutorial/tutorial4 /doc/1/tutorial/graphene
Redirect 302 /doc/1/tutorial/tutorial5 /doc/1/tutorial/superconductor
Redirect 302 /doc/1/tutorial/tutorial6 /doc/1/tutorial/plotting
my_figure_drafts/bilayer.png

110 KiB

.. title: Improved web interface for the mailing list
.. slug: improved-interface-for-mailing-list
.. date: 2020-05-28 20:00:00 UTC
.. category:
.. type: text
The Kwant mailing list has been migrated to a new server that provides a much-improved web interface.
.. TEASER_END
In May 2020, thanks to the friendly people at python.org,
kwant-discuss was migrated to a server running Mailman 3.
The list remains a mailing list (existing subscriptions continue),
but now also offers a modern web interface that is similar to a web forum.
The complete archives were migrated and are now searchable.
Please see the `“community” section </community>`_ of this site for usage information.
The `old address of the list <kwant-discuss@kwant-project.org>`_ remains usable: any messages are simply redirected to the new one.
.. title: List of Kwant extensions added to website
.. slug: kwant-extensions
.. date: 2018-03-28 11:56:55 UTC
.. tags:
.. category:
.. link:
.. description:
.. type: text
We have added a `new section to the website </extensions.html>`_
that showcases useful extensions to Kwant that have been made by members of the
community.
.. TEASER_END
While we welcome contributions to the core Kwant package, we realize that
it can be a lot of work to implement something that is both robust enough
and of sufficiently general interest to be added to Kwant directly.
Nevertheless there is a body of existing software that extends Kwant in ways
that could be useful to others in the Kwant community. We hope that providing
a central place for listing these extensions will make them more discoverable
by others.
If you have extended Kwant in some way, please get in touch via the
`kwant-devel <mailto:kwant-devel@kwant-project.org>`_ mailing list!
Happy Kwanting,
Kwant team
.. title: Kwant adds an FAQ to the documentation
.. slug: kwant-faq-intro
.. date: 2017-06-29 07:07:23 UTC
.. tags:
.. category:
.. link:
.. description:
.. type: text
The Kwant team in Grenoble is currently hosting a masters student, Paul Clisson,
who has taken the initiative and written a "Frequently Asked
Questions" (FAQ) section to complement the existing Kwant tutorial; thanks Paul!
.. TEASER_END
A preliminary version of of the FAQ is already available
`here <https://test.kwant-project.org/doc/doc-faq/tutorial/FAQ>`_. Any and all
user feedback is valuable to us, so tell us what you think! You can either join
the `discussion on the mailing
list <https://www.mail-archive.com/kwant-discuss@kwant-project.org/msg01313.html>`_
or comment on the open `merge
request <https://gitlab.kwant-project.org/kwant/kwant/merge_requests/148>`_ on
the Kwant gitlab.
Happy Kwanting,
Kwant team
.. title: Release of Kwant 1.3
.. slug: release-of-kwant-13
.. date: 2017-05-24 21:17:10 UTC
.. category: release-announcement
.. type: text
After more than one year of development, we are extremely pleased to announce the release of Kwant 1.3.
.. TEASER_END
Kwant 1.3 supports
* discretizing of continuum Hamiltonians,
* calculating and displaying local densities and currents,
* declaring and using symmetries and conservation laws,
* calculating bulk properties using the kernel polynomial method,
* finalizing builders with multiple translational symmetries,
and has many other improvements that are detailed in the `what's new in Kwant 1.3 </doc/1/pre/whatsnew/1.3>`_ document.
The `installation instructions </install.html>`_ have been updated to explain how to install Kwant 1.3 on computers running GNU/Linux, Mac OS, and Windows. Note that thanks to the package manager Conda it is now much easier to install Kwant under Mac OS and on Unix accounts without root privileges.
The new version is practically 100% backwards-compatible with scripts written for previous versions of Kwant 1.x.
The Kwant team is happy to welcome Joseph Weston as a member. We are also grateful to the many contributors without whom this release would not be nearly as good:
* Jörg Behrmann
* Bas Nijholt
* Michał Nowak
* Viacheslav Ostroukh
* Pablo Pérez Piskunow
* Tómas Örn Rosdahl
* Sebastian Rubbert
* Rafał Skolasiński
* Adrien Sorgniard
We would like to hear your feedback at kwant-discuss@kwant-project.org.
.. title: Release of Kwant 1.4
.. slug: release-of-kwant-14
.. date: 2019-03-06 11:46:18 UTC
.. category: release-announcement
.. type: text
We are pleased to announce the release of Kwant 1.4, the result of a year and a half of development.
.. TEASER_END
Highlights of the new release:
* Adding magnetic field to systems, even in complicated cases, is now specially supported.
* The KPM module can now calculate conductivities.
* The `Qsymm library <https://gitlab.kwant-project.org/qt/qsymm>`_ for Hamiltonian symmetry analysis has been integrated.
* The handling of system parameters has been improved and optimized.
* Plotting has been improved, most notably through the addition of a routine that plots densities with interpolation.
* Installing Kwant on Windows is now much easier thanks to Conda packages.
All these and other improvements that are detailed in the `what's new in Kwant 1.4 </doc/1/pre/whatsnew/1.4>`_ document. The new version is practically 100% backwards-compatible with scripts written for previous versions of Kwant 1.x.
The following people contributed code to this release:
* Anton Akhmerov
* Paul Clisson
* Christoph Groth
* Thomas Kloss
* Bas Nijholt
* Pablo Pérez Piskunow
* Tómas Örn Rosdahl
* Rafał Skolasiński
* Dániel Varjas
* Joseph Weston
We would like to hear your feedback at kwant-discuss@kwant-project.org.
.. title: Release of TKwant 1.0
.. slug: release-of-tkwant-1-0
.. date: 2020-09-08 15:00:00 UTC
.. category: release-announcement
.. type: text
We are pleased to announce the first release of TKwant,
a Kwant extension for time-resolved quantum transport.
.. TEASER_END
A system is defined in TKwant in the same way as in Kwant except that some terms in the Hamiltonian may depend on the time parameter. Any system that can be studied in Kwant can be studied with TKwant as well. Typical problems where TKwant can be used include the propagation of voltage pulses, spectroscopy of interferometers, Floquet topological insulators, time resolved Andreev reflection and more.
An introduction to TKwant can be found in `TKwant paper <https://arxiv.org/abs/2009.03132>`_. The software itself and
its tutorials are available on the `TKwant website <https://tkwant.kwant-project.org/>`_.
import os, os.path
import re
import abc
import logging
import yaml
log = logging.getLogger(__name__)
class Item(object):
__metaclass__ = abc.ABCMeta
@abc.abstractproperty
def name(self):
pass
def isuptodate(self, oldmeta, catalog):
return False
def render(self, catalog):
"""Render the item, return re-generated metadata."""
pass
class Text(Item):
def __init__(self, source, dest, filters, default_meta={}):
self.source = source
self.dest = dest
self.filters = filters
self.default_meta = default_meta
def __repr__(self):
return '<{0}({1}, {2}, ...)>'.format(
self.__class__.__name__, self.source, self.dest)
@property
def name(self):
return self.dest
def render(self, catalog):
meta = self.default_meta.copy()
# Initialize data and metadata from source file.
with open(self.source) as f:
data = f.read().decode('utf-8')
if data.startswith('---\n'):
meta_yaml, data = data.split('\n---\n', 1)
meta.update(yaml.safe_load(meta_yaml[4:]))
# Appply filter.
try:
filter_name = meta['__filter__']
except KeyError:
log.error('{0}: No __filter__ defined.'.format(self.source))
else:
try:
filter = self.filters[filter_name]
except KeyError:
log.error('{0}: No filter {0}.'.format(filter_name))
else:
data, meta = filter(data, meta, self.dest, catalog)
# Write filtered data to destination file.
with open(self.dest, 'w') as f:
f.write(data.encode('utf-8'))
return meta
def build(items, old_catalog={}):
catalog = {}
for item in items:
name = item.name
meta = old_catalog.get(name)
if meta is None or not item.isuptodate(meta, catalog):
meta = item.render(catalog)
if name in catalog:
log.warning('{0} already present.'.format(name))
catalog[name] = meta
return catalog
def chain_filters(*filters):
def chained(data, meta, name, catalog):
for filter in filters:
data, meta = filter(data, meta, name, catalog)
return data, meta
return chained
def expand_rules(rules):
rules = [(rexp if hasattr(rexp, 'match') else re.compile(rexp),
repl, priority, func)
for rexp, repl, priority, func in rules]
priority_item_seq = []
for root, dirs, files in os.walk('.'):
for file in files:
# For security, do not follow symlinks.
source = os.path.join(root, file)
if os.path.islink(os.path.join(root, file)):
log.warn('Ignoring symlink: {0}'.format(source))
continue
for rexp, repl, priority, func in rules:
if not rexp.match(source):
continue
dest = rexp.sub(repl, source)
priority_item_seq.append((priority, func(source, dest)))
priority_item_seq.sort(key=lambda p_i: p_i[0])
return [i for p, i in priority_item_seq]
import logging
log = logging.getLogger(__name__)
class Filter(object):
def __init__(self, lookup):
self.lookup = lookup
def __call__(self, data, meta, name, catalog):
try:
template_name = meta['__template__']
except KeyError:
log.error('{0}: No __template__ defined.'.format(name))
return None, meta
# TODO: surround with try-block
template = self.lookup.get_template(template_name)
data = template.render(body=data, name=name, meta=meta, catalog=catalog)
return data, meta
import logging
import docutils.core, docutils.nodes, docutils.io, docutils as du
log = logging.getLogger(__name__)
class Filter(object):
def __call__(self, data, meta, name, catalog):
doctree = du.core.publish_doctree(data)
parts = du.core.publish_parts(doctree, reader_name='doctree',
source_class=du.io.DocTreeInput,
writer_name='html')
data = parts['html_body']
meta.setdefault('title', parts['title'])
meta.setdefault('subtitle', parts['subtitle'])
return data, meta
# Taken from
# http://www.linuxjournal.com/content/tech-tip-really-simple-http-server-python
import os
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
HandlerClass = SimpleHTTPRequestHandler
ServerClass = BaseHTTPServer.HTTPServer
Protocol = "HTTP/1.0"
server_address = ('127.0.0.1', 8000)
HandlerClass.protocol_version = Protocol
httpd = ServerClass(server_address, HandlerClass)
sa = httpd.socket.getsockname()
print "Serving HTTP on", sa[0], "port", sa[1], "..."
os.chdir('content')
httpd.serve_forever()
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link href="/common/kwant.css" rel="stylesheet" type="text/css" />
<title><%block name="title">Kwant: quantum transport simulation package</%block></title>
<link rel="icon" href="/common/kwant_icon.png" type="image/png" />
<%block name="extra_head" />\
</head>
<body>
<div class="padding">
<div id="header" class="meta">
<a href="/"><img alt="kwant_logo.png" src="/common/kwant_logo.png" /></a>
<h3 class="hidden_structure">Navigation</h3>
<ul class="navigation">
<li><a href="/">home</a></li>
<li><a href="/install.html">install</a></li>
<li><a href="/doc/">documentation</a></li>
<li><a href="/community.html">community</a></li>
<li><a href="/authors.html">authors</a></li>
<li><a href="/citing.html">citing</a></li>
</ul>
</div>
${next.body()}\
<%block name="tail"></%block>\
</div>
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
_paq.push(["setCookieDomain", "*.kwant-project.org"]);
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
(function() {
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://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.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><img src="http://piwik.kwant-project.org/piwik.php?idsite=1&amp;rec=1" style="border:0" alt="" /></noscript>
<!-- End Piwik Code: Analytics are used by us to improve the site, and not sent to anyone. -->
</body>
</html>
<%inherit file="base.mako"/>\
<%block name="title">${meta['title']} - Kwant</%block>\
${body}\
h1 {
text-align: center;
}
footer {
text-align: center;
margin-top: 1em;
padding-top: 0.3em;
border-top-style: solid;
border-top-color: #EEEEEE;
border-top-width: medium;
}
.nomargin {
margin-left: 0px;
margin-right: 0px;
}
/* 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;
}
/* Navbar styling */
.navbar-nav>li {
display: table-cell;
text-align: center;
}
.navbar-nav > li > a:hover {
text-decoration:underline;
}
.navbar-brand {
float: none;
}
.navbar-collapse {
text-align:center;
}
.navbar-nav {
display:inline-block;
float:none;
}
/* Index page workflow image styling */
.workflow-image {
padding-bottom: 20px;
}
/* Post list styling */
ul.post-list {
list-style-type: none;
padding-left: 0;
}
li.post-list-item {
padding-bottom: 5px;
}
li.post-list-item .post-item-title {
display: inline;
font-size: 1.1em;
}
/* Kwant uses list */
#kwant-uses-list {
list-style-type: none;
padding-left: 0;
}
#kwant-uses-list > li {
padding: .5em 0 .4em;
border-bottom: 1px solid #caccce;
}
.entry-title {
display: inline;
}
.postindex article.post-text {
border-bottom: 1px solid #caccce;
margin-bottom: .5em;
}
/* documentation links */
ul.docs-list {
padding-left: 0 ;
line-height: 2.5em ;
}
ul.docs-list ul {
padding-left: 20px;
}
ul.docs-list > li {
display: flex ;
}
ul.docs-list > li li {
display:inline ;
}
ul.inline-list {
display: inline ;
padding-left: 10px ;
}
ul.inline-list li{
display: inline ;
}
/* give button-like appearance to links, adapted from python.org */
.button-links a{
display: inline ;
vertical-align: baseline ;
width: auto ;
cursor: pointer ;
margin-bottom: .5em ;
padding: .4em .75em .35em ;
text-align: left ;
white-space: nowrap ;
border-radius: 6px ;
background-color: #eeeeee ;
text-decoration: none ;
}
.button-links a:hover {
background-color: #dddddd ;
}
/* target the "stable version" link. This is a massive hack, but we're
not web developers */
ul.docs-list > li:first-child > ul:nth-child(2) > li:first-child > a {
background-color: #0077cc ;
color: #eeeeee ;
}
ul.docs-list > li:first-child > ul:nth-child(2) > li:first-child > a:hover {
background-color: #0055aa ;
}
This diff is collapsed.
This diff is collapsed.
/*! Generated by Live LESS Theme Customizer */
@brand-primary: #07c;
@font-family-sans-serif: "Bitstream Vera Sans", Verdana, sans-serif;
@font-family-serif: "Bitstream Vera Serif", Georgia, serif;
@font-family-base: @font-family-serif;
@font-size-base: 16px;
@headings-font-family: @font-family-sans-serif;
@navbar-margin-bottom: 0;
@navbar-border-radius: 0;
@navbar-padding-vertical: 0;
@navbar-default-color: @gray-base;
@navbar-default-bg: white;
@navbar-default-border: white;
@navbar-default-link-color: @gray-base;
@well-bg: #eeeeee;