Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.numpy.linalg.eig

Contents

jax.numpy.linalg.eig#

jax.numpy.linalg.eig(a)[source]#

Compute the eigenvalues and eigenvectors of a square array.

JAX implementation ofnumpy.linalg.eig().

Parameters:

a (ArrayLike) – array of shape(...,M,M) for which to compute the eigenvalues and vectors.

Returns:

  • eigenvalues: an array of shape(...,M) containing the eigenvalues.

  • eigenvectors: an array of shape(...,M,M), where columnv[:,i] is theeigenvector corresponding to the eigenvaluew[i].

Return type:

A namedtuple(eigenvalues,eigenvectors). The namedtuple has fields

Notes

  • This differs fromnumpy.linalg.eig() in that the return type ofjax.numpy.linalg.eig() is always complex64 for 32-bit input, and complex128for 64-bit input.

  • At present, non-symmetric eigendecomposition is only implemented on the CPU andGPU backends. For more details about the GPU implementation, see thedocumentation forjax.lax.linalg.eig().

See also

Examples

>>>a=jnp.array([[1.,2.],...[2.,1.]])>>>w,v=jnp.linalg.eig(a)>>>withjax.numpy.printoptions(precision=4):...wArray([ 3.+0.j, -1.+0.j], dtype=complex64)>>>vArray([[ 0.70710677+0.j, -0.70710677+0.j],       [ 0.70710677+0.j,  0.70710677+0.j]], dtype=complex64)
Contents

[8]ページ先頭

©2009-2025 Movatter.jp