eigvals#

ivy.eigvals(x, /)[source]#

Compute eigenvalues of x. Returns a set of eigenvalues.

Parameters:

x (Union[Array, NativeArray]) – An array of shape (…, N, N).

Return type:

Array

Returns:

w – Not necessarily ordered array(…, N) of eigenvalues in complex type.

Examples

With ivy.Array inputs: >>> x = ivy.array([[1,2], [3,4]]) >>> w = ivy.eigvals(x) >>> w ivy.array([-0.37228132+0.j, 5.37228132+0.j])

>>> x = ivy.array([[[1,2], [3,4]], [[5,6], [5,6]]])
>>> w = ivy.eigvals(x)
>>> w
ivy.array(
    [
        [-0.37228132+0.j,  5.37228132+0.j],
        [ 0.        +0.j, 11.        +0.j]
    ]
)
Array.eigvals(self, /)[source]#

ivy.Array instance method variant of ivy.eigvals. This method simply wraps the function, and so the docstring for ivy.eigvals also applies to this method with minimal changes.

Return type:

Array

Examples

>>> x = ivy.array([[1,2], [3,4]])
>>> x.eigvals()
ivy.array([-0.37228132+0.j,  5.37228132+0.j])
Container.eigvals(self, /, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False)[source]#

ivy.Container instance method variant of ivy.eigvals. This method simply wraps the function, and so the docstring for ivy.eigvals also applies to this method with minimal changes.

Parameters:

x – container with input arrays.

Return type:

Container

Returns:

ret – container including array corresponding to eigenvalues of input array

Examples

>>> x = ivy.array([[1,2], [3,4]])
>>> c = ivy.Container({'x':{'xx':x}})
>>> c.eigvals()
{
    x: {
        xx: ivy.array([-0.37228132+0.j, 5.37228132+0.j])
    }
}
>>> c.eigvals()['x']['xx']
ivy.array([-0.37228132+0.j,  5.37228132+0.j])