Skip to content

Commit 94cc3f7

Browse files
authored
Refine citation references in README, lsmr, and tridiag_sym (#259)
* Mention that a Matfree paper is in preparation * Add bibtex's for LSMR and Lanczos to the respective functions * Fix a typo
1 parent f3d42d1 commit 94cc3f7

4 files changed

Lines changed: 51 additions & 26 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ doc-preview:
2323
python scripts/generate_api_docs.py
2424
python scripts/readme_to_dev_docs.py
2525
python scripts/tutorials_to_py_light.py
26-
mkdocs serve
26+
JUPYTER_PLATFORM_DIRS=1 mkdocs serve
2727

2828
doc-build:
2929
python scripts/generate_api_docs.py

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,10 @@ These tutorials include, among other things:
102102
**Citation**
103103

104104
Thank you for using Matfree!
105-
If you are using Matfree's differentiable Lanczos or Arnoldi iterations, then you
106-
are using the algorithms from [this paper](https://arxiv.org/abs/2405.17277).
107-
We would appreciate it if you cited the paper as follows:
105+
A dedicated paper about Matfree itself is in preparation.\
106+
In the meantime, if you are using Matfree's **differentiable Lanczos or Arnoldi iterations**, then you
107+
are using the algorithms introduced by [this paper](https://arxiv.org/abs/2405.17277).
108+
We would appreciate it if you cited it as follows:
108109

109110
```bibtex
110111
@article{kraemer2024gradients,
@@ -117,9 +118,9 @@ We would appreciate it if you cited the paper as follows:
117118
}
118119
```
119120

120-
If you are using Matfree's differentiable LSMR implementation, then you
121+
If you are using Matfree's **differentiable LSMR implementation**, then you
121122
are using the algorithm from [this paper](https://arxiv.org/abs/2510.19634).
122-
We would appreciate it if you cited the paper as follows:
123+
We would appreciate it if you cited it as follows:
123124

124125
```bibtex
125126
@article{roy2025matrix,

matfree/decomp.py

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,30 @@ def tridiag_sym(
3737
):
3838
r"""Construct an implementation of **tridiagonalisation**.
3939
40-
Uses pre-allocation, and full reorthogonalisation if `reortho` is set to `"full"`.
41-
It tends to be a good idea to use full reorthogonalisation.
42-
43-
This algorithm assumes a **symmetric matrix**.
44-
45-
Decompose a matrix into a product of orthogonal-**tridiagonal**-orthogonal matrices.
40+
Decompose a **symmetric** matrix into a product of orthogonal-**tridiagonal**-orthogonal matrices.
4641
Use this algorithm for approximate **eigenvalue** decompositions.
42+
The present implementation allocates all Lanczos vectors before running the
43+
algorithm. If `reortho` is set to `"full"`, it also uses full reorthogonalisation.
44+
It is usually a good idea to use full reorthogonalisation.
45+
Matrix-free tridiagonalisation uses Lanczos' (1950) algorithm:
46+
47+
??? note "BibTex for Lanczos (1950)"
48+
```bibtex
49+
@article{lanczos1950iteration,
50+
title={An iteration method for the solution of the eigenvalue problem of linear differential and integral operators},
51+
author={Lanczos, Cornelius},
52+
journal={Journal of research of the National Bureau of Standards},
53+
volume={45},
54+
number={4},
55+
pages={255--282},
56+
year={1950}
57+
}
58+
```
4759
4860
Setting `custom_vjp` to `True` implies using efficient, numerically stable
49-
gradients of the Lanczos iteration according to what has been proposed by
50-
Krämer et al. (2024).
61+
gradients of the Lanczos iteration which was proposed by Krämer et al. (2024).
5162
These gradients are exact, so there is little reason not to use them.
52-
If you use this configuration, please consider
53-
citing Krämer et al. (2024; bibtex below).
63+
If you use this configuration, please cite Krämer et al. (2024):
5464
5565
??? note "BibTex for Krämer et al. (2024)"
5666
```bibtex
@@ -602,9 +612,10 @@ def bidiag(num_matvecs: int, /, materialize: bool = True, reortho: str = "full")
602612
??? note "A note about differentiability"
603613
Unlike [tridiag_sym][matfree.decomp.tridiag_sym] or
604614
[hessenberg][matfree.decomp.hessenberg], this function's reverse-mode
605-
derivatives are very efficient. Custom gradients for bidiagonalisation
606-
are a work in progress, and if you need to differentiate the decompositions,
607-
consider using [tridiag_sym][matfree.decomp.tridiag_sym] for the time being.
615+
derivatives are not efficient. Custom gradients for bidiagonalisation
616+
are a work in progress. In the meantime,
617+
if you need to differentiate the decompositions, consider using
618+
[tridiag_sym][matfree.decomp.tridiag_sym] instead (if possible).
608619
609620
"""
610621

matfree/lstsq.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,38 @@ def lsmr(
2626
):
2727
r"""Construct an experimental implementation of LSMR.
2828
29-
Follows the [implementation in SciPy](https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.lsmr.html),
29+
Follows the [SciPy's implementation](https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.lsmr.html),
3030
but uses JAX.
31+
LSMR is due to Fong and Saunders (2011):
3132
33+
??? note "BibTex for Fong and Saunders (2011)"
34+
```bibtex
35+
@article{fong2011lsmr,
36+
title={{LSMR}: An iterative algorithm for sparse least-squares problems},
37+
author={Fong, David Chin-Lung and Saunders, Michael},
38+
journal={SIAM Journal on Scientific Computing},
39+
volume={33},
40+
number={5},
41+
pages={2950--2971},
42+
year={2011},
43+
publisher={SIAM}
44+
}
45+
```
3246
3347
Setting `custom_vjp` to `True` implies using the low-memory
3448
gradients of matrix-free least squares,
3549
according to what has been proposed by Roy et al. (2025).
3650
[Here](https://arxiv.org/abs/2510.19634) is a link to the preprint.
3751
These gradients are exact, so there is little reason not to use them.
38-
If you use this configuration, please consider
39-
citing Roy et al. (2025; bibtex below).
52+
If you use this configuration, please cite Roy et al. (2025):
4053
4154
??? note "BibTex for Roy et al. (2025)"
4255
```bibtex
4356
@article{roy2025matrix,
44-
title={Matrix-Free Least Squares Solvers: Values, Gradients, and What to Do With Them},
45-
author={Roy, Hrittik and Hauberg, S{\\o}ren and Kr{\"a}mer, Nicholas},
46-
journal={arXiv preprint arXiv:2510.19634},
47-
year={2025}
57+
title={Matrix-Free Least Squares Solvers: Values, Gradients, and What to Do With Them},
58+
author={Roy, Hrittik and Hauberg, S{\\o}ren and Kr{\"a}mer, Nicholas},
59+
journal={arXiv preprint arXiv:2510.19634},
60+
year={2025}
4861
}
4962
```
5063
"""

0 commit comments

Comments
 (0)