From 2a5effb59459ef3960013514dd9b2a9df8bd3369 Mon Sep 17 00:00:00 2001
From: Joseph Weston <joseph.weston08@gmail.com>
Date: Thu, 11 May 2017 20:39:48 +0200
Subject: [PATCH] doc: update KPM tutorial to match changes to API

---
 doc/source/tutorial/kernel_polynomial_method.py |  6 +++---
 doc/source/tutorial/tutorial7.rst               | 16 +++++-----------
 2 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/doc/source/tutorial/kernel_polynomial_method.py b/doc/source/tutorial/kernel_polynomial_method.py
index 74fb09d1..7e8aa16d 100644
--- a/doc/source/tutorial/kernel_polynomial_method.py
+++ b/doc/source/tutorial/kernel_polynomial_method.py
@@ -106,7 +106,7 @@ def increasing_accuracy_example(fsyst):
     original_dos = spectrum()  # get unaltered DoS
 
 #HIDDEN_BEGIN_acc1
-    spectrum.increase_energy_resolution(tol=0.03)
+    spectrum.add_moments(energy_resolution=0.03)
 #HIDDEN_END_acc1
 
     increased_resolution_dos = spectrum()
@@ -117,8 +117,8 @@ def increasing_accuracy_example(fsyst):
     ])
 
 #HIDDEN_BEGIN_acc2
-    # we supply the *total* number of moments and sampling points
-    spectrum.increase_accuracy(num_moments=200, num_rand_vecs=5)
+    spectrum.add_moments(100)
+    spectrum.add_vectors(5)
 #HIDDEN_END_acc2
 
     increased_moments_dos = spectrum()
diff --git a/doc/source/tutorial/tutorial7.rst b/doc/source/tutorial/tutorial7.rst
index a9d8b714..3ac75ba8 100644
--- a/doc/source/tutorial/tutorial7.rst
+++ b/doc/source/tutorial/tutorial7.rst
@@ -160,21 +160,20 @@ of the method, each of which offers different levels of control over what
 exactly is changed.
 
 The simplest way to obtain a more accurate solution is to use the
-``increase_energy_resolution`` method:
+``add_moments`` method:
 
 .. literalinclude:: kernel_polynomial_method.py
     :start-after: #HIDDEN_BEGIN_acc1
     :end-before: #HIDDEN_END_acc1
 
-This will update the number of calculated moments and also the default
+This will update the number of calculated moments and also the
 number of sampling points such that the maximum distance between successive
-energy points is ``tol`` (see notes on accuracy_).
+energy points is ``energy_resolution`` (see notes on accuracy_).
 
 .. image:: ../images/kpm_dos_acc.*
 
-Alternatively, you can directly increase (or decrease) the number of moments,
-random vectors and sampling points with the method
-`~kwant.kpm.SpectralDensity.increase_accuracy`.
+Alternatively, you can directly increase the number of moments
+with ``add_moments``, or the number of random vectors with ``add_vectors``.
 
 .. literalinclude:: kernel_polynomial_method.py
     :start-after: #HIDDEN_BEGIN_acc2
@@ -182,11 +181,6 @@ random vectors and sampling points with the method
 
 .. image:: ../images/kpm_dos_r.*
 
-In the above example we only increased the number of moments and decreased the
-number of random vectors. The keyword argument ``num_sampling_points`` can
-be also specified by passing the keyword argument to
-`~kwant.kpm.SpectralDensity.increase_accuracy`.
-
 
 .. _operator_spectral_density:
 
-- 
GitLab