From 7dd9969a12c04fffcc5e9399b6c386a849268501 Mon Sep 17 00:00:00 2001 From: Christoph Groth <christoph.groth@cea.fr> Date: Thu, 21 Feb 2013 18:11:44 +0100 Subject: [PATCH] tutorial: use default value for magnetic field --- doc/source/images/closed_system.py.diff | 2 +- doc/source/tutorial/closed_system.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/source/images/closed_system.py.diff b/doc/source/images/closed_system.py.diff index 928c356d..7f7340d8 100644 --- a/doc/source/images/closed_system.py.diff +++ b/doc/source/images/closed_system.py.diff @@ -35,7 +35,7 @@ + size = (_defs.figwidth_in, _defs.figwidth_in) + # Calculate the wave functions in the system. - ham_mat = sys.hamiltonian_submatrix(sparse=True, kwargs={'B': 0}) + 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. diff --git a/doc/source/tutorial/closed_system.py b/doc/source/tutorial/closed_system.py index e98861a8..d67c2899 100644 --- a/doc/source/tutorial/closed_system.py +++ b/doc/source/tutorial/closed_system.py @@ -36,7 +36,7 @@ def make_system(a=1, t=1.0, r=10): rsq = x ** 2 + y ** 2 return rsq < r ** 2 - def hopx(site1, site2, B): + def hopx(site1, site2, B=0): # The magnetic field is controlled by the parameter B y = site1.pos[1] return -t * exp(-1j * B * y) @@ -81,7 +81,7 @@ def plot_spectrum(sys, Bfields): #HIDDEN_BEGIN_wave def plot_wave_function(sys): # Calculate the wave functions in the system. - ham_mat = sys.hamiltonian_submatrix(sparse=True, kwargs={'B': 0}) + 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. -- GitLab