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
bab5684f
Commit
bab5684f
authored
12 years ago
by
Anton Akhmerov
Committed by
Christoph Groth
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
show plotter.map in tutorial3
parent
5f74b6c1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/source/images/closed_system.py.diff
+29
-1
29 additions, 1 deletion
doc/source/images/closed_system.py.diff
doc/source/tutorial/closed_system.py
+19
-0
19 additions, 0 deletions
doc/source/tutorial/closed_system.py
doc/source/tutorial/tutorial3.rst
+11
-0
11 additions, 0 deletions
doc/source/tutorial/tutorial3.rst
with
59 additions
and
1 deletion
doc/source/images/closed_system.py.diff
+
29
−
1
View file @
bab5684f
...
...
@@ -8,7 +8,7 @@
def make_system(a=1, t=1.0, r=10):
@@ -70,
19
+71,
2
4 @@
@@ -70,
32
+71,4
3
@@
energies.append(ev)
...
...
@@ -31,6 +31,26 @@
+ fig.savefig("closed_system_result.png", dpi=_defs.dpi)
def plot_wave_function(sys):
# We reset the magnetic field to equal to 0.
global B
B = 0.
+ size = (_defs.figwidth_in, _defs.figwidth_in)
# Calculate the wave functions in the system.
ham_mat = sys.hamiltonian_submatrix(sparse=True)
evecs = sla.eigsh(ham_mat, k=20, which='SM')[1]
# Plot the probability density of the 10th eigenmode.
- kwant.plotter.map(sys, np.abs(evecs[:, 9])**2, colorbar=False)
+ kwant.plotter.map(sys, np.abs(evecs[:, 9])**2, colorbar=False,
+ file="closed_system_eigenvector.pdf",
+ fig_size=size, dpi=_defs.dpi)
+ kwant.plotter.map(sys, np.abs(evecs[:, 9])**2, colorbar=False,
+ file="closed_system_eigenvector.png",
+ fig_size=size, dpi=_defs.dpi)
def main():
sys = make_system()
...
...
@@ -40,3 +60,11 @@
# Finalize the system.
sys = sys.finalized()
@@ -108,6 +120,7 @@
sys = make_system(r=30).finalized()
plot_wave_function(sys)
+
# Call the main function if the script gets executed (as opposed to imported).
# See <http://docs.python.org/library/__main__.html>.
if __name__ == '__main__':
This diff is collapsed.
Click to expand it.
doc/source/tutorial/closed_system.py
+
19
−
0
View file @
bab5684f
...
...
@@ -83,6 +83,21 @@ def plot_spectrum(sys, Bfields):
#HIDDEN_END_yvri
#HIDDEN_BEGIN_wave
def
plot_wave_function
(
sys
):
# We reset the magnetic field to equal to 0.
global
B
B
=
0.
# Calculate the wave functions in the system.
ham_mat
=
sys
.
hamiltonian_submatrix
(
sparse
=
True
)
evecs
=
sla
.
eigsh
(
ham_mat
,
k
=
20
,
which
=
'
SM
'
)[
1
]
# Plot the probability density of the 10th eigenmode.
kwant
.
plotter
.
map
(
sys
,
np
.
abs
(
evecs
[:,
9
])
**
2
,
colorbar
=
False
)
#HIDDEN_END_wave
def
main
():
sys
=
make_system
()
...
...
@@ -96,6 +111,10 @@ def main():
# level energies with increasing magnetic field
plot_spectrum
(
sys
,
[
iB
*
0.002
for
iB
in
xrange
(
100
)])
# Plot an eigenmode of a circular dot. Here we create a larger system for
# better spatial resolution.
sys
=
make_system
(
r
=
30
).
finalized
()
plot_wave_function
(
sys
)
# Call the main function if the script gets executed (as opposed to imported).
# See <http://docs.python.org/library/__main__.html>.
...
...
This diff is collapsed.
Click to expand it.
doc/source/tutorial/tutorial3.rst
+
11
−
0
View file @
bab5684f
...
...
@@ -101,6 +101,17 @@ quantum dot is rather symmetric). These degeneracies are split
by the magnetic field, and the eigenenergies flow towards the
Landau level energies at higher magnetic fields [#]
The eigenvectors are obtained very similarly, and can be plotted directly
using `~kwant.plotter.map`:
.. literalinclude:: closed_system.py
:start-after: #HIDDEN_BEGIN_wave
:end-before: #HIDDEN_END_wave
This yields the result:
.. image:: ../images/closed_system_eigenvector.*
.. seealso::
The full source code can be found in
:download:`tutorial/closed_system.py <../../../tutorial/closed_system.py>`
...
...
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