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
cspecifies the first column.- Parameters:
c (ArrayLike) – array of shape
(..., N)specifying the first column.- Returns:
A circulant matrix of shape
(..., N, N).- Return type:
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)