Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
kwant
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
96
Issues
96
List
Board
Labels
Milestones
Merge Requests
11
Merge Requests
11
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kwant
kwant
Commits
0c646ce9
Commit
0c646ce9
authored
Feb 15, 2019
by
Joseph Weston
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
documentation fixups prior to release
parent
decfecfe
Pipeline
#15434
failed with stages
in 41 minutes and 48 seconds
Changes
11
Pipelines
1
Hide whitespace changes
Inline
Sidebyside
Showing
11 changed files
with
32 additions
and
39 deletions
+32
39
closed_system.py.diff
doc/source/code/figure/closed_system.py.diff
+1
6
1.4.rst
doc/source/pre/whatsnew/1.4.rst
+16
14
kwant.kpm.rst
doc/source/reference/kwant.kpm.rst
+1
1
kwant.physics.rst
doc/source/reference/kwant.physics.rst
+1
0
discretize.rst
doc/source/tutorial/discretize.rst
+2
2
faq.rst
doc/source/tutorial/faq.rst
+4
4
graphene.rst
doc/source/tutorial/graphene.rst
+0
3
kpm.rst
doc/source/tutorial/kpm.rst
+1
1
spectrum.rst
doc/source/tutorial/spectrum.rst
+1
1
kpm.py
kwant/kpm.py
+3
5
gauge.py
kwant/physics/gauge.py
+2
2
No files found.
doc/source/code/figure/closed_system.py.diff
View file @
0c646ce9
...
...
@@ 60,14 +60,9 @@
#HIDDEN_BEGIN_yvri
def plot_spectrum(syst, Bfields):
# In the following, we compute the spectrum of the quantum dot
# using dense matrix methods. This works in this toy example, as
# the system is tiny. In a real example, one would want to use
# sparse matrix methods
energies = []
for B in Bfields:
# Obtain the Hamiltonian as a
den
se matrix
# Obtain the Hamiltonian as a
spar
se matrix
ham_mat = syst.hamiltonian_submatrix(params=dict(B=B), sparse=True)
# we only calculate the 15 lowest eigenvalues
...
...
doc/source/pre/whatsnew/1.4.rst
View file @
0c646ce9
...
...
@@ 83,7 +83,9 @@ Here is an example for extracting the symmetry group of a graphene system::
``
kwant
.
qsymm
``
also
contains
functionality
for
converting
Qsymm
models
to
Kwant
Builders
,
and
vice
versa
,
and
for
working
with
continuum
Hamiltonians
(
such
as
would
be
used
with
``
kwant
.
continuum
``)
``
kwant
.
continuum
``).
This
integration
requires
separately
installing
Qsymm
,
which
is
available
on
the
`
Python
Package
Index
<
https
://
pypi
.
org
/
project
/
qsymm
/>`
_
.
Automatic
Peierls
phase
calculation

...
...
@@ 101,8 +103,7 @@ which calculates the Peierls phases for you::
return

t
*
peierls
(
a
,
b
)
syst
=
make_system
(
hopping
)
lead
=
make_lead
(
hopping
)
lead
.
substituted
(
peierls
=
'peierls_lead'
)
lead
=
make_lead
(
hopping
).
substituted
(
peierls
=
'peierls_lead'
)
syst
.
attach_lead
(
lead
)
syst
=
syst
.
finalized
()
...
...
@@ 135,19 +136,19 @@ has a parameter ``V``, and one wishes to have different values for ``V`` in
the
scattering
region
and
leads
,
one
could
do
the
following
::
syst
=
kwant
.
Builder
()
syst
.
fill
(
model
.
substituted
(
V
=
'V_dot'
,
...))
syst
.
fill
(
model
.
substituted
(
V
=
'V_dot'
)
,
...))
lead
=
kwant
.
Builder
()
lead
.
fill
(
model
.
substituted
(
V
=
'V_lead'
),
...)
syst
.
attach_lead
(
lead
)
f
syst
=
syst
.
finalized
()
syst
=
syst
.
finalized
()
kwant
.
smatrix
(
syst
,
params
=
dict
(
V_dot
=
0
,
V_lead
=
1
))
Interpolated
density
plots

A
new
function
,
`
~
kwant
.
plotter
.
density
`,
has
been
added
that
can
be
used
to
A
new
function
,
`
kwant
.
plotter
.
density
`,
has
been
added
that
can
be
used
to
visualize
a
density
defined
over
the
sites
of
a
Kwant
system
.
This
convolves
the
"discrete"
density
(
defined
over
the
system
sites
)
with
a
"bump"
function
in
realspace
.
The
output
of
`~
kwant
.
plotter
.
density
`
can
be
more
informative
...
...
@@ 166,7 +167,8 @@ but in an inconsistent way (e.g. a parameter 'phi' that is a superconducting
phase
in
one
value
function
,
but
a
peierls
phase
in
another
).
This
leads
to
bugs
that
are
confusing
and
hard
to
track
down
.
Concretely
,
the
above
means
that
the
following
no
longer
works
::
For
this
reason
value
functions
may
no
longer
have
default
values
for
paramters
.
Concretely
this
means
that
the
following
no
longer
works
::
syst
=
kwant
.
Builder
()
...
...
@@ 190,7 +192,7 @@ To deal with many parameters, the following idiom may be useful::
...
smatrix
=
kwant
.
smatrix
(
syst
,
E
,
params
=
dict
(
defaults
,
d
=
4
,
e
=
5
))
Note
that
it
allows
to
override
defaults
as
well
as
to
add
additional
Note
that
this
allows
to
override
defaults
as
well
as
to
add
additional
parameters
.
System
parameters
can
now
be
inspected
...
...
@@ 228,9 +230,9 @@ This is a provisional API that may be changed in a future version of Kwant.
Passing
system
arguments
via
``
args
``
is
deprecated
in
favor
of
``
params
``

It
is
now
deprecated
to
pass
arguments
to
systems
by
providing
the
``
args
``
parameter
(
in
``
kwant
.
smatrix
``
and
elsewhere
).
This
i
s
error
prone
and
requires
that
all
value
functions
take
the
sam
e
formal
parameters
,
even
if
they
do
not
depend
on
all
of
them
.
The
``
args
``
parameter
(
in
``
kwant
.
smatrix
``
and
elsewhere
).
Passing
argument
s
via
``
args
``
is
error
prone
and
requires
that
all
value
functions
take
th
e
same
formal
parameters
,
even
if
they
do
not
depend
on
all
of
them
.
The
preferred
way
of
passing
parameters
to
Kwant
systems
is
by
passing
a
dictionary
using
``
params
``::
...
...
@@ 244,7 +246,7 @@ a dictionary using ``params``::
#
Compare
this
to
the
deprecated
'args'
kwant
.
smatrix
(
syst
,
args
=(
0.5
,
0.2
))
The
ability
to
provide
``
args
``
will
be
removed
in
a
future
Kwant
version
.
Providing
``
args
``
will
be
removed
in
a
future
Kwant
version
.
Finalized
Builders
keep
track
of
which
sites
were
added
when
attaching
leads

...
...
@@ 261,8 +263,8 @@ that this option is not available in `~kwant.plotter.current`. In order to use
it
,
one
has
to
call
``
streamplot
``
directly
as
shown
in
the
docstring
of
``
current
``.
kwant
.
continuum
.
discretize
can
be
used
with
rectangular
lattices

`
kwant
.
continuum
.
discretize
`
can
be
used
with
rectangular
lattices


Previously
the
discretizer
could
only
be
used
with
lattices
with
the
same
lattice
constant
in
all
directions
.
Now
it
is
possible
to
pass
rectangular
lattices
to
the
discretizer
::
...
...
doc/source/reference/kwant.kpm.rst
View file @
0c646ce9
...
...
@@ 4,4 +4,4 @@
.. automodule:: kwant.kpm
:members:
:specialmembers:
:excludemembers: __weakref__
:excludemembers: __weakref__
, __init__
doc/source/reference/kwant.physics.rst
View file @
0c646ce9
...
...
@@ 27,5 +27,6 @@ Computation of magnetic field gauge
.. autosummary::
:toctree: generated/
:template: autosummary/functor.rst
magnetic_gauge
doc/source/tutorial/discretize.rst
View file @
0c646ce9
...
...
@@ 161,8 +161,8 @@ energy eigenstates:
.. image:: /code/figure/discretizer_gs.*
Note in the above that we pass the spatially varying potential *function*
to our system via a parameter called ``V``, because the symbol
$V$
was used in the intial, symbolic, definition of the Hamiltonian.
to our system via a parameter called ``V``, because the symbol
:math:`V`
was used in the in
i
tial, symbolic, definition of the Hamiltonian.
In addition, the function passed as ``V`` expects two input parameters ``x``
and ``y``, the same as in the initial continuum Hamiltonian.
...
...
doc/source/tutorial/faq.rst
View file @
0c646ce9
...
...
@@ 423,7 +423,7 @@ the modes are sorted in the following way:
+ Positive velocity modes are ordered by *decreasing* momentum
For more complicated systems and band structures this can lead to some
possibly
unintuitive orderings:
unintuitive orderings:
.. image:: /code/figure/faq_pm2.*
...
...
@@ 437,9 +437,9 @@ infinity" (*not* towards the system) which means that the incoming modes are
those that have *negative* velocities.
This means that for a lead attached on the left of a scattering region (with
symmetry vector
$(1, 0)$
, for example), the
positive
$k$
direction (when inspecting the lead's band structure) actually
corresponds to the *negative*
$x$
direction.
symmetry vector
:math:`(1, 0)`
, for example), the
positive
:math:`k`
direction (when inspecting the lead's band structure) actually
corresponds to the *negative*
:math:`x`
direction.
How does Kwant order components of an individual wavefunction?
...
...
doc/source/tutorial/graphene.rst
View file @
0c646ce9
...
...
@@ 112,9 +112,6 @@ in the following piece of code:
:startafter: #HIDDEN_BEGIN_zydk
:endbefore: #HIDDEN_END_zydk
Here we use in contrast to the previous example a sparse matrix and
the sparse linear algebra functionality of SciPy.
The code for computing the band structure and the conductance is identical
to the previous examples, and needs not be further explained here.
...
...
doc/source/tutorial/kpm.rst
View file @
0c646ce9
...
...
@@ 340,7 +340,7 @@ vectors
Note that the Kubo conductivity must be normalized with the area covered
by the vectors. In this case, each local vector represents a site, and
covers an area of half a unit cell, while the sum covers one unit cell.
It is possible to use random vectors to get an average
s
pectation
It is possible to use random vectors to get an average
ex
pectation
value of the conductivity over large parts of the system. In this
case, the area that normalizes the result, is the area covered by
the random vectors.
...
...
doc/source/tutorial/spectrum.rst
View file @
0c646ce9
...
...
@@ 122,7 +122,7 @@ better for the special case of a square lattice.
As our model breaks time reversal symmetry (because of the applied magnetic
field) we can also see an intereting property of the eigenstates, namely
field) we can also see an intere
s
ting property of the eigenstates, namely
that they can have *nonzero* local current. We can calculate the local
current due to a state by using `kwant.operator.Current` and plotting
it using `kwant.plotter.current`:
...
...
kwant/kpm.py
View file @
0c646ce9
...
...
@@ 41,7 +41,7 @@ class SpectralDensity:
.. math::
ρ_A(E) = ρ(E) A(E),
where :math:`ρ(E) = \
\
sum_{k=0}^{D1} δ(EE_k)` is the density of
where :math:`ρ(E) = \sum_{k=0}^{D1} δ(EE_k)` is the density of
states, and :math:`A(E)` is the expectation value of :math:`A` for
all the eigenstates with energy :math:`E`.
...
...
@@ 253,11 +253,9 @@ class SpectralDensity:
Returns

``(energies, densities)`` if the ``energy`` parameter is not
provided, else ``densities``.
energies : array of floats
Drawn from the nodes of the highest Chebyshev polynomial.
Not returned if 'energy' was not provided
densities : float or array of floats
single ``float`` if the ``energy`` parameter is a single
``float``, else an array of ``float``.
...
...
@@ 593,7 +591,7 @@ class Correlator:
self
.
_build_integral_factor
()
def
__call__
(
self
,
mu
=
0
,
temperature
=
0
):
"""Returns the linear response
χ_{α β}(µ, T)
"""Returns the linear response
:math:`χ_{α β}(µ, T)`
Parameters

...
...
kwant/physics/gauge.py
View file @
0c646ce9
...
...
@@ 944,7 +944,7 @@ class magnetic_gauge:
Parameters

syst :
kwant.builder.FiniteSystem or kwant.builder.InfiniteSystem
syst :
`kwant.builder.FiniteSystem` or `kwant.builder.InfiniteSystem`
Examples

...
...
@@ 1027,7 +1027,7 @@ class magnetic_gauge:
The first callable computes the Peierls phase in the scattering
region and the remaining callables compute the Peierls phases
in each of the leads. Each callable takes a pair of
`~kwant.builder.Site`
s 'a, b'
and returns a unit complex
`~kwant.builder.Site`
(a hopping)
and returns a unit complex
number (Peierls phase) that multiplies that hopping.
"""
return
self
.
_peierls
(
syst_field
,
*
lead_fields
,
tol
=
tol
,
average
=
False
)
Joseph Weston
@jbweston
mentioned in issue
#275 (closed)
·
Feb 15, 2019
mentioned in issue
#275 (closed)
mentioned in issue #275
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment