Commit 164f611b authored by Anton Akhmerov's avatar Anton Akhmerov

prepare a more detailed test suit, fix minor typos

Summary of changes:
* Add a test for trailing whitespace, remove all trailling whitespace
* Add a test for broken URLs in docs, fix all broken URLs and permanent redirects
* Switch sphinx doc build to strict (warnings to errors) and nitpicky (broken links to warnings). Fix all sphinx warnings.
* Deploy docs from any commit to [kwant/kwant](https://gitlab.kwant-project.org/kwant/kwant) to https://test.kwant-project.org/doc/dev
* Deploy docs from any commit to master at kwant/kwant to https://kwant-project.org/doc/dev
* Deploy docs from any tag release tag (so anything that is vX.Y.Z) at kwant/kwant to https://kwant-project.org/doc/X.Y
parent 10e93957
Pipeline #801 passed with stages
in 65 minutes and 2 seconds
job:
image: kwant/testing
stages:
- build
- test
- deploy
build package:
stage: build
script:
- ./setup.py build --cython-trace
- ./setup.py build_ext --cython-trace -i
artifacts:
untracked: true
expire_in: 1 hour
check for whitespace:
stage: build
script:
- "! for f in `git ls-files | grep -v \\.diff$`; do file $f | grep -q ' text' && grep -l '[[:blank:]]$' $f; done | grep . >&2"
allow_failure: true
check for dependencies installed:
stage: test
script:
- if [ -d .eggs ]; then echo "$(ls -d .eggs/*/) downloaded by build, update build environment" >&2; fi
allow_failure: true
build documentation:
stage: test
script:
- make -C doc realclean; make -C doc html SPHINXOPTS='-A website_deploy=True -n -W'
artifacts:
paths:
- doc/build/html/
expire_in: 1 month
run tests:
stage: test
script:
- python3 setup.py build --cython-trace
- python3 setup.py build_ext --cython-trace -i
- make -C doc clean && make -C doc html
- py.test --cov=kwant --flakes kwant
check for broken links in doc:
stage: test
script:
- make -C doc linkcheck
allow_failure: true
upload documentation to the test server:
stage: deploy
only:
- branches@kwant/kwant
script:
- mkdir -p ~/.ssh && ssh-keyscan kwant-project.org >> ~/.ssh/known_hosts
- echo $TEST_WEBSITE_KEY | base64 -d > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
- rsync -rlv --delete doc/build/html/* kwant@kwant-project.org:doc/dev
- rm -rf ~/.ssh
upload dev version docs:
stage: deploy
only:
- master@kwant/kwant
script:
- mkdir -p ~/.ssh && ssh-keyscan kwant-project.org >> ~/.ssh/known_hosts
- echo $MASTER_WEBSITE_KEY | base64 -d > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
- rsync -rlv --delete doc/build/html/* kwant@kwant-project.org:doc/dev
- rm -rf ~/.ssh
upload docs of tagged build:
stage: deploy
only:
- /^v[0-9]+\.[0-9]+.[0-9]+$/@kwant/kwant
script:
- mkdir -p ~/.ssh && ssh-keyscan kwant-project.org >> ~/.ssh/known_hosts
- echo $MASTER_WEBSITE_KEY | base64 -d > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
- rsync -rlv --delete doc/build/html/* kwant@kwant-project.org:doc/test$(echo $CI_BUILD_TAG | sed 's/v\([0-9]\+\.[0-9]\+\)\.[0-9]\+/\1/')
- rm -rf ~/.ssh
......@@ -22,12 +22,12 @@ Other contributors to Kwant include
We thank Christoph Gohlke for the creation of installers for Microsoft Windows.
`CEA <http://cea.fr>`_ is the French Commissariat à l'énergie atomique et aux
`CEA <http://www.cea.fr>`_ is the French Commissariat à l'énergie atomique et aux
énergies alternatives. The CEA is the copyright holder for the contributions of
C. W. Groth, X. Waintal, and its other employees involved in Kwant.
To find out who wrote a certain part of Kwant, please use the "blame" feature of
`Git <http://git-scm.com/>`_, the version control system.
`Git <https://git-scm.com/>`_, the version control system.
Funding
......
......@@ -15,7 +15,7 @@ cite the main paper that introduces Kwant:
C. W. Groth, M. Wimmer, A. R. Akhmerov, X. Waintal,
*Kwant: a software package for quantum transport*,
`New J. Phys. 16, 063065 (2014)
<http://iopscience.iop.org/1367-2630/16/6/063065/article>`_.
<https://iopscience.iop.org/1367-2630/16/6/063065/article>`_.
Other references we ask you to consider
......
......@@ -10,5 +10,5 @@ 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. Please see the `Kwant website
<http://kwant-project.org/community>`_ for information on how to get in touch
<https://kwant-project.org/community>`_ for information on how to get in touch
with the Kwant community.
......@@ -4,7 +4,7 @@ Installation of Kwant
Ready-to-use Kwant packages are available for many platforms (like GNU/Linux,
Mac OS X, Microsoft Windows). See the `installation page of the Kwant website
<http://kwant-project.org/install>`_ for instructions on how to install Kwant
<https://kwant-project.org/install>`_ for instructions on how to install Kwant
on your platform. This is the recommended way for new users.
The remainder of this section documents how to build Kwant from source. This
......@@ -19,27 +19,27 @@ Prerequisites
=============
Building Kwant requires
* `Python <http://python.org>`_ 3.4 or above (Kwant 1.1 is the last version to
support Python 2),
* `Python <https://www.python.org>`_ 3.4 or above (Kwant 1.1 is the last
version to support Python 2),
* `SciPy <http://scipy.org>`_ 0.9 or newer,
* `LAPACK <http://netlib.org/lapack/>`_ and `BLAS <http://netlib.org/blas/>`_,
(For best performance we recommend the free `OpenBLAS
<http://xianyi.github.com/OpenBLAS/>`_ or the nonfree `MKL
<http://software.intel.com/en-us/intel-mkl>`_.)
<http://www.openblas.net/>`_ or the nonfree `MKL
<https://software.intel.com/en-us/intel-mkl>`_.)
* `Tinyarray <https://gitlab.kwant-project.org/kwant/tinyarray>`_, a NumPy-like
Python package optimized for very small arrays,
* An environment which allows to compile Python extensions written in C and
C++.
The following software is highly recommended though not strictly required:
* `matplotlib <http://matplotlib.sourceforge.net/>`_ 1.1 or newer, for Kwant's
* `matplotlib <http://matplotlib.org/>`_ 1.1 or newer, for Kwant's
plotting module and the tutorial,
* `MUMPS <http://graal.ens-lyon.fr/MUMPS/>`_, a sparse linear algebra library
that will in many cases speed up Kwant several times and reduce the memory
footprint. (Kwant uses only the sequential, single core version
of MUMPS. The advantages due to MUMPS as used by Kwant are thus independent
of the number of CPU cores of the machine on which Kwant runs.)
* The `py.test testing framework <http://http://pytest.org/>`_ for running the
* The `py.test testing framework <http://pytest.org/>`_ for running the
tests included with Kwant.
In addition, to build a copy of Kwant that has been checked-out directly from
......@@ -52,8 +52,8 @@ Building and installing Kwant
=============================
Kwant can be built and installed following the `usual Python conventions
<http://docs.python.org/install/index.html>`_ by running the following commands
in the root directory of the Kwant distribution. ::
<https://docs.python.org/3/install/index.html>`_ by running the following
commands in the root directory of the Kwant distribution. ::
python3 setup.py build
python3 setup.py install
......@@ -88,7 +88,7 @@ configuration file consists of sections, one for each dependency, led by a
[dependency-name] header and followed by name = value entries. Possible names
are keyword arguments for ``distutils.core.Extension`` (For a complete list,
see its `documentation
<http://docs.python.org/3/distutils/apiref.html#distutils.core.Extension>`_).
<https://docs.python.org/3/distutils/apiref.html#distutils.core.Extension>`_).
The corresponding values are whitespace-separated lists of strings.
The two currently possible sections are [lapack] and [mumps]. The former
......@@ -111,14 +111,14 @@ Example ``build.conf`` for linking Kwant with Intel MKL.::
The detailed syntax of ``build.conf`` is explained in the `documentation of
Python's configparser module
<http://docs.python.org/3/library/configparser.html#supported-ini-file-structure>`_.
<https://docs.python.org/3/library/configparser.html#supported-ini-file-structure>`_.
Building the documentation
==========================
To build the documentation, the `Sphinx documentation generator
<http://sphinx.pocoo.org/>`_ is required with ``numpydoc`` extension
<http://www.sphinx-doc.org/en/stable/>`_ is required with ``numpydoc`` extension
(version 0.5 or newer). If PDF documentation is to be built, the tools
from the `libRSVG <http://live.gnome.org/LibRsvg>`_ (Debian/Ubuntu package
``librsvg2-bin``) are needed to convert SVG drawings into the PDF format.
......@@ -176,13 +176,13 @@ to be updated for Kwant 1.2. (Help is welcome.)
The required dependencies of Kwant are best installed with one of the packaging
systems. Here we only consider the case of `MacPorts
<http://www.macports.org>`_ in detail. Some remarks for homebrew are given
<https://www.macports.org>`_ in detail. Some remarks for homebrew are given
below.
1. Install a recent version of MacPorts, as explained in the `installation
instructions of MacPorts <http://www.macports.org/install.php>`_. `The
instructions of MacPorts <https://www.macports.org/install.php>`_. `The
MacPorts section of the Kwant website
<http://kwant-project.org/install#mac-os-x-macports>`_ may be also of
<https://kwant-project.org/install#mac-os-x-macports>`_ may be also of
interest. (Note that it describes how to install Kwant using a ports file,
while the aim here is to install from source manually.)
......
......@@ -260,3 +260,13 @@ class BoundMethodDocumenter(autodoc.FunctionDocumenter):
def setup(app):
app.add_autodocumenter(BoundMethodDocumenter)
# IOP times out on check but the link verified and correct.
linkcheck_ignore = [r'https://iopscience.iop.org/1367-2630/16/6/063065/article']
nitpick_ignore = [('py:class', 'Warning'), ('py:class', 'Exception'),
('py:class', 'object'), ('py:class', 'tuple'),
('py:class', 'kwant.operator._LocalOperator'),
('py:class', 'numpy.ndarray'),
('py:class', 'kwant.solvers.common.BlockResult')]
......@@ -89,6 +89,6 @@ wave function in the scattering region due to any mode of any lead.
Return value of sparse solver
-----------------------------
The function `~kwant.solvers.default.solve` of sparse solvers now
always returns a single instance of `~kwant.solvers.common.BlockResult`. The
always returns a single instance of ``BlockResult``. The
latter has been generalized to include more information for leads defined as
infinite systems.
......@@ -2,8 +2,9 @@ What's new in Kwant 1.0
=======================
This article explains the new features in Kwant 1.0 compared to Kwant 0.2.
Kwant 1.0 was released on 9 September 2013.
Please consult the `full list of changes in Kwant <http://git.kwant-project.org/kwant/log/?h=v1.0.5>`_ for all the changes up to the most recent bugfix release.
Kwant 1.0 was released on 9 September 2013. Please consult the `full list of
changes in Kwant <https://git.kwant-project.org/kwant/log/?h=v1.0.5>`_ for all
the changes up to the most recent bugfix release.
Lattice and shape improvements
......@@ -61,7 +62,7 @@ Some renames
scattering matrix, the latter the retarded Green's function between the sites
adjacent to the leads. It is temporarily not possible to mix self-energy and
modes leads within the same system.
* The object that contained the results, `BlockResult` was also split into
* The object that contained the results, ``BlockResult`` was also split into
`~kwant.solvers.common.SMatrix` and `~kwant.solvers.common.GreensFunction`.
Band structure plots
......@@ -71,8 +72,8 @@ structure was implemented.
Immutable site families
-----------------------
In order to make naming more consistent, `kwant.make_lattice` was renamed and
can be found now as `~kwant.lattice.general`. Classes ``Chain``, ``Square``,
In order to make naming more consistent, ``kwant.make_lattice`` was renamed and
can be found now as `kwant.lattice.general`. Classes ``Chain``, ``Square``,
and ``Honeycomb`` from `~kwant.lattice` were made functions
`~kwant.lattice.chain`, `~kwant.lattice.square`, and
`~kwant.lattice.honeycomb`.
......
What's new in Kwant 1.1
=======================
This article explains the user-visible changes in Kwant 1.1, released on 21 October 2015.
Please consult the `full list of changes in Kwant <http://git.kwant-project.org/kwant/log/?h=stable>`_ for all the changes up to the most recent bugfix release.
This article explains the user-visible changes in Kwant 1.1, released on 21
October 2015. Please consult the `full list of changes in Kwant
<https://git.kwant-project.org/kwant/log/?h=stable>`_ for all the changes up to
the most recent bugfix release.
Harmonize `~kwant.physics.Bands` with `~kwant.physics.modes`
------------------------------------------------------------
......@@ -51,11 +53,11 @@ book by S. Datta.
Deduction of transmission probabilities
---------------------------------------
If `kwant.smatrix` or `kwant.greens_function` have been called with
``check_hermicity=True`` (on by default) and a restricted number of leads in
the ``out_leads`` and ``in_leads`` parameters, calls to ``transmission`` and
``conductance_matrix`` will work whenever it is possible to deduce the result
from current conservation.
If `~kwant.solvers.common.smatrix` or `~kwant.solvers.common.greens_function`
have been called with ``check_hermicity=True`` (on by default) and a restricted
number of leads in the ``out_leads`` and ``in_leads`` parameters, calls to
``transmission`` and ``conductance_matrix`` will work whenever it is possible
to deduce the result from current conservation.
This allows leaving out one lead (preferably the widest) from ``out_leads``
and ``in_leads``, and still to calculate all transmission probabilities.
......@@ -76,7 +78,7 @@ the error message will be more helpful now.
Please continue reporting confusing error messages on the Kwant mailing list.
New option ``pos_transform`` of `~kwant.plotter.map`
New option ``pos_transform`` of `kwant.plotter.map`
----------------------------------------------------------------
This option which already existed for `kwant.plotter.plot` is now also
available for `kwant.plotter.map`.
......@@ -89,6 +89,6 @@ Graph algorithms
Other
-----
+--------------+------------------------------------------+
| `gint_dtype` | Data type used for graph nodes and edges |
+--------------+------------------------------------------+
+----------------+------------------------------------------+
| ``gint_dtype`` | Data type used for graph nodes and edges |
+----------------+------------------------------------------+
:mod:`kwant.system` -- Low-level interface of systems
*****************************************************
.. currentmodule:: kwant.system
.. automodule:: kwant.system
This module is the binding link between constructing tight-binding systems and
doing calculations with these systems. It defines the interface which any
......
......@@ -7,8 +7,7 @@ commented extensively. In addition, you will find notes about more subtle,
technical details at the end of each example. At first reading, these notes may
be safely skipped.
A scientific article about Kwant is available as well, see `Kwant
website <http://kwant-project.org/citing.html>`_.
A scientific article about Kwant is available as well, see :doc:`/pre/citing`.
The article introduces Kwant with a somewhat different focus than the tutorial
and it is the authors' intention that both texts complement each other. While
......@@ -26,14 +25,14 @@ transport in mesoscopic systems" by Supriyo Datta.
The Python programming language
...............................
Kwant is a library for `Python <http://python.org/>`_. Care was taken to fit
well with the spirit of the language and to take advantage of its expressive
power. If you do not know Python yet, do not fear: Python is widely regarded
as one of the most accessible programming languages. For an introduction we
recommend the `official Python Tutorial <http://docs.python.org/2/tutorial/>`_.
The `Beginner's Guide to Python <http://wiki.python.org/moin/BeginnersGuide>`_
contains a wealth of links to other tutorials, guides and books including some
for absolute beginners.
Kwant is a library for `Python <https://www.python.org/>`_. Care was taken to
fit well with the spirit of the language and to take advantage of its
expressive power. If you do not know Python yet, do not fear: Python is widely
regarded as one of the most accessible programming languages. For an
introduction we recommend the `official Python Tutorial
<https://docs.python.org/3/tutorial/>`_. The `Beginner's Guide to Python
<https://wiki.python.org/moin/BeginnersGuide>`_ contains a wealth of links to
other tutorials, guides and books including some for absolute beginners.
Kwant
.....
......
......@@ -221,7 +221,7 @@ directly compute the total transmission probability from lead 0 to lead 1 as
is the same as the numbering assigned by the call to
`~kwant.builder.Builder.attach_lead` earlier in the tutorial.
Finally we can use `matplotlib` to make a plot of the computed data
Finally we can use ``matplotlib`` to make a plot of the computed data
(although writing to file and using an external viewer such as
gnuplot or xmgrace is just as viable)
......@@ -512,4 +512,4 @@ The result of the example should be identical to the previous one.
.. rubric:: Footnotes
.. [#] http://docs.python.org/library/__main__.html
.. [#] https://docs.python.org/3/library/__main__.html
......@@ -39,7 +39,7 @@ realistic parameters).
The tight-binding model corresponding to the Rashba-Hamiltonian naturally
exhibits a 2x2-matrix structure of onsite energies and hoppings. In order to
use matrices in our program, we import the Tinyarray package. (`NumPy
<http://numpy.scipy.org/>`_ would work as well, but Tinyarray is much faster
<http://www.numpy.org/>`_ would work as well, but Tinyarray is much faster
for small arrays.)
.. literalinclude:: spin_orbit.py
......
......@@ -122,7 +122,7 @@ better for the special case of a square lattice.
- `~kwant.system.System.hamiltonian_submatrix` can also return a sparse
matrix, if the optional argument ``sparse=True``. The sparse matrix is in
SciPy's `scipy.sparse.coo_matrix` format, which can be easily be converted
SciPy's ``scipy.sparse.coo_matrix`` format, which can be easily be converted
to various other sparse matrix formats (see `SciPy's documentation
<http://docs.scipy.org/doc/scipy/reference/>`_).
......
......@@ -168,7 +168,7 @@ above the gap. At the gap edge, we observe a resonant Andreev reflection.
- It is in fact possible to separate electron and hole degrees of
freedom in the scattering matrix, even if one uses matrices for
these degrees of freedom. In the solve step,
`~kwant.solvers.common.SparseSolver.smatrix` returns an array containing
`~kwant.solvers.common.smatrix` returns an array containing
the transverse wave functions of the lead modes (in
`SMatrix.lead_info <kwant.solvers.common.SMatrix.lead_info>`.
By inspecting the wave functions, electron and hole wave
......
......@@ -51,7 +51,7 @@ the start end end site of hopping as arguments:
:start-after: #HIDDEN_BEGIN_plotsyst2
:end-before: #HIDDEN_END_plotsyst2
Note that since we are using an unfinalized Builder, a `site` is really an
Note that since we are using an unfinalized Builder, a ``site`` is really an
instance of `~kwant.builder.Site`. With these adjustments we arrive at a plot
that carries the same information, but is much easier to interpret:
......@@ -92,8 +92,8 @@ in `~kwant.plotter.map`). However, we can also use `~kwant.plotter.plot` to
achieve a similar, but smoother result.
For this note that `~kwant.plotter.plot` can also take an array of floats (or
function returning floats) as value for the `site_color` argument (the same
holds for the hoppings). Via the colormap specified in `cmap` these are mapped
function returning floats) as value for the ``site_color`` argument (the same
holds for the hoppings). Via the colormap specified in ``cmap`` these are mapped
to color, just as `~kwant.plotter.map` does! In addition, we can also change
the symbol shape depending on the sublattice. With a triangle pointing up and
down on the respective sublattice, the symbols used by plot fill the space
......
......@@ -252,9 +252,9 @@ def hamiltonian_submatrix(self, args=(), to_sites=None, from_sites=None,
to_sites : sequence of sites or None (default)
from_sites : sequence of sites or None (default)
sparse : bool
Whether to return a sparse or a dense matrix. Defaults to `False`.
Whether to return a sparse or a dense matrix. Defaults to ``False``.
return_norb : bool
Whether to return arrays of numbers of orbitals. Defaults to `False`.
Whether to return arrays of numbers of orbitals. Defaults to ``False``.
Returns
-------
......@@ -262,16 +262,16 @@ def hamiltonian_submatrix(self, args=(), to_sites=None, from_sites=None,
Submatrix of Hamiltonian of the system.
to_norb : array of integers
Numbers of orbitals on each site in to_sites. Only returned when
`return_norb` is true.
``return_norb`` is true.
from_norb : array of integers
Numbers of orbitals on each site in from_sites. Only returned when
`return_norb` is true.
``return_norb`` is true.
Notes
-----
The returned submatrix contains all the Hamiltonian matrix elements
from `from_sites` to `to_sites`. The default for `from_sites` and
`to_sites` is `None` which means to use all sites of the system in the
from ``from_sites`` to ``to_sites``. The default for ``from_sites`` and
``to_sites`` is ``None`` which means to use all sites of the system in the
order in which they appear.
"""
cdef gint [:] to_norb, from_norb
......
......@@ -283,7 +283,7 @@ class Symmetry(metaclass=abc.ABCMeta):
"""Calculate the domain of the site.
Return the group element whose action on a certain site from the
fundamental domain will result in the given `site`.
fundamental domain will result in the given ``site``.
"""
pass
......@@ -295,8 +295,8 @@ class Symmetry(metaclass=abc.ABCMeta):
def to_fd(self, a, b=None):
"""Map a site or hopping to the fundamental domain.
If `b` is None, return a site equivalent to `a` within the fundamental
domain. Otherwise, return a hopping equivalent to `(a, b)` but where
If ``b`` is None, return a site equivalent to ``a`` within the fundamental
domain. Otherwise, return a hopping equivalent to ``(a, b)`` but where
the first element belongs to the fundamental domain.
This default implementation works but may be not efficient.
......@@ -305,7 +305,7 @@ class Symmetry(metaclass=abc.ABCMeta):
return self.act(-self.which(a), a, b)
def in_fd(self, site):
"""Tell whether `site` lies within the fundamental domain."""
"""Tell whether ``site`` lies within the fundamental domain."""
for d in self.which(site):
if d != 0:
return False
......@@ -1492,8 +1492,8 @@ class FiniteSystem(system.FiniteSystem):
return value
def site(self, i):
warnings.warn("The function `site` will disappear after Kwant 1.1. "
"Use `sites` instead.", KwantDeprecationWarning,
warnings.warn("The function ``site`` will disappear after Kwant 1.1. "
"Use ``sites`` instead.", KwantDeprecationWarning,
stacklevel=2)
return self.sites[i]
......@@ -1552,8 +1552,8 @@ class InfiniteSystem(system.InfiniteSystem):
return value
def site(self, i):
warnings.warn("The function `site` will disappear after Kwant 1.1. "
"Use `sites` instead.", KwantDeprecationWarning,
warnings.warn("The function ``site`` will disappear after Kwant 1.1. "
"Use ``sites`` instead.", KwantDeprecationWarning,
stacklevel=2)
return self.sites[i]
......
......@@ -123,7 +123,7 @@ class Polyatomic:
"""Return a key for all the lattice sites inside a given shape.
The object returned by this method is primarily meant to be used as a
key for indexing `kwant.Builder` instances. See example below.
key for indexing `~kwant.builder.Builder` instances. See example below.
Parameters
----------
......@@ -219,7 +219,7 @@ class Polyatomic:
This method makes it easy to define cylindrical (2d: rectangular) leads
that point in any direction. The object returned by this method is
primarily meant to be used as a key for indexing `kwant.Builder`
primarily meant to be used as a key for indexing `~kwant.builder.Builder`
instances. See example below.
Parameters
......@@ -424,7 +424,7 @@ class Monatomic(builder.SiteFamily, Polyatomic):
def __init__(self, prim_vecs, offset=None, name='', norbs=None):
prim_vecs = ta.array(prim_vecs, float)
if prim_vecs.ndim != 2:
raise ValueError('`prim_vecs` must be a 2d array-like object.')
raise ValueError('``prim_vecs`` must be a 2d array-like object.')
dim = prim_vecs.shape[1]
if name is None:
name = ''
......@@ -491,7 +491,7 @@ class Monatomic(builder.SiteFamily, Polyatomic):
def closest(self, pos):
"""
Find the lattice coordinates of the site closest to position `pos`.
Find the lattice coordinates of the site closest to position ``pos``.
"""
return ta.array(self.n_closest(pos)[0])
......
......@@ -424,7 +424,7 @@ cdef class _LocalOperator:
Parameters
----------
bra, ket : `~numpy.ndarray`
bra, ket : ``numpy.ndarray``
Must have the same length as the number of orbitals
in the system. If only one is provided, both ``bra``
and ``ket`` are taken as equal.
......@@ -477,7 +477,7 @@ cdef class _LocalOperator:
Parameters
----------
ket : `~numpy.ndarray`
ket : ``numpy.ndarray``
Wavefunctions defined over all the orbitals of the system.
args : tuple
The extra arguments to the Hamiltonian value functions and
......@@ -485,7 +485,7 @@ cdef class _LocalOperator:
Returns
-------
`~numpy.ndarray`
``numpy.ndarray``
The result of acting on the wavefunction with the operator
"""
if (self._bound_onsite or self._bound_hamiltonian) and args:
......
This diff is collapsed.
......@@ -409,7 +409,7 @@ class SparseSolver(metaclass=abc.ABCMeta):
This function can be used to calculate the conductance and other
transport properties of a system. It is often slower and less stable
than the scattering matrix-based calculation executed by
`~kwant.smatrix`, and is currently provided mostly for testing
`~kwant.solvers.common.smatrix`, and is currently provided mostly for testing
purposes and compatibility with RGF code.
It returns an object encapsulating the Green's function elements
......
......@@ -41,7 +41,7 @@ class Solver(common.SparseSolver):
(at the cost of slower performance). Default value is 6.
ordering : string
one of the ordering methods supported by the MUMPS solver (see
`~kwant.linalg.mumps`. The availability of certain orderings
``kwant.linalg.mumps``. The availability of certain orderings
depends on the MUMPS installation.), or 'kwant_decides'. If
``ordering=='kwant_decides'``, the ordering that typically gives
the best performance is chosen from the available ones. One can
......
......@@ -16,7 +16,7 @@ except ImportError:
no_mumps = True
pytestmark = pytest.mark.skipif(no_mumps, reason="MUMPS not installed")
opt_list=[{},
{'nrhs' : 1},
{'nrhs' : 10},
......
......@@ -36,7 +36,7 @@ class System(metaclass=abc.ABCMeta):
The sites of the system are indexed by integers ranging from 0 to
``self.graph.num_nodes - 1``.
Optionally, a class derived from `System` can provide a method `pos` which
Optionally, a class derived from ``System`` can provide a method ``pos`` which
is assumed to return the real-space position of a site given its index.
Due to the ordering semantics of sequences, and the fact that a given
......@@ -49,11 +49,11 @@ class System(metaclass=abc.ABCMeta):
@abc.abstractmethod
def hamiltonian(self, i, j, *args):
"""Return the hamiltonian matrix element for sites `i` and `j`.
"""Return the hamiltonian matrix element for sites ``i`` and ``j``.
If ``i == j``, return the on-site Hamiltonian of site `i`.
If ``i == j``, return the on-site Hamiltonian of site ``i``.
if ``i != j``, return the hopping between site `i` and `j`.
if ``i != j``, return the hopping between site ``i`` and ``j``.
Hamiltonians may depend (optionally) on positional and
keyword arguments
......@@ -79,12 +79,12 @@ class FiniteSystem(System, metaclass=abc.ABCMeta):
Notes
-----
The length of `leads` must be equal to the length of `lead_interfaces`.
The length of ``leads`` must be equal to the length of ``lead_interfaces``.
For lead ``n``, the method leads[n].selfenergy must return a square matrix
whose size is ``sum(len(self.hamiltonian(site, site)) for site in
self.lead_interfaces[n])``. The output of ``leads[n].modes`` has to be a
tuple of `~kwant.physics.PropagatingModes, ~kwant.physics.StabilizedModes`.
tuple of `~kwant.physics.PropagatingModes`, `~kwant.physics.StabilizedModes`.
Often, the elements of `leads` will be instances of `InfiniteSystem`. If
this is the case for lead ``n``, the sites ``lead_interfaces[n]`` match
......@@ -109,7 +109,7 @@ class FiniteSystem(System, metaclass=abc.ABCMeta):
args : sequence
Additional parameters required for calculating the Hamiltionians
leads : sequence of integers or None
Numbers of the leads to be precalculated. If `None`, all are
Numbers of the leads to be precalculated. If ``None``, all are
precalculated.
what : 'modes', 'selfenergy', 'all'
The quantitity to precompute. 'all' will compute both
......@@ -152,8 +152,7 @@ class FiniteSystem(System, metaclass=abc.ABCMeta):
return result
class InfiniteSystem(System, metaclass=abc.ABCMeta):
"""
Abstract infinite low-level system.
"""Abstract infinite low-level system.
An infinite system consists of an infinite series of identical cells.
Adjacent cells are connected by identical inter-cell hoppings.
......@@ -167,13 +166,13 @@ class InfiniteSystem(System, metaclass=abc.ABCMeta):
-----
The system graph of an infinite systems contains a single cell, as well as
the part of the previous cell which is connected to it. The first
`cell_size` sites form one complete single cell. The remaining `N` sites of
the graph (`N` equals ``graph.num_nodes - cell_size``) belong to the
`cell_size` sites form one complete single cell. The remaining ``N`` sites
of the graph (``N`` equals ``graph.num_nodes - cell_size``) belong to the
previous cell. They are included so that hoppings between cells can be
represented. The N sites of the previous cell correspond to the first `N`
sites of the fully included cell. When an InfiniteSystem is used as a lead,
`N` acts also as the number of interface sites to which it must be
connected.
represented. The N sites of the previous cell correspond to the first
``N`` sites of the fully included cell. When an ``InfiniteSystem`` is used
as a lead, ``N`` acts also as the number of interface sites to which it
must be connected.