jax.scipy.linalg.invhilbert#
- jax.scipy.linalg.invhilbert(n)[source]#
Compute the inverse of the Hilbert matrix of order n.
JAX implementation of
scipy.linalg.invhilbert().The entries are given by a closed-form expression in terms of binomial coefficients:
\[H^{-1}_{ij} = (-1)^{i + j} (i + j + 1) \binom{n + i}{n - j - 1} \binom{n + j}{n - i - 1} \binom{i + j}{i}^2\]for \(0 \le i, j < n\).
- Parameters:
n (int) – the size of the matrix to create.
- Returns:
The inverse of the Hilbert matrix of shape
(n, n).- Return type:
Note
Unlike
scipy.linalg.invhilbert(), this function does not supportexact=True. The result is computed in floating point usingcomb(); for largenthe entries quickly exceed the dynamic range of finite-precision floats.See also
Examples
>>> with jnp.printoptions(precision=3, suppress=True): ... print(jax.scipy.linalg.invhilbert(2)) ... print(jax.scipy.linalg.invhilbert(3)) [[ 4. -6.] [-6. 12.]] [[ 9. -36. 30.] [ -36. 192. -180.] [ 30. -180. 180.]]