A package dedicated to lazy linear operators based on diverse backends/libraries.
Project description
Lazylinop
A LazyLinOp
is a high-level linear operator based on an arbitrary underlying implementation, such as:
- custom Python functions,
- a `NumPy array`,
- a `SciPy matrix`,
- a `Faust` object,
- any Python linear operator.
Thanks to the Lazylinop API, this operator can be easily manipulated, transformed or aggregated with other linear operators to form more complex LazyLinOp
objects.
Thus, many operations are available such as the addition, concatenation, adjoint etc.
These operations are all ruled by the lazy paradigm: their evaluation is delayed until the resulting LazyLinOp
is actually applied to a vector (or to a collection of vectors, seen as a matrix).
Get started with lazylinop
Run the following command to install the lazylinop
package from PyPI:
pip install lazylinop
Run the following commands to install from conda:
conda config --add channels conda-forge
conda config --add channels lazylinop
conda install lazylinop
First steps
Build 2D FFT from 1D FFT and Kronecker product:
from lazylinop.signal import fft
from lazylinop.basicops import kron
fft2d = kron(fft(N), fft(N))
x = np.random.randn(fft2d.shape[1])
y = fft2d @ x
Build circular convolution from 1D FFT:
from lazylinop.signal import fft
from lazylinop.basicops import diag
DFT = fft(N) * np.sqrt(N)
D = diag(DFT @ filter, k=0)
L = (DFT / N).H @ D @ DFT
Authors
- Pascal Carrivain
- Simon Delamare
- Hakim Hadj-Djilani
- Remi Gribonval
Contribute to lazylinop
You can contribute to lazylinop
with bug report, feature request and merge request.
Useful links
- Link to the documentation: Gitlab pages
Running unit tests
cd tests
python3 -m unittest TestLazyLinOp.py
python3 -m unittest TestSignal.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file lazylinop-1.18.1-py3-none-any.whl
.
File metadata
- Download URL: lazylinop-1.18.1-py3-none-any.whl
- Upload date:
- Size: 230.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
2ad11db4722ddf426f5eae7f991d33c8efdb82b213a5a20008ff35dbc5098c05
|
|
MD5 |
beca95c54d122e2f047a9adc1ae52b7f
|
|
BLAKE2b-256 |
6415e0f3a48d35ebad16ece551aaca746428d4215c760a98c3b1f386847d9d67
|