Lazylinop
Lazylinop is a python toolbox to ease and accelerate computations with ("matrix-free") linear operators. It provides glue to combine linear operators as easily as NumPy arrays, PyTorch/CuPy compatibility, standard signal/image processing linear operators, as well as advanced tools to approximate large matrices by efficient butterfly operators.
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 CuPy array,
- a torch tensor,
- 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).
Install
Please refer to the documentation to install Lazylinop.
Get started
You can read our documentation and our quick tour.
First steps
Build 2D FFT from 1D FFT and Kronecker product:
from lazylinop.signal import fft
from lazylinop.basicops import kron
F1 = fft(N)
F2 = kron(F1, F1)
x = np.random.randn(F2.shape[1])
y = F2 @ x
Build circular convolution from 1D FFT:
from lazylinop.signal import fft
from lazylinop.basicops import diag
F = fft(N)
D = diag(F @ filter, k=0)
L = F.H @ D @ F
Please refer to tutorials for advanced examples.
Authors
- Pascal Carrivain
- Simon Delamare
- Hakim Hadj-Djilani
- Remi Gribonval
Contributing
You can contribute to Lazylinop with bug report, feature request and merge request.
Running unit tests
cd tests
python3 -m unittest TestLazyLinOp.py
python3 -m unittest TestSignal.py
Metadata
Release files for lazylinop 1.24.28
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lazylinop-1.24.28-py3-none-any.whl | Python 3 | none | any | Details |
Release files / lazylinop-1.24.28-py3-none-any.whl
| Download URL | lazylinop-1.24.28-py3-none-any.whl |
|---|---|
| Size | 349.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a7305024a83f6ada7080b09c1a9a7ba3c722e1175b3d1f8f242bce2fb06f7e21
|
|
BLAKE2b-256 checksum How to use checksums |
7851b01b5198d6addb1ac16e94588e527607c0857ef458607c1077fe36663e7d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Security for lazylinop 1.24.28
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.