Skip to main content

Krylov subspace methods for Python

Project description

krylov

Krylov subspace methods.

gh-actions codecov Code style: black PyPI pyversions PyPi Version GitHub stars PyPi downloads

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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

krylov-0.0.1-py3-none-any.whl (38.5 kB view details)

Uploaded Python 3

File details

Details for the file krylov-0.0.1.tar.gz.

File metadata

  • Download URL: krylov-0.0.1.tar.gz
  • Upload date:
  • Size: 41.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for krylov-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9995fb9bb42445fc1aca184321053f4e4bd4c03894ce8fef8ee46ed917081851
MD5 bb76cb23070b9568495be1ddc09815fb
BLAKE2b-256 dfbfc7327005df8fb2311bc682e635599a77999d9dcedc133383737c6bcd6516

See more details on using hashes here.

File details

Details for the file krylov-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: krylov-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 38.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for krylov-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7f6c3ad3bec5ad6a4d9f4a51585a60d28bd29e0f5bb01fedbec02dab22256523
MD5 de6d8101acfd5202554d8555db9bf1a1
BLAKE2b-256 74d9aedec22ec8da794f2e7f08b5f9b82f755364765eb464bcb867d10852773f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page