Skip to content
Snippets Groups Projects
Commit 1b18eb5c authored by Joseph Weston's avatar Joseph Weston
Browse files

update documentation to explicitly import kwant.continuum

parent 58cd87ed
No related branches found
No related tags found
No related merge requests found
Pipeline #
@@ -1,222 +1,236 @@ @@ -1,225 +1,239 @@
# Tutorial 2.9. Processing continuum Hamiltonians with discretize # Tutorial 2.9. Processing continuum Hamiltonians with discretize
# =============================================================== # ===============================================================
# #
...@@ -13,6 +13,9 @@ ...@@ -13,6 +13,9 @@
+import _defs +import _defs
import kwant import kwant
#HIDDEN_BEGIN_import
import kwant.continuum
#HIDDEN_END_import
import scipy.sparse.linalg import scipy.sparse.linalg
import scipy.linalg import scipy.linalg
import numpy as np import numpy as np
......
@@ -1,71 +1,75 @@ @@ -1,72 +1,76 @@
# Comprehensive example: quantum anomalous Hall effect # Comprehensive example: quantum anomalous Hall effect
# ==================================================== # ====================================================
# #
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
import math import math
import matplotlib.pyplot import matplotlib.pyplot
import kwant import kwant
import kwant.continuum
# 2 band model exhibiting quantum anomalous Hall effect # 2 band model exhibiting quantum anomalous Hall effect
......
...@@ -16,7 +16,9 @@ import sys, os ...@@ -16,7 +16,9 @@ import sys, os
from distutils.util import get_platform from distutils.util import get_platform
sys.path.insert(0, "../../build/lib.{0}-{1}.{2}".format( sys.path.insert(0, "../../build/lib.{0}-{1}.{2}".format(
get_platform(), *sys.version_info[:2])) get_platform(), *sys.version_info[:2]))
import kwant import kwant
import kwant.continuum # sphinx gets confused with lazy loading
# -- General configuration ----------------------------------------------------- # -- General configuration -----------------------------------------------------
......
...@@ -53,6 +53,11 @@ with :math:`A(x) = \frac{\hbar^2}{2 m(x)}`. ...@@ -53,6 +53,11 @@ with :math:`A(x) = \frac{\hbar^2}{2 m(x)}`.
Using `~kwant.continuum.discretize` to obtain a template Using `~kwant.continuum.discretize` to obtain a template
........................................................ ........................................................
First we must explicitly import the `kwant.continuum` package:
.. literalinclude:: /code/include/discretize.py
:start-after: #HIDDEN_BEGIN_import
:end-before: #HIDDEN_END_import
The function `kwant.continuum.discretize` takes a symbolic Hamiltonian and The function `kwant.continuum.discretize` takes a symbolic Hamiltonian and
turns it into a `~kwant.builder.Builder` instance with appropriate spatial turns it into a `~kwant.builder.Builder` instance with appropriate spatial
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment