Expand description
Utility functions for matrix printing, shape retrieval, identity generation, Kronecker product, trace, transpose operations, …
This module contains small user-facing utilities, plus hidden unstable helpers used by backend implementation crates. It is not meant to be a complete collection of linear algebra utilities at this time.
Functions§
- diag
- Creates a diagonal matrix from a 1D slice, placing its elements on the main diagonal.
- identity
- Creates an identity matrix of size
n x n. - identity_
k - Creates a diagonal matrix of size
n x nwith ones on a specified diagonal. - kron
- Computes the Kronecker product of two 2D tensors.
- pretty_
print - Displays a numeric
mdarrayin a human-readable format (NumPy-style) - trace
- Computes the trace of a square matrix (sum of diagonal elements).
- unravel_
index - Converts a flat index to multidimensional coordinates.