title: How to implement ILU preconditioner for GMRES in Python 2.7?
body: <p>I am trying to compare the GMRES solver with and without ILU preconditioner. It runs and provides the correct answer when the preconditioner is not applied (<code>x=[1,1,1]</code>). However, I cannot seem to find a way to apply the preconditioner correctly. </p>
  
  <p>How can I get this piece of code to run with the ILU preconditioner? </p>
  
  <pre><code>import numpy as np
  import scipy.sparse.linalg as spla
  
  A = np.array([[ 0.4445,  0.4444, -0.2222],
                [ 0.4444,  0.4445, -0.2222],
                [-0.2222, -0.2222,  0.1112]])
  
  b = np.array([[ 0.6667], 
                [ 0.6667], 
                [-0.3332]])
  
  M2 = spla.spilu(A)
  
  x = spla.gmres(A,b,M=M2)
  
  print x
  </code></pre>