Skip to content

Commit

Permalink
DOC: add np.vecmat to the recommendation table
Browse files Browse the repository at this point in the history
  • Loading branch information
ev-br committed Nov 22, 2024
1 parent 984d172 commit eef324b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ explicitly namespaced with `np.`)
| `gulinalg` | `np.linalg` |
|:------------------------|:----------------------------------|
| `matrix_multiply(a, b)` | `a @ b`, `np.matmul(a, b)` |
| `matvec_multiply(a, b)` | `np.matvec(a, b)` (`numpy >= 2.2.0`) |
| `inner1d(a, b)` | `vecdot(a.conj(), b)` |
| `dotc1d(a, b)` | `vecdot(a, b)` |
| `cholesky(a, b)` | `cholesky(a, b)` |
Expand All @@ -79,16 +80,15 @@ explicitly namespaced with `np.`)



<!--| `matvec_multiply(a, b)` | `matvec(a, b)` (`numpy >= 2.2.0`) | -->

A few things to keep in mind when porting from `gulinalg` to `np.linalg`:

1. `np.linalg.vecdot` complex conjugates its first argument. Therefore for
complex-valued arguments it is equivalent to `gulinalg.dotc1d`, and for
real-valued arguments it is equivalent to `gulinalg.inner1d`.
2. For matrix factorization, `gulinalg` functions return tuples of arrays, while
`np.linalg` analogs return namedtuples.
3. For matrix factorizationsWhere the result is not unique (e.g., the
3. `np.matvec` and `np.vecmat` functions are new in NumPy version 2.2.0.
4. For matrix factorizationsWhere the result is not unique (e.g., the
`QR`factorization is unique only up to a matching permutation of the rows of
the `Q` matrix and the columns of the `R` matrix),
`np.linalg` and `gulinalg` functions may return different, if equivalent, results.
Expand Down

0 comments on commit eef324b

Please sign in to comment.