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
7c55b0cb
Commit
7c55b0cb
authored
9 years ago
by
Christoph Groth
Browse files
Options
Downloads
Patches
Plain Diff
remove python-2-isms from documentation
parent
c5959315
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/source/tutorial/tutorial1.rst
+3
-3
3 additions, 3 deletions
doc/source/tutorial/tutorial1.rst
with
3 additions
and
3 deletions
doc/source/tutorial/tutorial1.rst
+
3
−
3
View file @
7c55b0cb
...
...
@@ -360,7 +360,7 @@ Instead, we now write:
:end-before: #HIDDEN_END_vvjt
Here, all lattice points are added at once in the first line. The
construct ``((i, j) for i in
x
range(L) for j in
x
range(W))`` is a
construct ``((i, j) for i in range(L) for j in range(W))`` is a
generator that iterates over all points in the rectangle as did the
two ``for``-loops in the previous example. In fact, a
`~kwant.builder.Builder` can not only be indexed by a single
...
...
@@ -463,7 +463,7 @@ The result of the example should be identical to the previous one.
Let us elaborate a bit more on this using a simpler example:
>>> a = (0, 1, 2, 3)
>>> b = (i for i in
x
range(4))
>>> b = (i for i in range(4))
Here, `a` is a tuple, whereas `b` is a generator. One difference
is that one can subscript tuples, but not generators:
...
...
@@ -489,7 +489,7 @@ The result of the example should be identical to the previous one.
added at once, these two sites should be encapsulated in a tuple.
In particular, one must write::
sys[((lat(0,j+1), lat(0, j)) for j in
x
range(W-1)] = ...
sys[((lat(0,j+1), lat(0, j)) for j in range(W-1)] = ...
or::
...
...
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