Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
kwant
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Joseph Weston
kwant
Commits
ad4bc56e
Commit
ad4bc56e
authored
9 years ago
by
Christoph Groth
Browse files
Options
Downloads
Plain Diff
merge commits from the 1.2 branch that should have rather gone to 1.1
parents
6c3ca9b1
2de760a3
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CONTRIBUTE.rst
+1
-4
1 addition, 4 deletions
CONTRIBUTE.rst
doc/source/images/ab_ring.py.diff
+3
-23
3 additions, 23 deletions
doc/source/images/ab_ring.py.diff
doc/source/tutorial/ab_ring.py
+3
-3
3 additions, 3 deletions
doc/source/tutorial/ab_ring.py
setup.py
+2
-2
2 additions, 2 deletions
setup.py
with
9 additions
and
32 deletions
CONTRIBUTE.rst
+
1
−
4
View file @
ad4bc56e
...
...
@@ -75,13 +75,10 @@ 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
python setup.py build_ext -i
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.
This diff is collapsed.
Click to expand it.
doc/source/images/ab_ring.py.diff
+
3
−
23
View file @
ad4bc56e
...
...
@@ -8,27 +8,7 @@
from cmath import exp
from math import pi
@@ -40,12 +41,13 @@
sys[lat.shape(ring, (0, r1 + 1))] = 4 * t
sys[lat.neighbors()] = -t
- # In order to introduce a flux through the ring, we introduce a phase on
- # the hoppings on the line cut through one of the arms. Since we want to
- # change the flux without modifying the Builder instance repeatedly, we
- # define the modified hoppings as a function that takes the flux as its
- # parameter phi.
- def fluxphase(site1, site2, phi):
+ # In order to introduce a flux through the ring, we introduce a phase
+ # on the hoppings on the line cut through one of the arms
+
+ # since we want to change the flux without modifying Builder repeatedly,
+ # we define the modified hoppings as a function that takes the flux
+ # through the argument phi.
+ def fluxphase(site1, site2, phi=0):
return exp(1j * phi)
def crosses_branchcut(hop):
@@ -81,6 +83,50 @@
@@ -81,6 +82,50 @@
return sys
...
...
@@ -79,7 +59,7 @@
def plot_conductance(sys, energy, fluxes):
# compute conductance
@@ -90,18 +13
6
,31 @@
@@ -90,18 +13
5
,31 @@
smatrix = kwant.smatrix(sys, energy, args=[flux])
data.append(smatrix.transmission(1, 0))
...
...
@@ -116,7 +96,7 @@
# Finalize the system.
sys = sys.finalized()
@@ -111,6 +1
70
,17 @@
@@ -111,6 +1
69
,17 @@
for i in xrange(100)])
...
...
This diff is collapsed.
Click to expand it.
doc/source/tutorial/ab_ring.py
+
3
−
3
View file @
ad4bc56e
...
...
@@ -50,8 +50,8 @@ def make_system(a=1, t=1.0, W=10, r1=10, r2=20):
# define the modified hoppings as a function that takes the flux as its
# parameter phi.
#HIDDEN_BEGIN_lvkt
def
flux
phase
(
site1
,
site2
,
phi
):
return
exp
(
1j
*
phi
)
def
hopping_
phase
(
site1
,
site2
,
phi
):
return
-
t
*
exp
(
1j
*
phi
)
def
crosses_branchcut
(
hop
):
ix0
,
iy0
=
hop
[
0
].
tag
...
...
@@ -65,7 +65,7 @@ def make_system(a=1, t=1.0, W=10, r1=10, r2=20):
for
hop
in
kwant
.
builder
.
HoppingKind
((
1
,
0
),
lat
,
lat
)(
sys
):
if
crosses_branchcut
(
hop
):
yield
hop
sys
[
hops_across_cut
]
=
flux
phase
sys
[
hops_across_cut
]
=
hopping_
phase
#HIDDEN_END_lvkt
#### Define the leads. ####
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
2
−
2
View file @
ad4bc56e
...
...
@@ -62,7 +62,7 @@ try:
sys
.
argv
.
remove
(
CYTHON_OPTION
)
use_cython
=
True
except
ValueError
:
use_cython
=
False
use_cython
=
version_is_from_git
if
use_cython
:
try
:
...
...
@@ -355,7 +355,7 @@ def complain_cython_unavailable():
ver
=
'
.
'
.
join
(
str
(
e
)
for
e
in
REQUIRED_CYTHON_VERSION
)
print
(
msg
.
format
(
ver
),
file
=
sys
.
stderr
)
else
:
print
(
"
Run setup.py with
out {}
.
"
.
format
(
NO_
CYTHON_OPTION
),
print
(
"
Run setup.py with
the {} option
.
"
.
format
(
CYTHON_OPTION
),
file
=
sys
.
stderr
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment