jax.scipy.linalg.hilbert

Contents

jax.scipy.linalg.hilbert#

jax.scipy.linalg.hilbert(n)[source]#

Create a Hilbert matrix of order n.

JAX implementation of scipy.linalg.hilbert().

The Hilbert matrix is defined by:

\[H_{ij} = \frac{1}{i + j + 1}\]

for \(1 \le i \le n\) and \(1 \le j \le n\).

Parameters:

n (int) – the size of the matrix to create.

Returns:

A Hilbert matrix of shape (n, n)

Return type:

Array

Examples

>>> jax.scipy.linalg.hilbert(2)
Array([[1.        , 0.5       ],
       [0.5       , 0.33333334]], dtype=float32)
>>> jax.scipy.linalg.hilbert(3)
Array([[1.        , 0.5       , 0.33333334],
       [0.5       , 0.33333334, 0.25      ],
       [0.33333334, 0.25      , 0.2       ]], dtype=float32)