from scipy.sparse.linalg import LinearOperator
A = whatever_dok_matrix_minus_constant_term

def my_matvec(x):
    return A * x + constant_term * x.sum()
op = LinearOperator(A.shape, matvec=my_matvec)
scipy.sparse default value