LPFN
Lie-Product Function Networks for geometry-preserving matrix Lie-group learning.
LPFN is a PyTorch research library for learning functions whose outputs must remain in a compact matrix Lie group. The library separates two concerns:
- scalar controls
x -> theta(x), represented by interchangeableControlModelclasses; and - Lie-group execution, represented by an
ExecutionEnginethat composes ordered exponentials of fixed generators.
For controls theta with shape [batch, K, r], LPFN implements the convention
U(x) = Q_M ... Q_2 Q_1 U_0,
Q_ell = exp(theta_ell B_ell),
where factors are flattened in increasing (k, a) order, so Q_1 acts first.
The matrix output stays on the target group by construction.
Status:
0.1.0is a public research release. The core semantics are tested, but the API may still evolve before1.0.
Install
pip install liepfn
Development install:
python -m pip install -e ".[dev]"
pytest
Minimal example
import torch
from lpfn import (
ChebyshevControls,
LieProductNetwork,
PauliGeneratorSet,
PauliMatrixEngine,
)
generators = PauliGeneratorSet(1)
controls = ChebyshevControls(
input_dim=1,
depth=2,
num_generators=generators.num_generators,
degree=3,
)
model = LieProductNetwork(
generators=generators,
controls=controls,
engine=PauliMatrixEngine(),
)
x = torch.linspace(-1, 1, 32, dtype=torch.float64).reshape(-1, 1)
U = model(x) # [32, 2, 2]
Changing ChebyshevControls to a spline, Fourier, MLP, or other control model
does not change the Lie geometry. Changing the matrix execution engine does not
change the scalar model.
Included control models
DirectControls— exact/reference controls.ChebyshevControls— total-degree multivariate Chebyshev expansions.FourierControls— real multivariate trigonometric bases with mixed modes.SplineControls— tensor-product open-uniform B-splines.MLPControls— generic neural controls.KANControls— experimental KAN-style B-spline edge controls.
Execution engines
TorchMatrixEngine— differentiable reference engine based on matrix exponentials.PauliMatrixEngine— optimized Pauli path usingcos(theta) I - i sin(theta) P.
What is tested
The test suite covers:
- generator validation and Pauli algebra;
- noncommutative factor ordering and base-point semantics;
- exact group/unitarity preservation;
- cross-engine numerical agreement;
- analytical, autograd, and finite-difference derivative checks;
- scalar-control shape/parameter contracts;
- losses and metrics;
- target/data utilities;
- end-to-end training;
- reproducible benchmark and validation-selection logic.
Documentation
The source repository includes:
docs/QUICKSTART.md— quick start;docs/PUBLIC_API.md— supported research API;docs/CONVENTIONS.md— mathematical conventions and ordering;docs/REPRODUCIBILITY.md— benchmark/reproducibility protocol;docs/KAN_CONTROLS.md— experimental KAN controls;CONTRIBUTING.md— development guidance;CHANGELOG.md— release history.
Research benchmarks
Research scripts are kept in benchmarks/, outside the installed package.
Generated checkpoints and result tables are intentionally excluded from the
release repository. This prevents benchmark artifacts from becoming part of the
runtime dependency or wheel.
Citation
If you use LPFN in research, please cite the software and the associated
Lie-Product Function Networks on Compact Matrix Lie Groups manuscript. A
machine-readable software citation is provided in CITATION.cff.
License
LPFN is released under the MIT License. See LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file liepfn-0.1.0.tar.gz.
File metadata
- Download URL: liepfn-0.1.0.tar.gz
- Upload date:
- Size: 63.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb9222391174de63c7734e7dbbbc708033a0bb163e304ef11fdf00491cf1e6a4
|
|
| MD5 |
049522d1c80743a6867c62bfa842159f
|
|
| BLAKE2b-256 |
1d83b0b993904b9dd03bda1cbd27e53bbdc99a87646c8288def7a2d5d6f02f88
|
Provenance
The following attestation bundles were made for liepfn-0.1.0.tar.gz:
Publisher:
release.yml on anfriosmo/lpfn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
liepfn-0.1.0.tar.gz -
Subject digest:
bb9222391174de63c7734e7dbbbc708033a0bb163e304ef11fdf00491cf1e6a4 - Sigstore transparency entry: 2619863297
- Sigstore integration time:
-
Permalink:
anfriosmo/lpfn@001200e1e2c4ecb953a556f4dbbc688aaa87cb42 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/anfriosmo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@001200e1e2c4ecb953a556f4dbbc688aaa87cb42 -
Trigger Event:
release
-
Statement type:
File details
Details for the file liepfn-0.1.0-py3-none-any.whl.
File metadata
- Download URL: liepfn-0.1.0-py3-none-any.whl
- Upload date:
- Size: 51.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9afa25560830412fbd8ddc57b59f27e9269592c048bf5fb4431594668e7fa697
|
|
| MD5 |
70d4ce04aa3e64fcd9fcee8d1fada717
|
|
| BLAKE2b-256 |
ecc82d7c8f04e8b676099b7b302028c0d6607d676c82a3c9ba235a4b840ac3ae
|
Provenance
The following attestation bundles were made for liepfn-0.1.0-py3-none-any.whl:
Publisher:
release.yml on anfriosmo/lpfn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
liepfn-0.1.0-py3-none-any.whl -
Subject digest:
9afa25560830412fbd8ddc57b59f27e9269592c048bf5fb4431594668e7fa697 - Sigstore transparency entry: 2619863346
- Sigstore integration time:
-
Permalink:
anfriosmo/lpfn@001200e1e2c4ecb953a556f4dbbc688aaa87cb42 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/anfriosmo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@001200e1e2c4ecb953a556f4dbbc688aaa87cb42 -
Trigger Event:
release
-
Statement type: