Linear Algebra#

Wrappers for numpy.linalg.


Most of the functions in this module are also available via the .linalg accessor from DataArray objects. See Intro to the linear algebra module for example usage.

The functions that are not available via the accessor are einsum, einsum_path, matmul and get_default_dims.

Matrix and vector products#

einsum(dims, *operands[, keep_dims, ...])

Expose numpy.einsum with an xarray-like API.

einsum_path(dims, *operands[, keep_dims, ...])

Expose numpy.einsum_path with an xarray-like API.

matmul(da, db[, dims, out_append])

Wrap numpy.linalg.matmul.

linalg.matrix_transpose(da, dims)

Transpose the underlying matrix without modifying the dimensions.

linalg.matrix_power(da, n[, dims])

Wrap numpy.linalg.matrix_power.


cholesky(da[, dims])

Wrap numpy.linalg.cholesky.

qr(da[, dims, mode, out_append])

Wrap numpy.linalg.qr.

svd(da[, dims, full_matrices, compute_uv, ...])

Wrap numpy.linalg.svd.

Matrix eigenvalues#

eig(da[, dims])

Wrap numpy.linalg.eig.

eigh(da[, dims, UPLO])

Wrap numpy.linalg.eigh.

eigvals(da[, dims])

Wrap numpy.linalg.eigvals.

eigvalsh(da[, dims, UPLO])

Wrap numpy.linalg.eigvalsh.

Norms and other numbers#

norm(da[, dims, ord])

Wrap numpy.linalg.norm.

cond(da[, dims, p])

Wrap numpy.linalg.cond.

det(da[, dims])

Wrap numpy.linalg.det.

matrix_rank(da[, dims, tol, hermitian])

Wrap numpy.linalg.matrix_rank.

slogdet(da[, dims])

Wrap numpy.linalg.slogdet.

trace(da[, dims, offset, dtype, out])

Wrap numpy.trace.


diagonal(da[, dims, offset])

Wrap numpy.diagonal.

Solving equations and inverting matrices#

solve(da, db[, dims])

Wrap numpy.linalg.solve.

inv(da[, dims])

Wrap numpy.linalg.inv.

Convenience functions#

get_default_dims(da1_dims[, d2_dims])

Get the dimensions corresponding to the matrices.