matrix_props.is_circulant

Checks if the matrix is circulant.

Functions

is_circulant(mat)

Determine if matrix is circulant [1].

Module Contents

matrix_props.is_circulant.is_circulant(mat)

Determine if matrix is circulant [1].

A circulant matrix is a square matrix in which all row vectors are composed of the same elements and each row vector is rotated one element to the right relative to the preceding row vector.

Examples

Consider the following matrix:

\[\begin{split}C = \begin{pmatrix} 4 & 1 & 2 & 3 \\ 3 & 4 & 1 & 2 \\ 2 & 3 & 4 & 1 \\ 1 & 2 & 3 & 4 \end{pmatrix}\end{split}\]

As can be seen, this matrix is circulant. We can verify this in toqito as

>>> from toqito.matrix_props import is_circulant
>>> import numpy as np
>>> mat = np.array([[4, 1, 2, 3], [3, 4, 1, 2], [2, 3, 4, 1], [1, 2, 3, 4]])
>>> is_circulant(mat)
True

References

[1] (1,2)

Wikipedia. Circulant matrix. URL: https://en.wikipedia.org/wiki/Circulant_matrix.

Parameters:

mat (numpy.ndarray) – Matrix to check the circulancy of.

Returns:

Return True if mat is circulant; False otherwise.

Return type:

bool