pyriemann.utils.base.sqrtm

pyriemann.utils.base.sqrtm(C)

Square root of SPD matrices.

The matrix square root of a SPD matrix C is defined by:

\[\mathbf{D} = \mathbf{V} \left( \mathbf{\Lambda} \right)^{1/2} \mathbf{V}^\top\]

where \(\mathbf{\Lambda}\) is the diagonal matrix of eigenvalues and \(\mathbf{V}\) the eigenvectors of \(\mathbf{C}\).

Parameters
Cndarray, shape (…, n, n)

SPD matrices, at least 2D ndarray.

Returns
Dndarray, shape (…, n, n)

Matrix square root of C.