jax.scipy.linalg.circulant

Contents

jax.scipy.linalg.circulant#

jax.scipy.linalg.circulant(c)[source]#

Construct a circulant matrix.

JAX implementation of scipy.linalg.circulant().

A circulant matrix has cyclically shifted columns: \(A_{ij} = c_{(i - j) \bmod n}\) for \(0 \le i, j < n\), where c specifies the first column.

Parameters:

c (ArrayLike) – array of shape (..., N) specifying the first column.

Returns:

A circulant matrix of shape (..., N, N).

Return type:

Array

Examples

>>> c = jnp.array([1, 2, 3])
>>> jax.scipy.linalg.circulant(c)
Array([[1, 3, 2],
       [2, 1, 3],
       [3, 2, 1]], dtype=int32)

For N-dimensional c, the result is a batch of circulant matrices:

>>> c = jnp.array([[1, 2, 3], [4, 5, 6]])
>>> jax.scipy.linalg.circulant(c)
Array([[[1, 3, 2],
        [2, 1, 3],
        [3, 2, 1]],

       [[4, 6, 5],
        [5, 4, 6],
        [6, 5, 4]]], dtype=int32)