Krylov subspace methods for Python
Project description
Krylov subspace methods.
Forked from André Gaul's KryPy, krylov provides Krylov subspace methods for Python. It is more advanced than SciPy's linalg methods in that it provides for arbitrary inner products and is fully blocked/vectorized. krylov is written completely in Python.
Install with
pip install krylov
and use as
import numpy
import krylov
A = numpy.diag([1.0e-3] + list(range(2, 101)))
b = numpy.ones(100)
# sol, info = krylov.cg(A, b)
# sol, info = krylov.minres(A, b)
sol, info = krylov.gmres(A, b)
# sol is None if no solution has been found
# onfo.resnorms contains the relative residual norms and some more data
# plot residuals
import matplotlib.pyplot as plt
plt.semilogy(info.resnorms)
plt.show()
Testing
To run the krylov unit tests, check out this repository and type
pytest
License
krylov is published under the MIT license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
krylov-0.0.1.tar.gz
(41.5 kB
view hashes)
Built Distribution
krylov-0.0.1-py3-none-any.whl
(38.5 kB
view hashes)