A = spdiags([arange(1,n+1,dtype=float)], [0], n, n, format="csr")
M = spdiags([1.0/arange(1,n+1,dtype=float)], [0], n, n, format="csr")
A.psolve = M.matvec
b = 0*ones(A.shape[0])
x = minres(A,b,tol=1e-12,maxiter=None,callback=cb)
// x = cg(A,b,x0=b,tol=1e-12,maxiter=None,callback=cb)[0]
After Change
A = spdiags([arange(1,n+1,dtype=float)], [0], n, n, format="csr")
M = spdiags([1.0/arange(1,n+1,dtype=float)], [0], n, n, format="csr")
A.psolve = M.matvec
b = zeros(A.shape[0])
x = minres(A,b,tol=1e-12,maxiter=None,callback=cb)
// x = cg(A,b,x0=b,tol=1e-12,maxiter=None,callback=cb)[0]